Datasets:
Add files using upload-large-folder tool
Browse files- md/train/48uzkHOKMfz/48uzkHOKMfz.md +198 -0
- md/train/4cEapqXfP30/4cEapqXfP30.md +266 -0
- md/train/5m3SEczOV8L/5m3SEczOV8L.md +0 -0
- md/train/B1p461b0W/B1p461b0W.md +216 -0
- md/train/B8fp0LVMHa/B8fp0LVMHa.md +586 -0
- md/train/BJe-_CNKPH/BJe-_CNKPH.md +220 -0
- md/train/BJe4oxHYPB/BJe4oxHYPB.md +287 -0
- md/train/BJleph4KvS/BJleph4KvS.md +455 -0
- md/train/Bkgk624KDB/Bkgk624KDB.md +310 -0
- md/train/Bkl5kxrKDr/Bkl5kxrKDr.md +0 -0
- md/train/BklWt24tvH/BklWt24tvH.md +297 -0
- md/train/Byj72udxe/Byj72udxe.md +297 -0
- md/train/H1fsUiRcKQ/H1fsUiRcKQ.md +384 -0
- md/train/H1rRWl-Cb/H1rRWl-Cb.md +510 -0
- md/train/HShLSEcVZJ4/HShLSEcVZJ4.md +283 -0
- md/train/HkIQH7qel/HkIQH7qel.md +249 -0
- md/train/HkfPSh05K7/HkfPSh05K7.md +314 -0
- md/train/HkxAS6VFDB/HkxAS6VFDB.md +343 -0
- md/train/HyRVBzap-/HyRVBzap-.md +307 -0
- md/train/HyxCxhRcY7/HyxCxhRcY7.md +396 -0
- md/train/IpmfpAGoH2KbX/IpmfpAGoH2KbX.md +130 -0
- md/train/JWOiYxMG92s/JWOiYxMG92s.md +316 -0
- md/train/JiYq3eqTKY/JiYq3eqTKY.md +0 -0
- md/train/KCd-3Pz8VjM/KCd-3Pz8VjM.md +305 -0
- md/train/LXMSvPmsm0g/LXMSvPmsm0g.md +407 -0
- md/train/RO4DM85Z4P7/RO4DM85Z4P7.md +192 -0
- md/train/RUQ1zwZR8_/RUQ1zwZR8_.md +200 -0
- md/train/S1enmaVFvS/S1enmaVFvS.md +365 -0
- md/train/SJCPLLpaW/SJCPLLpaW.md +313 -0
- md/train/SJeHwJSYvH/SJeHwJSYvH.md +372 -0
- md/train/SJfWKsC5K7/SJfWKsC5K7.md +341 -0
- md/train/SJl5Np4tPr/SJl5Np4tPr.md +356 -0
- md/train/SkEYojRqtm/SkEYojRqtm.md +351 -0
- md/train/Ske6wiAcKQ/Ske6wiAcKQ.md +214 -0
- md/train/SkxSv6VFvS/SkxSv6VFvS.md +343 -0
- md/train/ZBfUo_dr4H/ZBfUo_dr4H.md +283 -0
- md/train/ZRcjSOmYraB/ZRcjSOmYraB.md +203 -0
- md/train/_x4A8IZ-rRv/_x4A8IZ-rRv.md +540 -0
- md/train/cVwc7IHWEWi/cVwc7IHWEWi.md +317 -0
- md/train/gV3wdEOGy_V/gV3wdEOGy_V.md +0 -0
- md/train/jLoC4ez43PZ/jLoC4ez43PZ.md +376 -0
- md/train/jWkw45-9AbL/jWkw45-9AbL.md +0 -0
- md/train/k7aeAz4Vbb/k7aeAz4Vbb.md +289 -0
- md/train/qG4ZVCCyCB0/qG4ZVCCyCB0.md +0 -0
- md/train/r1l4eQW0Z/r1l4eQW0Z.md +591 -0
- md/train/rkFBJv9gg/rkFBJv9gg.md +258 -0
- md/train/ryetZ20ctX/ryetZ20ctX.md +318 -0
- md/train/ryxIZR4tvS/ryxIZR4tvS.md +264 -0
- md/train/x1Lp2bOlVIo/x1Lp2bOlVIo.md +321 -0
- md/train/zspml_qcldq/zspml_qcldq.md +268 -0
md/train/48uzkHOKMfz/48uzkHOKMfz.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Accelerating Robotic Reinforcement Learning via Parameterized Action Primitives
|
| 2 |
+
|
| 3 |
+
Murtaza Dalal Deepak Pathak† Ruslan Salakhutdinov† Carnegie Mellon University {mdalal,dpathak,rsalakhu} @ cs.cmu.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Despite the potential of reinforcement learning (RL) for building general-purpose robotic systems, training RL agents to solve robotics tasks still remains challenging due to the difficulty of exploration in purely continuous action spaces. Addressing this problem is an active area of research with the majority of focus on improving RL methods via better optimization or more efficient exploration. An alternate but important component to consider improving is the interface of the RL algorithm with the robot. In this work, we manually specify a library of robot action primitives (RAPS), parameterized with arguments that are learned by an RL policy. These parameterized primitives are expressive, simple to implement, enable efficient exploration and can be transferred across robots, tasks and environments. We perform a thorough empirical study across challenging tasks in three distinct domains with image input and a sparse terminal reward. We find that our simple change to the action interface substantially improves both the learning efficiency and task performance irrespective of the underlying RL algorithm, significantly outperforming prior methods which learn skills from offline expert data. Code and videos at https://mihdalal.github.io/raps/
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Meaningful exploration remains a challenge for robotic reinforcement learning systems. For example, in the manipulation tasks shown in Figure 1, useful exploration might correspond to picking up and placing objects in different configurations. However, random motions in the robot’s joint space will rarely, if ever, result in the robot touching the objects, let alone pick them up. Recent work, on the other hand, has demonstrated remarkable success in training RL agents to solve manipulation tasks [4, 24, 26] by sidestepping the exploration problem with careful engineering. Levine et al. [26] use densely shaped rewards, while Kalashnikov et al. [24] leverage a large scale robot infrastructure and Andrychowicz et al. [4] require training in simulation with engineered reward functions in order to transfer to the real world. In general, RL methods can be prohibitively data inefficient, require careful reward development to learn, and struggle to scale to more complex tasks without the aid of human demonstrations or carefully designed simulation setups.
|
| 12 |
+
|
| 13 |
+
An alternative view on why RL is difficult for robotics is that it requires the agent to learn both what to do in order to achieve the task and how to control the robot to execute the desired motions. For example, in the kitchen environment featured at the bottom of Figure 1, the agent would have to learn how to accurately manipulate the arm to reach different locations as well as how to grasp different objects, while also ascertaining what object it has to grasp and where to move it. Considered independently, the problems of controlling a robot arm to execute particular motions and figuring out the desired task from scalar reward feedback, then achieving it, are non-trivial. Jointly learning to solve both problems makes the task significantly more difficult.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Visual depiction of RAPS, outlining the process of how a primitive is executed on a robot. Given an input image, the policy outputs a distribution over primitives and a distribution over all the arguments of all primitives, samples a primitive and selects its corresponding argument distribution parameters, indexed by which primitive was chosen, samples an argument from that distribution and executes a controller in a feedback loop on the robot for a fixed number of timesteps $( H _ { k } )$ to reach a new state. We show an example sequence of executing the lift primitive after having grasped the kettle in the Kitchen environment. The agent observes the initial (0) and final states $\boldsymbol { H _ { k } } )$ ) and receives a reward equal to the reward accumulated when executing the primitive. Below we visualize representative tasks from the three environment suites that we evaluate on.
|
| 17 |
+
|
| 18 |
+
In contrast to training RL agents on raw actions such as torques or delta positions, a common strategy is to decompose the agent action space into higher (i.e., what) and lower (i.e., how) level structures. A number of existing methods have focused on designing or learning this structure, from manually architecting and fine-tuning action hierarchies [14, 27, 32, 47], to organizing agent trajectories into distinct skills [3, 20, 41, 50] to more recent work on leveraging large offline datasets in order to learn skill libraries [29, 40]. While these methods have shown success in certain settings, many of them are either too sample inefficient, do not scale well to more complex domains, or lack generality due to dependence on task relevant data.
|
| 19 |
+
|
| 20 |
+
In this work, we investigate the following question: instead of learning low-level primitives, what if we were to design primitives with minimal human effort, enable their expressiveness by parameterizing them with arguments and learn to control them with a high-level policy? Such primitives have been studied extensively in task and motion planning (TAMP) literature [22] and implemented as parameterized actions [19] in RL. We apply primitive robot motions to redefine the policy-robot interface in the context of robotic reinforcement learning. These primitives include manually defined behaviors such as lift, push, top-grasp, and many others. The behavior of these primitives is parameterized by arguments that are the learned outputs of a policy network. For instance, top-grasp is parameterized by four scalar values: grasp position $\mathbf { \Phi } ( \mathbf { x } , \mathbf { y } )$ , how much to move down (z) and the degree to which the gripper should close. We call this application of parameterized behaviors, Robot Action Primitives for RL (RAPS). A crucial point to note is that these parameterized actions are easy to design, need only be defined once and can be re-used without modification across tasks.
|
| 21 |
+
|
| 22 |
+
The main contribution of this work is to support the effectiveness of RAPS via a thorough empirical evaluation across several dimensions:
|
| 23 |
+
|
| 24 |
+
• How do parameterized primitives compare to other forms of action parameterization? • How does RAPS compare to prior methods that learn skills from offline expert data? • Is RAPS agnostic to the underlying RL algorithm? • Can we stitch the primitives to perform multiple complex manipulation tasks in sequence? • Does RAPS accelerate exploration even in the absence of extrinsic rewards?
|
| 25 |
+
|
| 26 |
+
We investigate these questions across complex manipulation environments including Kitchen Suite, Metaworld and Robosuite domains. We find that a simple parameterized action based approach outperforms prior state-of-the-art by a significant margin across most of these settings2
|
| 27 |
+
|
| 28 |
+
# 2 Related Work
|
| 29 |
+
|
| 30 |
+
Higher Level Action and Policy Spaces in Robotics In robotics literature, decision making over primitive actions that execute well-defined behaviors has been explored in the context of task and motion planning [9, 22, 23, 43]. However, such methods are dependent on accurate state estimation pipelines to enable planning over the argument space of primitives. One advantage of using reinforcement learning methods instead is that the agent can learn to adjust its implicit state estimates through trial and error experience. Dynamic Movement Primitive and ensuing policy search approaches [11, 21, 25, 36, 37] leverage dynamical systems to learn flexible, parameterized skills, but are sensitive to hyper-parameter tuning and often limited to the behavior cloning regime. Neural Dynamic Policies [6] incorporate dynamical structure into neural network policies for RL, but evaluate in the state based regime with dense rewards, while we show that parameterized actions can enable RL agents to efficiently explore in sparse reward settings from image input.
|
| 31 |
+
|
| 32 |
+
Hierarchical RL and Skill Learning Enabling RL agents to act effectively over temporally extended horizons is a longstanding research goal in the field of hierarchical RL. Prior work introduced the options framework [45], which outlines how to leverage lower level policies as actions for a higher level policy. In this framework, parameterized action primitives can be viewed as a particular type of fixed option with an initiation set that corresponds to the arguments of the primitive. Prior work on options has focused on discovering [1, 12, 41] or fine-tuning options [5, 14, 27] in addition to learning higher level policies. Many of these methods have not been extended beyond carefully engineered state based settings. More recently, research has focused on extracting useful skills from large offline datasets of interaction data ranging from unstructured interaction data [49], play [28, 29] to demonstration data [2, 35, 39, 40, 44, 46, 53]. While these methods have been shown to be successful on certain tasks, the learned skills are only relevant for the environment they are trained on. New demonstration data must be collected to use learned skills for a new robot, a new task, or even a new camera viewpoint. Since RAPS uses manually specified primitives dependent only on the robot state, RAPS can re-use the same implementation details across robots, tasks and domains.
|
| 33 |
+
|
| 34 |
+
Parameterized Actions in RL The parameterized action Markov decision process (PAMDP) formalism was first introduced in Masson et al. [31], though there is a large body of earlier work in the area of hybrid discrete-continuous control, surveyed in [7, 8]. Most recent research on PAMDPs has focused on better aligning policy architectures and RL updates with the nature of parameterized actions and has largely been limited to state based domains [13, 51]. A number of papers in this area have focused on solving a simulated robot soccer domain modeled as either a single-agent [19, 31, 48] or multi-agent [15] problem. In this paper, we consider more realistic robotics tasks that involve interaction with and manipulation of common household objects. While prior work [42] has trained RL policies to select hand-designed behaviors for simultaneous execution, we instead train RL policies to leverage more expressive, parameterized behaviors to solve a wide variety of tasks. Closely related to this work is Chitnis et al. [10], which develops a specific architecture for training policies over parameterized actions from state input and sparse rewards in the context of bi-manual robotic manipulation. Our work is orthogonal in that we demonstrate that a higher level policy architecture is sufficient to solve a large suite of manipulation tasks from image input. We additionally note that there is concurrent work [34] that also applies engineered primitives in the context of RL, however, we consider learning from image input and sparse terminal rewards.
|
| 35 |
+
|
| 36 |
+
# 3 Robot Action Primitives in RL
|
| 37 |
+
|
| 38 |
+
To address the challenge of exploration and behavior learning in continuous action spaces, we decompose a desired task into the what (high level task) and the how (control motion). The what is handled by the environment-centric RL policy while the how is handled by a fixed, manually defined set of agent-centric primitives parameterized by continuous arguments. This enables the high level policy to reason about the task at a high level by choosing primitives and their arguments while leaving the low-level control to the parameterized actions themselves.
|
| 39 |
+
|
| 40 |
+
# 3.1 Background
|
| 41 |
+
|
| 42 |
+
Let the Markov decision process (MDP) be defined as $( S , A , \mathcal { R } ( s , a , s ^ { \prime } ) , \mathcal { T } ( s ^ { \prime } | s , a ) , p ( s _ { 0 } ) , \gamma , )$ in which $s$ is the set of true states, $\mathcal { A }$ is the set of possible actions, $\mathcal { R } ( s , a , s ^ { \prime } )$ is the reward function, $\mathcal { T } ( s ^ { \prime } | s , a )$ is the transition probability distribution, $p ( s _ { 0 } )$ defines the initial state distribution, and $\gamma$ is the discount factor. The agent executes actions in the environment using a policy $\pi ( a | s )$ with a corresponding trajectory distribution $p ( \tau = ( s _ { 0 } , a _ { 0 } , . . . a _ { t - 1 } , s _ { T } ) ) = p ( s _ { 0 } ) \Pi _ { t } \pi ( a _ { t } | s _ { t } ) \mathcal { T } ( s _ { t + 1 } | s _ { t } , a _ { t } )$ . The goal of the RL agent is to maximize the expected sum of rewards with respect to the policy: $\begin{array} { r } { \mathbb { E } _ { s _ { 0 } , a _ { 0 } , \dots a _ { t - 1 } , s _ { T } , \sim p ( \tau ) } \mathsf { \bar { [ \sum _ { t } \gamma ^ { t } \mathcal { R } ( s _ { t } , a _ { t } ) ] } } } \end{array}$ . In the case of vision-based RL, the setup is now a partially observed Markov decision process (POMDP); we have access to the true state via image observations. In this case, we include an observation space $\mathcal { O }$ which corresponds to the set of visual observations that the environment may emit, an observation model $p ( o | s )$ which defines the probability of emission and policy $\pi ( a | o )$ which operates over observations. In this work, we consider various modifications to the action space $\mathcal { A }$ while keeping all other components of the MDP or POMDP the same.
|
| 43 |
+
|
| 44 |
+
# 3.2 Parameterized Action Primitives
|
| 45 |
+
|
| 46 |
+
We now describe the specific nature of our parameterized primitives and how they can be integrated into RL algorithms (see Figure 1 for an end-to-end visualization of the method). In a library of $K$ primitives, the $\mathbf { k }$ -th primitive is a function $f _ { k } ( s , \mathrm { a r g s } )$ that executes a controller $C _ { k }$ on a robot for a fixed horizon $H _ { k }$ , $s$ is the robot state and args is the value of the arguments passed to $f _ { k }$ . args is used to compute a target robot state $s ^ { * }$ and then $C _ { k }$ is used to drive $s$ to $s ^ { * }$ . A primitive dependent error metric $e _ { k } ( s , s ^ { * } )$ determines the trajectory $C _ { k }$ takes to reach $s ^ { * }$ . $C _ { k }$ is a general purpose state reaching controller, e.g. an end-effector or joint position controller; we assume access to such a controller for each robot and it is straightforward to define and tune if not provided. In this case, the same primitive implementation can be re-used across any robot. In this setup, the choice of controller, error metric and method to compute $s ^ { * }$ define the behavior of the primitive motion, how it uniquely forms a movement in space. We refer to Procedure 1 for a general outline of a parameterized primitive. To summarize, each skill is a feedback control loop with end-effector low level actions. The input arguments are used to define a target state to achieve and the primitive executes a loop to drive the error between the robot state and the target robot state to zero.
|
| 47 |
+
|
| 48 |
+
As an example, consider the “lifting“ primitive, which simply involves lifting the robot arm upward. For this action, args is the amount to lift the robot arm, e.g. by $2 0 \mathrm { c m } .$ ., the robot state for this primitive is the robot end-effector position, $\mathbf { k }$ is the index of the lifting primitive in the library, $C _ { k }$ is an end-effector controller, $e _ { k } ( s , s ^ { * } ) = s ^ { * } - s$ , and $H _ { k }$ is the end-effector controller horizon, which in our setting ranges from 100-300. The target position $s ^ { * }$ is computed as $s + [ 0 , 0$ , args]. $f$ moves the robot arm for $H _ { k }$ steps, driving $s$ towards $s ^ { * }$ . The other primitives are defined in a similar manner; see the appendix for a precise description of each primitive we define.
|
| 49 |
+
|
| 50 |
+
Robot action primitives are a function of the robot state, not the world state. The primitives function by reaching set points of the robot state as directed by the policy, hence they are agentcentric. This design makes primitives agnostic to camera view, visual distractors and even the underlying environment itself. The RL policy, on the other hand, is environment centric: it chooses the primitive and appropriate arguments based on environment observations in order to
|
| 51 |
+
|
| 52 |
+
# Procedure 1 Parameterized Action Primitive
|
| 53 |
+
|
| 54 |
+
Input: primitive dependent argument vector args, primitive index $k$ , robot state $s$
|
| 55 |
+
1: compute $s ^ { * } ( \mathrm { a r g s } , s )$
|
| 56 |
+
2: for $i = 1 , . . . , H _ { k }$ low-level steps do
|
| 57 |
+
3: $e _ { i } = e _ { k } ( s _ { i } , s ^ { * } )$ $\triangleright$ compute state error
|
| 58 |
+
4: $a _ { i } = C _ { k } ( e _ { i } , s _ { i } )$ . compute torques
|
| 59 |
+
5: execute $a _ { i }$ on robot
|
| 60 |
+
6: end for
|
| 61 |
+
|
| 62 |
+
best achieve the task. A key advantage of this decomposition is that the policy no longer has to learn how to move the robot and can focus directly on what it needs to do. Meanwhile, the low-level control need not be perfect because the policy can account for most discrepancies using the arguments.
|
| 63 |
+
|
| 64 |
+
One issue with using a fixed library of primitives is that it cannot define all possible robot motions. As a result, we include a dummy primitive that corresponds to the raw action space. The dummy primitive directly takes in a delta position and then tries to achieve it by taking a fixed number of steps. This does not entirely resolve the issue as the dummy primitive operates on the high level horizon for $H _ { k }$ steps when called. Since the primitive is given a fixed goal for $H _ { k }$ steps, it is less expressive than a feedback policy that could provide a changing argument at every low-level step. For example, if the task is to move in a circle, the dummy primitive with a fixed argument could not provide a target state that would directly result in the desired motion without resorting to a significant number of higher level actions, while a feedback policy could iteratively update the target state to produce a smooth motion in a circle. Therefore, it cannot execute every trajectory that a lower level policy could; however, the primitive library as a whole performs well in practice.
|
| 65 |
+
|
| 66 |
+
In order to integrate these parameterized actions into the RL setting, we modify the action space of a standard RL environment to involve two operations at each time step: (a) choose a primitive out of a fixed library (b) output its arguments. As in Chitnis et al. [10], the policy network outputs a distribution over one-hot vectors defining which primitive to use as well as a distribution over all of the arguments for all of the primitives, a design choice which enables the policy network to have a fixed output dimension. After the policy samples an action, the chosen parameterized action and its corresponding arguments are indexed from the action and passed to the environment. The environment selects the appropriate primitive function $f$ and executes the primitive on the robot with the appropriate arguments. After the primitive completes executing, the final observation and sum of intermediate rewards during the execution of the primitive are returned by the environment. We do so to ensure if the task is achieved mid primitive execution, the action is still labelled successful.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: We visualize an execution of an RL agent trained to solve a cabinet opening task from sparse rewards using robot action primitives. At each time-step, we display the primitive chosen, the policy’s confidence in the action choice and the corresponding argument passed to the primitive in the bottom left corner.
|
| 70 |
+
|
| 71 |
+
We describe a concrete example to ground the description of our framework. If we have 10 primitives with 3 arguments each, the higher level policy network outputs 30 dimensional mean and standard deviation vectors from which we sample a 30 dimensional argument vector. It also outputs a 10 dimensional logit vector from which we sample a 10 dimensional one-hot vector. Therefore in total, our action space would be 40 dimensional. The environment takes in the 40 dimensional vector and selects the appropriate argument (3-dimensional vector) from the argument vector based on the one-hot vector over primitives and executes the corresponding primitive in the environment. Using this policy architecture and primitive execution format, we train standard RL agents to solve manipulation tasks from sparse rewards. See Figure 2 for a visualization of a full trajectory of a policy solving a hinge cabinet opening task in the Kitchen Suite with RAPS.
|
| 72 |
+
|
| 73 |
+
# 4 Experimental Setup
|
| 74 |
+
|
| 75 |
+
In order to perform a robust evaluation of robot action primitives and prior work, we select a set of challenging robotic control tasks, define our environmental setup, propose appropriate metrics for evaluating different action spaces, and summarize our baselines for comparison.
|
| 76 |
+
|
| 77 |
+
Tasks and Environments: We evaluate RAPS on three simulated domains: Metaworld [17], Kitchen [52] and Robosuite [54], containing 16 tasks with varying levels of difficulty, realism and task diversity (see the bottom half of Fig. 1). We use the Kitchen environment because it contains seven different subtasks within a single setting, contains human demonstration data useful for training learned skills and contains tasks that require chaining together up to four subtasks to solve. In particular, learning such temporally-extended behavior is challenging [2, 17, 35]. Next, we evaluate on the Metaworld benchmark suite due to its wide range of manipulation tasks and established presence in the RL community. We select a subset of tasks from Metaworld (see appendix) with different solution behaviors to robustly evaluate the impact of primitives on RL. Finally, one limitation of the two previous domains is that the underlying end-effector control is implemented via a simulation constraint as opposed to true position control by applying torques to the robot. In order to evaluate if primitives would scale to more realistic learning setups, we test on Robosuite, a benchmark of robotic manipulation tasks which emphasizes realistic simulation and control. We select the block lifting and door opening environments which have been demonstrated to be solvable in prior work [54]. We refer the reader to the appendix for a detailed description of each environment.
|
| 78 |
+
|
| 79 |
+
Sparse Reward and Image Observations We modify each task to use the environment success metric as a sparse reward which returns 1 when the task is achieved, and 0 otherwise. We do so in order to establish a more realistic and difficult exploration setting than dense rewards which require significant engineering effort and true state information to compute. Additionally, we plot all results against the mean task success rate since it is a directly interpretable measure of the agent’s performance. We run each method using visual input as we wish to bring our evaluation setting closer to real world setups. The higher level policy, primitives and baseline methods are not provided access to the world state, only camera observations and robot state depending on the action.
|
| 80 |
+
|
| 81 |
+
Evaluation Metrics One challenge when evaluating hierarchical action spaces such as RAPS alongside a variety of different learned skills and action parameterizations, is that of defining a fair and meaningful definition of sample efficiency. We could define one sample to be a forward pass through the RL policy. For low-level actions this is exactly the sample efficiency, for higher level actions this only measures how often the policy network makes decisions, which favors actions with a large number of low-level actions without regard for controller run-time cost, which can be significant. Alternatively, we could define one sample to be a single low-level action output by a low-level controller. This metric would accurately determine how often the robot itself acts in the world, but it can make high level actions appear deceptively inefficient. Higher level actions execute far fewer forward passes of the policy in each episode which can result in faster execution on a robot when operating over visual observations, a key point low-level sample efficiency fails to account for. We experimentally verify this point by running RAPS and raw actions on a real $\mathrm { x A r m } \ : 6$ robot with visual RL and finding that RAPS executes each trajectory $\mathbf { 3 2 x }$ times faster than raw actions. We additionally verify that RAPS is efficient with respect to low level steps in Figure 4.
|
| 82 |
+
|
| 83 |
+
To ensure fair comparison across methods, we instead propose to perform evaluations with respect to two metrics, namely, (a) Wall-clock Time: the amount of total time it takes to train the agent to solve the task, both interaction time and time spent updating the agent, and (b) Training Steps: the number of gradient steps taken with a fixed batch size. Wall clock time is not inherently tied to the action space and provides an interpretable number for how long it takes for the agent to learn the task. To ensure consistency, we evaluate all methods on a single RTX 2080 GPU with 10 CPUs and 50GB of memory. However, this metric is not sufficient since there are several possible factors that can influence wall clock time which can be difficult to disambiguate, such as the effect of external processes, low-level controller execution speed, and implementation dependent details. As a result, we additionally compare methods based on the number of training steps, a proxy for data efficiency. The number of network updates is only a function of the data; it is independent of the action space, machine and simulator, making it a non-transient metric for evaluation. The combination of the two metrics provides a holistic method of comparing the performance of different action spaces and skills operating on varying frequencies and horizons.
|
| 84 |
+
|
| 85 |
+
Baselines The simplest baseline we consider is the default action space of the environment, which we denote as Raw Actions. One way to improve upon the raw action space is to train a policy to output the parameters of the underlying controller alongside the actual input commands. This baseline, VICES [30], enables the agent to tune the controller automatically depending on the task. Alternatively, one can use unsupervised skill extraction to generate higher level actions which can be leveraged by downstream RL. We evaluate one such method, Dyn- $\mathbf { E }$ [49], which trains an observation and action representation from random policy data such that the subsequent state is predictable from the embeddings of the previous observation and action. A more data-driven approach to learning skills involves organizing demonstration data into a latent skill space. Since the dataset is guaranteed to contain meaningful behaviors, it is more likely that the extracted skills will be useful for downstream tasks. We compare against SPIRL [35], a method that ingests a demonstration dataset to train a fixed length skill VAE $z = e ( a _ { 1 : H } ) , a _ { 1 : H } = d ( z )$ and prior over skills $p ( z | s )$ , which is used to guide downstream RL. Additionally, we compare against PARROT [44], which trains an observation conditioned flow model on an offline dataset to map from the raw action space to a latent action space. In the next section, we demonstrate the performance of our RAPS against these methods across a diverse set of sparse reward manipulation tasks.
|
| 86 |
+
|
| 87 |
+
# 5 Experimental Evaluation of RAPS
|
| 88 |
+
|
| 89 |
+
We evaluate the efficacy of RAPS on three different settings: single task reinforcement learning across Kitchen, Metaworld and Robosuite, as well as hierarchical control and unsupervised exploration in the Kitchen environment. We observe across all evaluated settings, RAPS is robust, efficient and performant, in direct contrast to a wide variety of learned skills and action parameterizations.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: Comparison of various action parameterizations and RAPS across all three environment suites3using Dreamer as the underlying RL algorithm. RAPS (green), with sparse rewards, is able to significantly outperform all baselines, particularly on the more challenging tasks, even when they are augmented with dense reward. See the appendix for remaining plots on the slide-cabinet and soccer-v2 tasks.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: In the Kitchen environment suite, we run comparisons logging the number of low level interactions of RAPS, Raw actions and VICES. While the methods appear closer in efficiency with respect to low-level actions, RAPS still maintains the best performance across every task. We note that on a real robot, RAPS runs significantly faster than the raw action space in terms of wall-clock time.
|
| 96 |
+
|
| 97 |
+
# 5.1 Accelerating Single Task RL using RAPS
|
| 98 |
+
|
| 99 |
+
In this section, we evaluate the performance of RAPS against fixed and variable transformations of the lower-level action space as well as state of the art unsupervised skill extraction from demonstrations. Due to space constraints, we show performance against the number of training steps in the appendix.
|
| 100 |
+
|
| 101 |
+
Action Parameterizations We compare RAPS against Raw Actions and VICES using Dreamer [18] as the underlying algorithm across all three environment suites in Figure 3. Since we observe weak performance on the default action space of Kitchen, joint velocity control, we instead modify the suite to use 6DOF end-effector control for both raw actions and VICES. We find Raw Actions and VICES are able to make progress on a number of tasks across all three domains, but struggle to execute the fine-grained manipulation required to solve more difficult environments such as hinge-cabinet, assembly-v2 and disassembly-v2. The latter two environments are not solved by Raw Actions or VICES even when they are provided dense rewards. In contrast, RAPS is able to quickly solve every task from sparse rewards.
|
| 102 |
+
|
| 103 |
+
On the kitchen environment, from sparse rewards, no prior method makes progress on the hardest manipulation task: grasping the hinge cabinet and pulling it open to 90 degrees, while RAPS is able to quickly learn to solve the task. In the Metaworld domain, peg-unplug-side-v2, assembly-v2 and disassembly-v2 are difficult environments which present a challenge to even dense reward state based RL [52]. However, RAPS is able to solve all three tasks with sparse rewards directly from image input. We additionally include a comparison of RAPS against Raw Actions on all 50 Metaworld tasks with final performance shown in Figure 6 as well as the full learning performance in the Appendix. RAPS is able to learn to solve or make progress on 43 out of 50 tasks purely from sparse rewards. Finally, in the Robosuite domain, by leveraging robot action primitives, we are able to learn to solve the tasks more rapidly than raw actions or VICES, with respect to wall-clock time and number of training steps, demonstrating that RAPS scales to more realistic robotic controllers.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 5: Comparison of RAPS and skill learning methods on the Kitchen domain using SAC as the underlying RL algorithm. While SPIRL and PARROT are competitive or even improve upon RAPS’s performance on easier tasks, only RAPS (green) is able to solve top-left-burner and hinge-cabinet.
|
| 107 |
+
|
| 108 |
+
Table 1: Evaluation of RAPS across RL algorithms (Dreamer, PPO, SAC) on Kitchen. We report the final success rate of each method on five evaluation trials trained over three seeds from sparse rewards. While raw action performance (left entry) varies significantly across RL algorithms, RAPS (right entry) is able to achieve high success rates on every task with every RL algorithm.
|
| 109 |
+
|
| 110 |
+
<table><tr><td rowspan=2 colspan=1>RL Algorithm</td><td rowspan=2 colspan=12>Kettle Slide CabinetLight Switch Microwave Top Burner Hinge CabinetRaw RAPS Raw RAPS Raw RAPS Raw RAPS Raw RAPS Raw RAPS</td></tr><tr><td rowspan=1 colspan=1>RAPS</td><td rowspan=1 colspan=1>Raw</td><td rowspan=1 colspan=1>RAPS</td><td rowspan=1 colspan=1>Raw</td><td rowspan=1 colspan=1>RAPS</td><td rowspan=1 colspan=1>Raw</td><td rowspan=1 colspan=1>RAPS</td><td rowspan=1 colspan=1>Raw</td><td rowspan=1 colspan=1>RAPS</td><td rowspan=1 colspan=1>Raw</td></tr><tr><td rowspan=1 colspan=1>Dreamer</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>.93</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>.53</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>.93</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>1.0</td></tr><tr><td rowspan=1 colspan=1>SAC</td><td rowspan=1 colspan=1>.33</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>.67</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>.86</td><td rowspan=1 colspan=1>.67</td><td rowspan=1 colspan=1>.33</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>.33</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>1.0</td></tr><tr><td rowspan=1 colspan=1>PPO</td><td rowspan=1 colspan=1>.33</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>.66</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>.27</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>.66</td><td rowspan=1 colspan=1>.27</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.0</td><td rowspan=1 colspan=1>1.0</td></tr></table>
|
| 111 |
+
|
| 112 |
+
Offline Learned Skills An alternative point of comparison is to leverage offline data to learn skills and run downstream RL. We train SPIRL and PARROT from images using the kitchen demonstration datasets in D4RL [16], and Dyn-E with random interaction data. We run all agents with SAC as the underlying RL algorithm and extract learned skills using joint velocity control, the type of action present in the demonstrations. See Figure 5 for the comparison of RAPS against learned skills. Dyn-E is unable to make progress across any of the domains due to the difficulty of extracting useful skills from highly unstructured interaction data. In contrast, SPIRL and PARROT manage to leverage demonstration data to extract useful skills; they are competitive or even improve upon RAPS on the easier tasks such as microwave and kettle, but struggle to make progress on the more difficult tasks in the suite. PARROT, in particular, exhibits a great deal of variance across tasks, especially with SAC, so we include results using Dreamer as well. We note that both SPIRL and PARROT are limited by the tasks which are present in the demonstration dataset and unable to generalize their extracted skills to other tasks in the same environment or other domains. In contrast, parameterized primitives are able to solve all the kitchen tasks and are re-used across domains as shown in Figure 3.
|
| 113 |
+
|
| 114 |
+
Generalization to different RL algorithms A generic set of skills should maintain performance regardless of the underlying RL algorithm. In this section, we evaluate the performance of RAPS against Raw Actions on three types of RL algorithms: model based (Dreamer), off-policy model free (SAC) and on-policy model free (PPO) on the Kitchen tasks. We use the end-effector version of raw actions as our point of comparison on these tasks. As seen in Table 1, unlike raw actions, RAPS is largely agnostic to the underlying RL algorithm.
|
| 115 |
+
|
| 116 |
+
# 5.2 Enabling Hierarchical Control via RAPS
|
| 117 |
+
|
| 118 |
+
We next apply RAPS to a more complex setting: sequential RL, in which the agent must learn to solve multiple subtasks within a single episode, as opposed to one task. We evaluate on the Kitchen Multi-Task environments and plot performance across SAC, Dreamer, and PPO in Figure 7.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 6: Final performance results for single task RL on the Metaworld domain after 3 days of training using the Dreamer base algorithm. RAPS is able to successfully learn most tasks, solving 43 out of 50 tasks while Raw Actions is only able to solve 21 tasks.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 7: Learning performance of RAPS on sequential multi-task RL. Each row plots a different base RL algorithm (SAC, Dreamer, PPO) while the first two columns plot the two multi-task environment results against wall-clock time and the next two columns plot against number of updates, i.e. training steps. RAPS consistently solves at least three out of four subtasks while prior methods generally fail to make progress beyond one or two.
|
| 125 |
+
|
| 126 |
+
Raw Actions prove to be a strong baseline, eventually solving close to three subtasks on average, while requiring significantly more wall-clock time and training steps. SPIRL initially shows strong performance but after solving one to two subtasks it then plateaus and fails to improve. PARROT is less efficient than SPIRL but also able to make progress on up to two subtasks, though it exhibits a great deal of sensitivity to the underlying RL algorithm. For both of the offline skill learning methods, they struggle to solve any of the subtasks outside of kettle, microwave, and slide-cabinet which are encompassed in the demonstration dataset. Meanwhile, with RAPS, across all three base RL algorithms, we observe that the agents are able to leverage the primitive library to rapidly solve three out of four subtasks and continue to improve. This result demonstrates that RAPS can elicit significant gains in hierarchical RL performance through its improved exploratory behavior.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 8: RAPS significantly outperforms raw actions in terms of total wall clock time and number of updates when fine-tuning initialized from reward free exploration.
|
| 130 |
+
|
| 131 |
+
# 5.3 Leveraging RAPS to enable efficient unsupervised exploration
|
| 132 |
+
|
| 133 |
+
In many settings, sparse rewards themselves can be hard to come by. Ideally, we would be able to train robot without train time task rewards for large periods of time and fine-tune to solve new tasks with only a few supervised labels. We use the kitchen environment to test the efficacy of primitives on the task of unsupervised exploration. We run an unsupervised exploration algorithm, Plan2explore [38], for a fixed number of steps to learn a world model, and then fine-tune the model and train a policy using Dreamer to solve specific tasks. We plot the results in Figure 8 on the top-left-burner and hinge-cabinet tasks. RAPS enables the agent to learn an effective world model that results in rapid learning of both tasks, requiring only 1 hour of fine-tuning to solve the hinge-cabinet task. Meanwhile, the world model learned by exploring with raw actions is unable to quickly finetune as quickly. We draw two conclusions from these results, a) RAPS enables more efficient exploration than raw actions, b) RAPS facilitates efficient model fitting, resulting in rapid fine-tuning.
|
| 134 |
+
|
| 135 |
+
# 6 Discussion
|
| 136 |
+
|
| 137 |
+
Limitations and Future Work While we demonstrate that RAPS is effective at solving a diverse array of manipulation tasks from visual input, there are several limitations that future work would need to address. One issue to consider is that of dynamic, fluid motions. Currently, once a primitive begins executing, it will not stop until its horizon is complete, which prevents dynamic behavior that a feedback policy on the raw action space could achieve. In the context of RAPS, integrating the parameterization and environment agnostic properties of robot action primitives with standard feedback policies could be one way to scale RAPS to more dynamic tasks. Another potential concern is that of expressivity: the set of primitives we consider in this work cannot express all possible motions that robot might need to execute. As discussed in Section 3, we do combine the base actions with primitives via a dummy primitive so that the policy can fall back to default action space if necessary. Future work could improve upon our simple solution. Finally, more complicated robot morphologies may require significant domain knowledge in order to design primitive behaviors. In this setting, we believe that learned skills with the agent-centric structure of robot action primitives could be an effective way to balance between the difficulty of learning policies to control complex robot morphologies [4, 33] and the time needed to manually define primitives.
|
| 138 |
+
|
| 139 |
+
Conclusion In this work we present an extensive evaluation of RAPS, which leverages parameterized actions to learn high level policies that can quickly solve robotics tasks across three different environment suites. We show that standard methods of re-parameterizing the action space and learning skills from demonstrations are environment and domain dependent. In many cases, prior methods are unable to match the performance of robot action primitives. While primitives are not a general solution to every task, their success across a wide range of environments illustrates the utility of incorporating an agent-centric structure into the robot action space. Given the effectiveness of simple parameterized action primitives, a promising direction to further investigate would be how to best incorporate agent-centric structure into both learned and manually defined skills and attempt to get the best of both worlds in order to improve the interface of RL algorithms with robots.
|
| 140 |
+
|
| 141 |
+
Acknowledgments We thank Shikhar Bahl, Ben Eyesenbach, Aravind Sivakumar, Rishi Veerapaneni, Russell Mendonca and Paul Liang for feedback on early drafts of this paper. This work was supported in part by NSF IIS1763562, NSF IIS-2024594, and ONR Grant N000141812861, and the US Army. Additionally, MD is supported by the NSF Graduate Fellowship. We would also like to acknowledge NVIDIA’s GPU support.
|
| 142 |
+
|
| 143 |
+
# References
|
| 144 |
+
|
| 145 |
+
[1] J. Achiam, H. Edwards, D. Amodei, and P. Abbeel. Variational option discovery algorithms. arXiv preprint arXiv:1807.10299, 2018. 3
|
| 146 |
+
[2] A. Ajay, A. Kumar, P. Agrawal, S. Levine, and O. Nachum. Opal: Offline primitive discovery for accelerating offline reinforcement learning, 2021. 3, 5
|
| 147 |
+
[3] A. Allshire, R. Martín-Martín, C. Lin, S. Manuel, S. Savarese, and A. Garg. Laser: Learning a latent action space for efficient reinforcement learning. arXiv preprint arXiv:2103.15793, 2021. 2
|
| 148 |
+
[4] O. M. Andrychowicz, B. Baker, M. Chociej, R. Jozefowicz, B. McGrew, J. Pachocki, A. Petron, M. Plappert, G. Powell, A. Ray, et al. Learning dexterous in-hand manipulation. The International Journal of Robotics Research, 39(1):3–20, 2020. 1, 10
|
| 149 |
+
[5] P.-L. Bacon, J. Harb, and D. Precup. The option-critic architecture. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. 3
|
| 150 |
+
[6] S. Bahl, M. Mukadam, A. Gupta, and D. Pathak. Neural dynamic policies for end-to-end sensorimotor learning, 2020. 3
|
| 151 |
+
[7] A. Bemporad and M. Morari. Control of systems integrating logic, dynamics, and constraints. Automatica, 35(3):407–427, 1999. 3
|
| 152 |
+
[8] M. S. Branicky, V. S. Borkar, and S. K. Mitter. A unified framework for hybrid control: Model and optimal control theory. IEEE transactions on automatic control, 43(1):31–45, 1998. 3
|
| 153 |
+
[9] S. Cambon, R. Alami, and F. Gravot. A hybrid approach to intricate motion, manipulation and task planning. The International Journal of Robotics Research, 28(1):104–126, 2009. 3
|
| 154 |
+
[10] R. Chitnis, S. Tulsiani, S. Gupta, and A. Gupta. Efficient bimanual manipulation using learned task schemas. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 1149–1155. IEEE, 2020. 3, 5
|
| 155 |
+
[11] C. Daniel, G. Neumann, O. Kroemer, J. Peters, et al. Hierarchical relative entropy policy search. Journal of Machine Learning Research, 17:1–50, 2016. 3
|
| 156 |
+
[12] B. Eysenbach, A. Gupta, J. Ibarz, and S. Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018. 3
|
| 157 |
+
[13] Z. Fan, R. Su, W. Zhang, and Y. Yu. Hybrid actor-critic reinforcement learning in parameterized action space. arXiv preprint arXiv:1903.01344, 2019. 3
|
| 158 |
+
[14] K. Frans, J. Ho, X. Chen, P. Abbeel, and J. Schulman. Meta learning shared hierarchies. arXiv preprint arXiv:1710.09767, 2017. 2, 3
|
| 159 |
+
[15] H. Fu, H. Tang, J. Hao, Z. Lei, Y. Chen, and C. Fan. Deep multi-agent reinforcement learning with discrete-continuous hybrid action spaces. arXiv preprint arXiv:1903.04959, 2019. 3
|
| 160 |
+
[16] J. Fu, A. Kumar, O. Nachum, G. Tucker, and S. Levine. D4rl: Datasets for deep data-driven reinforcement learning, 2021. 8
|
| 161 |
+
[17] A. Gupta, V. Kumar, C. Lynch, S. Levine, and K. Hausman. Relay policy learning: Solving long-horizon tasks via imitation and reinforcement learning, 2019. 5
|
| 162 |
+
[18] D. Hafner, T. Lillicrap, J. Ba, and M. Norouzi. Dream to control: Learning behaviors by latent imagination, 2020. 7
|
| 163 |
+
[19] M. Hausknecht and P. Stone. Deep reinforcement learning in parameterized action space. arXiv preprint arXiv:1511.04143, 2015. 2, 3
|
| 164 |
+
[20] K. Hausman, J. T. Springenberg, Z. Wang, N. Heess, and M. Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations, 2018. 2
|
| 165 |
+
[21] A. J. Ijspeert, J. Nakanishi, and S. Schaal. Learning attractor landscapes for learning motor primitives. Technical report, 2002. 3
|
| 166 |
+
[22] L. P. Kaelbling and T. Lozano-Pérez. Hierarchical task and motion planning in the now. In 2011 IEEE International Conference on Robotics and Automation, pages 1470–1477. IEEE, 2011. 2, 3
|
| 167 |
+
[23] L. P. Kaelbling and T. Lozano-Pérez. Learning composable models of parameterized skills. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pages 886–893. IEEE, 2017. 3
|
| 168 |
+
[24] 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 vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018. 1
|
| 169 |
+
[25] J. Kober and J. Peters. Learning motor primitives for robotics. In 2009 IEEE International Conference on Robotics and Automation, pages 2112–2118. IEEE, 2009. 3
|
| 170 |
+
[26] S. Levine, C. Finn, T. Darrell, and P. Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016. 1
|
| 171 |
+
[27] A. C. Li, C. Florensa, I. Clavera, and P. Abbeel. Sub-policy adaptation for hierarchical reinforcement learning. arXiv preprint arXiv:1906.05862, 2019. 2, 3
|
| 172 |
+
[28] C. Lynch and P. Sermanet. Grounding language in play. arXiv preprint arXiv:2005.07648, 2020. 3
|
| 173 |
+
[29] C. Lynch, M. Khansari, T. Xiao, V. Kumar, J. Tompson, S. Levine, and P. Sermanet. Learning latent plans from play. In Conference on Robot Learning, pages 1113–1132. PMLR, 2020. 2, 3
|
| 174 |
+
[30] R. Martín-Martín, M. A. Lee, R. Gardner, S. Savarese, J. Bohg, and A. Garg. Variable impedance control in end-effector space: An action space for reinforcement learning in contact-rich tasks, 2019. 6
|
| 175 |
+
[31] W. Masson, P. Ranchod, and G. Konidaris. Reinforcement learning with parameterized actions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 30, 2016. 3
|
| 176 |
+
[32] O. Nachum, S. Gu, H. Lee, and S. Levine. Data-efficient hierarchical reinforcement learning. arXiv preprint arXiv:1805.08296, 2018. 2
|
| 177 |
+
[33] A. Nagabandi, K. Konolige, S. Levine, and V. Kumar. Deep dynamics models for learning dexterous manipulation. In Conference on Robot Learning, pages 1101–1112. PMLR, 2020. 10
|
| 178 |
+
[34] S. Nasiriany, H. Liu, and Y. Zhu. Augmenting reinforcement learning with behavior primitives for diverse manipulation tasks, 2021. 3
|
| 179 |
+
[35] K. Pertsch, Y. Lee, and J. J. Lim. Accelerating reinforcement learning with learned skill priors, 2020. 3, 5, 6
|
| 180 |
+
[36] J. Peters, K. Mulling, and Y. Altun. Relative entropy policy search. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 24, 2010. 3
|
| 181 |
+
[37] S. Schaal. Dynamic movement primitives-a framework for motor control in humans and humanoid robotics. In Adaptive motion of animals and machines, pages 261–280. Springer, 2006. 3
|
| 182 |
+
[38] R. Sekar, O. Rybkin, K. Daniilidis, P. Abbeel, D. Hafner, and D. Pathak. Planning to explore via self-supervised world models, 2020. 10
|
| 183 |
+
[39] T. Shankar and A. Gupta. Learning robot skills with temporal variational inference. In International Conference on Machine Learning, pages 8624–8633. PMLR, 2020. 3
|
| 184 |
+
[40] T. Shankar, S. Tulsiani, L. Pinto, and A. Gupta. Discovering motor programs by recomposing demonstrations. In International Conference on Learning Representations, 2019. 2, 3
|
| 185 |
+
[41] A. Sharma, S. Gu, S. Levine, V. Kumar, and K. Hausman. Dynamics-aware unsupervised discovery of skills. arXiv preprint arXiv:1907.01657, 2019. 2, 3
|
| 186 |
+
[42] M. Sharma, J. Liang, J. Zhao, A. LaGrassa, and O. Kroemer. Learning to compose hierarchical object-centric controllers for robotic manipulation. arXiv preprint arXiv:2011.04627, 2020. 3
|
| 187 |
+
[43] A. Simeonov, Y. Du, B. Kim, F. R. Hogan, J. Tenenbaum, P. Agrawal, and A. Rodriguez. A long horizon planning framework for manipulating rigid pointcloud objects. arXiv preprint arXiv:2011.08177, 2020. 3
|
| 188 |
+
[44] A. Singh, H. Liu, G. Zhou, A. Yu, N. Rhinehart, and S. Levine. Parrot: Data-driven behavioral priors for reinforcement learning. arXiv preprint arXiv:2011.10024, 2020. 3, 6
|
| 189 |
+
[45] R. S. Sutton, D. Precup, and S. Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999. 3
|
| 190 |
+
[46] D. Tanneberg, K. Ploeger, E. Rueckert, and J. Peters. Skid raw: Skill discovery from raw trajectories. IEEE Robotics and Automation Letters, 6(3):4696–4703, 2021. 3
|
| 191 |
+
[47] A. S. Vezhnevets, S. Osindero, T. Schaul, N. Heess, M. Jaderberg, D. Silver, and K. Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In International Conference on Machine Learning, pages 3540–3549. PMLR, 2017. 2
|
| 192 |
+
[48] E. Wei, D. Wicke, and S. Luke. Hierarchical approaches for reinforcement learning in parameterized action space. arXiv preprint arXiv:1810.09656, 2018. 3
|
| 193 |
+
[49] W. Whitney, R. Agarwal, K. Cho, and A. Gupta. Dynamics-aware embeddings, 2020. 3, 6
|
| 194 |
+
[50] K. Xie, H. Bharadhwaj, D. Hafner, A. Garg, and F. Shkurti. Latent skill planning for exploration and transfer. In International Conference on Learning Representations, 2020. 2
|
| 195 |
+
[51] J. Xiong, Q. Wang, Z. Yang, P. Sun, L. Han, Y. Zheng, H. Fu, T. Zhang, J. Liu, and H. Liu. Parametrized deep q-networks learning: Reinforcement learning with discrete-continuous hybrid action space. arXiv preprint arXiv:1810.06394, 2018. 3
|
| 196 |
+
[52] T. Yu, D. Quillen, Z. He, R. Julian, K. Hausman, C. Finn, and S. Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on Robot Learning, pages 1094–1100. PMLR, 2020. 5, 8
|
| 197 |
+
[53] W. Zhou, S. Bajracharya, and D. Held. Plas: Latent action space for offline reinforcement learning. arXiv preprint arXiv:2011.07213, 2020. 3
|
| 198 |
+
[54] Y. Zhu, J. Wong, A. Mandlekar, and R. Martín-Martín. robosuite: A modular simulation framework and benchmark for robot learning, 2020. 5
|
md/train/4cEapqXfP30/4cEapqXfP30.md
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Adversarial Neuron Pruning Purifies Backdoored Deep Models
|
| 2 |
+
|
| 3 |
+
Dongxian $\mathbf { W _ { u } 1 * }$ Yisen Wang2,3† 1Dept. of Computer Science and Technology, Tsinghua University, China 2Key Lab. of Machine Perception, School of Artificial Intelligence, Peking Univesity, China 3Institute for Artificial Intelligence, Peking Univesity, China
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
As deep neural networks (DNNs) are growing larger, their requirements for computational resources become huge, which makes outsourcing training more popular. Training in a third-party platform, however, may introduce potential risks that a malicious trainer will return backdoored DNNs, which behave normally on clean samples but output targeted misclassifications whenever a trigger appears at the test time. Without any knowledge of the trigger, it is difficult to distinguish or recover benign DNNs from backdoored ones. In this paper, we first identify an unexpected sensitivity of backdoored DNNs, that is, they are much easier to collapse and tend to predict the target label on clean samples when their neurons are adversarially perturbed. Based on these observations, we propose a novel model repairing method, termed Adversarial Neuron Pruning (ANP), which prunes some sensitive neurons to purify the injected backdoor. Experiments show, even with only an extremely small amount of clean data (e.g., $1 \%$ ), ANP effectively removes the injected backdoor without causing obvious performance degradation. Our code is available at https://github.com/csdongxian/ANP_backdoor.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
In recent years, deep neural networks (DNNs) achieve satisfactory performance in many tasks, including computer vision [15], speech recognition [45], and gaming agents [36]. However, their success heavily relies on a large amount of computation and data, forcing researchers to outsource the training in “Machine Learning as a Service” (MLaaS) platforms or download pretrained models from the Internet, which brings potential risks of training-time attacks [17, 35, 2]. Among them, backdoor attack [14, 6, 42] is remarkably dangerous because it stealthily builds a strong relationship between a trigger pattern and a target label inside DNNs by poisoning a small proportion of the training data. As a result, the returned model always behaves normally on the clean data but is controlled to make target misclassification by presenting the trigger pattern such as a specific single-pixel [41] or a black-white checkerboard [14] at the test time.
|
| 12 |
+
|
| 13 |
+
Since DNNs are deployed in many real-world and safety-critical applications, it is urgent to defend against backdoor attacks. While there are many defense methods during training [38, 41, 8, 29, 20], this work focuses on a more realistic scenario in outsourcing training that repairs models after training. In particular, the defenders try to remove the injected backdoor without access to the model training process. Without knowledge of the trigger pattern, previous methods only achieve limited robustness [7, 24, 22]. Some works try to reconstruct the trigger [43, 5, 33, 50, 44], however, the trigger pattern in brand-new attacks becomes natural [26], invisible [49], and dynamic [30], leading to the reconstruction infeasible. Different from them, in this paper, we turn to explore whether we can successfully remove the injected backdoor even without knowing the trigger pattern.
|
| 14 |
+
|
| 15 |
+
Usually, the adversary perturbs inputs to cause misclassification, e.g., attaching triggers for backdoored models or adding adversarial perturbations. Parallel to this, we are also able to cause misclassification by perturbing neurons of DNNs [47]. For any neuron inside DNN, we could perturb its weight and bias by multiplying a relatively small number, to change its output. Similar to adversarial perturbations, we can optimize the neuron perturbations to increase its classification loss. Surprisingly, we find that, within the same perturbation budget, backdoored DNNs are much easier to collapse and prone to output the target label than normal DNNs even without the presence of the trigger. That is, the neurons that are sensitive to adversarial neuron perturbation are strongly related to the injected backdoor. Motivated by this, we propose a novel model repairing method, named Adversarial Neuron Pruning (ANP), which prunes most sensitive neurons under the adversarial neuron perturbation. Since the number of neurons is much smaller than weight parameters, e.g., only 4810 neurons for ResNet-18 while 11M parameters for the same model, our method can work well only based on $1 \%$ of clean data. Our main contributions are summarized as follows:
|
| 16 |
+
|
| 17 |
+
• We find that through adversarially perturbing neurons, backdoored DNNs can present backdoor behaviors even without the presence of the trigger patterns and are much easier to output misclassification than normal DNNs.
|
| 18 |
+
• To defend backdoor attacks, we propose a simple yet effective model repairing method, Adversarial Neuron Pruning (ANP), which prunes the most sensitive neurons under adversarial neuron perturbations without fine-tuning.
|
| 19 |
+
• Extensive experiments demonstrate that ANP consistently provides state-of-the-art defense performance against various backdoor attacks, even using an extremely small amount of clean data.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
# 2.1 Backdoor Attacks
|
| 24 |
+
|
| 25 |
+
The backdoor attack is a type of attacks occurring during DNN training. The adversary usually poisons a fraction of training data via attaching a predefined trigger and relabeling them as target labels (dirty-label setting) [14, 6]. All poisoned samples can be relabeled as a single target class (all-to-one), or poisoned samples from different source classes are relabeled as different target classes (all-to-all) [30]. After training, the model can be controlled to predict the target label in the presence of the trigger at the test time. Different from evasion attacks (e.g., adversarial attacks) [3, 39, 13], backdoor attacks aim to embed a input- and model-agnostic trigger into the model, which is a severe threat to the applications of deep learning [12]. Since incorrectly-labeled samples are easy to be detected, some attacks attach the trigger to samples from the target class (clean-label setting) [35, 42, 1]. Apart from simple forms like a single-pixel [41] or a black-and-white checkerboard [14], the trigger patterns can be more complex such as a sinusoidal strip [1] and a dynamic pattern [30]. These triggers in recent attacks become more natural [26] and human-imperceptible [49, 31], making them stealthy and hard to be detected by human inspection. Besides, powerful adversaries who have access to the model can optimize the trigger pattern [25], and even co-optimize the trigger pattern and the model together to enhance the power of backdoor attacks [32].
|
| 26 |
+
|
| 27 |
+
# 2.2 Backdoor Defense
|
| 28 |
+
|
| 29 |
+
Defense during Training. With access to training, the defender is able to detect the poisoned data or make poisoning invalid during the training process. Regarding poisoned data as outliers, we can detect and filter them out using robust statistics in the input space [38, 18, 8, 9] or the feature space [17, 41, 28, 10]. Meanwhile, other studies focus on training strategies to make the poisoned data have little or no effect on the trained model [23, 40] through randomized smoothing [34, 46], majority vote [21], differential privacy [29], and input preprocessing [27, 4].
|
| 30 |
+
|
| 31 |
+
Defense after Training. For a downloaded model, we have lost control of its training. To repair the risk model, one direct way is to first reconstruct an approximation of the backdoor trigger via adversarial perturbation [43] or generative adversarial network (GAN) [5, 33, 50]. Once the trigger is reconstructed, it is feasible to prune neurons that are activated in the presence of the trigger, or fine-tune the model to unlearn the trigger [43]. As the trigger patterns in recently proposed attacks become more complicated such as the dynamics trigger [30] or natural phenomenon-based trigger [26], reconstruction becomes increasingly difficult. There are other studies on trigger-agnostic repairing via model pruning [24] or fine-tuning [7, 22] on the clean data. While they may suffer from severe accuracy degradation when only small clean data are available [7]. Unlike previous defensive pruning methods which are based on the rule-of-thumb, our proposed method is data-driven and does not require additional fine-tuning.
|
| 32 |
+
|
| 33 |
+
# 3 The Proposed Method
|
| 34 |
+
|
| 35 |
+
# 3.1 Preliminary
|
| 36 |
+
|
| 37 |
+
Deep Neural Network and Its Neurons. In this paper, we take a fully-connected network as an example (other convolutional networks are also applicable). Its layers are numbered from 0 (input) to $L$ (output) and each layer contains $n _ { 0 } , \cdots , n _ { L }$ neurons. The network has $n = n _ { 1 } + n _ { 2 } + \cdot \cdot \cdot + n _ { L }$ parameterized neurons in total3. We denote the weight parameters of the $k$ -th neuron in $l$ -th layer as w(l)k , the bias as b $b _ { k } ^ { ( l ) }$ , and its output is
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
h _ { k } ^ { ( l ) } = \sigma ( \mathbf { w } _ { k } ^ { ( l ) \top } \mathbf { h } ^ { ( l - 1 ) } + b _ { k } ^ { ( l ) } ) ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\sigma ( \cdot )$ is the nonlinear function and $\mathbf { h } ^ { ( l - 1 ) }$ is the outputs of all neurons in the previous layer, $i . e . , { \bf h } ^ { ( l - 1 ) } = [ h _ { 1 } ^ { ( l - 1 ) } , \cdot \cdot \cdot , h _ { n _ { l } } ^ { ( l - 1 ) } ]$ . For simplicity, we denote all weights of the network as $\mathbf { w } =$ $\begin{array} { r l r } { } & { } & { [ { \bf w } _ { 1 } ^ { ( 1 ) } , \cdot \cdot \cdot , { \bf w } _ { n _ { 1 } } ^ { ( 1 ) } , \cdot \cdot \cdot , { \bf w } _ { 1 } ^ { ( L ) } , \cdot \cdot \cdot , { \bf w } _ { n _ { L } } ^ { ( L ) } ] } \end{array}$ , and all biases as $\mathbf { b } = [ b _ { 1 } ^ { ( 1 ) } , \cdots , b _ { n _ { l } } ^ { ( 1 ) } , \cdots , b _ { 1 } ^ { ( L ) } , \cdots , b _ { n _ { L } } ^ { ( L ) } ]$ For a given input $\mathbf { x }$ , the network makes the prediction $f ( \mathbf { x } ; \mathbf { w } , \mathbf { b } )$ .
|
| 44 |
+
|
| 45 |
+
DNN Training. We consider a $c$ -class classification problem. The parameters of weights and biases in DNN are learned on a training dataset $\mathcal { D } _ { \mathcal { T } } = \{ ( \bar { \bf x } _ { 1 } , \bar { y } _ { 1 } ) , \cdot \cdot \cdot , ( \bar { \bf x } _ { s } , \bar { y } _ { s } ) \}$ containing $s$ inputs, where each input is $\mathbf { x } _ { i } \in \mathbb { R } ^ { d } , i = 1 , \cdots , s .$ , and its ground-truth label is $y _ { i } \in \{ 1 , \cdots , c \}$ . The training procedure tries to find the optimal $( \mathbf { w } ^ { \star } , \mathbf { b } ^ { \star } )$ which minimize the training loss on the training data $\mathcal { D } _ { \mathcal { T } }$ ,
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathcal { L } _ { \mathcal { D } _ { T } } ( \mathbf { w } , \mathbf { b } ) = \underset { \mathbf { x } , y \sim \mathcal { D } _ { T } } { \mathbb { E } } \ell ( f ( \mathbf { x } ; \mathbf { w } , \mathbf { b } ) , y ) ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\ell ( \cdot , \cdot )$ is usually cross entropy loss.
|
| 52 |
+
|
| 53 |
+
Defense Setting. We adopt a typical defense setting that an untrustworthy model is downloaded from a third party (e.g., outsourcing training) without knowledge of the training data $\mathcal { D } _ { \mathcal { T } }$ . For defense, we are assumed to have a small amount of clean data $\mathcal { D } _ { \mathcal { V } }$ . The goals of model repairing are to remove the backdoor behavior while keeping the accuracy on clean samples.
|
| 54 |
+
|
| 55 |
+
# 3.2 Adversarial Neuron Perturbations
|
| 56 |
+
|
| 57 |
+
In previous studies, the adversary causes misclassification by perturbing inputs before feeding them to DNNs. For example, attaching triggers to inputs to make backdoored DNN output the target label or adversarially perturbing inputs to make normal/backdoored DNN output incorrectly.
|
| 58 |
+
|
| 59 |
+
Here, we try another direction to perturb DNN neurons to cause misclassification. Given the $k$ -th neuron in the $l$ -th layers, we can perturb its weight $\mathbf { w } _ { k } ^ { ( l ) }$ and bias $b _ { k } ^ { ( l ) }$ by multiplying a small number respectively. As a result, the perturbed weight is and the output of the perturbed neuron becomes $( 1 + \delta _ { k } ^ { ( l ) } ) \mathbf { w } _ { k } ^ { ( l ) }$ , the perturbed bias is $( 1 + \xi _ { k } ^ { ( l ) } ) b _ { k } ^ { ( l ) }$
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
h _ { k } ^ { ( l ) } = \sigma \big ( ( 1 + \delta _ { k } ^ { ( l ) } ) \mathbf { w } _ { k } ^ { ( l ) \top } \mathbf { h } ^ { ( l - 1 ) } + ( 1 + \xi _ { k } ^ { ( l ) } ) b _ { k } ^ { ( l ) } \big ) ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where δ(l)k and $\xi _ { k } ^ { ( l ) }$ indicate the relative sizes of the perturbations to the weight and bias respectively. Similarly, all neurons can be perturbed like Eq. (3). We denote the relative weight perturbation size of all neurons as $\pmb { \delta } = [ \delta _ { 1 } ^ { ( 1 ) } , \cdots , \delta _ { n _ { 1 } } ^ { ( 1 ) } , \cdots , \delta _ { 1 } ^ { ( L ) } , \cdots , \delta _ { n _ { L } } ^ { ( L ) } ] ,$ , and the relative bias perturbation
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+
Figure 1: The performance of neuron-perturbed models with different perturbation budgets.
|
| 70 |
+
|
| 71 |
+
size as $\pmb { \xi } = [ \xi _ { 1 } ^ { ( 1 ) } , \cdots , \xi _ { n _ { 1 } } ^ { ( 1 ) } , \cdots , \xi _ { 1 } ^ { ( L ) } , \cdots , \xi _ { n _ { L } } ^ { ( L ) } ]$ for simplicity. For a clean input $\mathbf { x }$ , the output of the perturbed model is
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
f ( \mathbf { x } ; ( 1 + \delta ) \odot \mathbf { w } , ( 1 + \pmb { \xi } ) \odot \mathbf { b } ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where neuron-wise multiplication $\odot$ multiplies the parameters by the perturbation sizes belonging to the same neuron as follows:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
( 1 + \pmb \delta ) \odot \mathbf { w } = \big [ ( 1 + \delta _ { 1 } ^ { ( 1 ) } ) \mathbf { w } _ { 1 } ^ { ( 1 ) } , \cdots , ( 1 + \delta _ { n _ { 1 } } ^ { ( 1 ) } ) \mathbf { w } _ { n _ { 1 } } ^ { ( 1 ) } , \cdots , ( 1 + \delta _ { 1 } ^ { ( L ) } ) \mathbf { w } _ { 1 } ^ { ( L ) } , \cdots , ( 1 + \delta _ { n _ { L } } ^ { ( L ) } ) \mathbf { w } _ { n _ { L } } ^ { ( L ) } \big ] ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
( 1 + \pmb { \xi } ) \odot \mathbf { b } = \big [ ( 1 + \xi _ { 1 } ^ { ( 1 ) } ) b _ { 1 } ^ { ( 1 ) } , \cdots , ( 1 + \xi _ { n _ { 1 } } ^ { ( 1 ) } ) b _ { n _ { 1 } } ^ { ( 1 ) } , \cdots , ( 1 + \xi _ { 1 } ^ { ( L ) } ) b _ { 1 } ^ { ( L ) } , \cdots , ( 1 + \xi _ { n _ { L } } ^ { ( L ) } ) b _ { n _ { L } } ^ { ( L ) } \big ] .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Given a trained model, similar to adversarial perturbations [39, 13], we optimize the neuron perturbations $\delta$ and $\boldsymbol { \xi }$ to increase the classification loss on the clean data:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\operatorname* { m a x } _ { \delta , \xi \in [ - \epsilon , \epsilon ] ^ { n } } \mathcal { L } _ { \mathcal { D } _ { \mathcal { V } } } \big ( ( 1 + \delta ) \odot \mathbf { w } , ( 1 + \xi ) \odot \mathbf { b } \big ) ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\epsilon$ is the perturbation budget, which limits the maximum perturbation size.
|
| 94 |
+
|
| 95 |
+
Specifically, we generate adversarial neuron perturbations for three ResNet-18 models [15] on CIFAR10 [19]: a benign model, a backdoored one with a predefined trigger (Badnets [14]), and a backdoored one with a dynamic trigger (Input-aware Backdoor Attack [30], IAB). We all set the target label in backdoor as class 0. We solve the maximization in Eq. (7) using project gradient descent (PGD) with random initialization similar to generating adversarial examples. The number of iterations is 300 and the step size is 0.001. Figure 1(a) shows adversarial neuron perturbations leads to misclassification, and the larger the perturbation budget $\epsilon$ is, the larger the error rate is. In addition, backdoored models always have larger error rates with the same perturbation budget compared to the benign one. To explore the misclassification in detail, we illustrate the proportion of different classes in predictions by three models in Figure 1(b). For benign model, adversarial neuron perturbations mislead the model to output the untargeted class (e.g., class 3). While for backdoored models, the majority of misclassified samples are predicted as the target label (e.g., class 0) whose proportion rate is much higher than the benign model. More results to support these findings can be found in Appendix B. Therefore, even without the trigger, we can still induce the backdoor behaviours via adversarial neuron perturbations. The reasons can be explained as follows: assuming the $k$ -th neuron in $l$ -th layers is backdoor-related, it is dormant on clean sample [24] (i.e., output is close to 0: $h _ { k } ^ { ( l ) } \approx 0 ,$ ). If w(l)>k hl−1 > 0 and b(l)k > 0, we can increase its output by enlarging the norm of the weights (i.e., $\delta _ { k } ^ { ( l ) } > 0 \}$ ), and further continue to increase it by adding a larger bias (i.e., $\xi _ { k } ^ { ( l ) } > 0 ) ^ { 4 }$ . With suitable perturbations, the backdoor-related neuron is activated even on clean samples. Thus, the neurons that are sensitive to adversarial neuron perturbation are strongly related to the injected backdoor.
|
| 96 |
+
|
| 97 |
+
# 3.3 The Proposed Adversarial Neuron Pruning (ANP)
|
| 98 |
+
|
| 99 |
+
As mentioned above, the sensitivity under adversarial neuron perturbations is strongly related to the injected backdoor. Inspired by this, we try to prune some sensitive neurons to defend backdoor attacks, named Adversarial Neuron Pruning method (ANP). We denote the pruning masks as $\mathbf { m } =$ $[ m _ { 1 } ^ { ( 1 ) } , \cdots , m _ { n _ { 1 } } ^ { ( 1 ) } , \cdots , m _ { 1 } ^ { ( L ) } , \cdots , m _ { n _ { L } } ^ { ( L ) } ] \in \bar { \{ 0 , 1 \} } ^ { n }$ . For the $k$ -th neuron in the $l$ -th layer, we set its weight w(k l ) = 0 if m( l )k = L , and keep it unchanged if $m _ { k } ^ { ( l ) } = 1$ . Similar to Ghorbani and Zou [11], we always keep the bias $b _ { k } ^ { ( l ) }$ to avoid extra harm to the accuracy on clean data5.
|
| 100 |
+
|
| 101 |
+
Continuous Relaxation and Optimization. Due to the binary masks, pruning is a discrete optimization problem that is difficult to solve within feasible time. To address this, we apply continuous relaxation to let $\mathbf { m } \in [ 0 , 1 ] ^ { n }$ and optimizes them using projected gradient descent (PGD). To restore the continuous masks to discreteness after optimization, we set all mask smaller than a threshold as 0 (prune neurons with small masks), and others as 1 (keep neurons with large masks). We expect the pruned model to not only behaves well on clean data but also keep stable under adversarial neuron perturbations. Therefore, we solve the following minimization problem,
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\operatorname* { m i n } _ { \mathbf { m } \in \left[ 0 , 1 \right] ^ { n } } \left[ \alpha \mathcal { L } _ { { D } _ { \mathcal { V } } } ( \mathbf { m } \odot \mathbf { w } , \mathbf { b } ) + \left( 1 - \alpha \right) \operatorname* { m a x } _ { \delta , \xi \in \left[ - \epsilon , \epsilon \right] ^ { n } } \mathcal { L } _ { { D } _ { \mathcal { V } } } ( ( \mathbf { m } + \delta ) \odot \mathbf { w } , ( 1 + \pm \xi ) \odot \mathbf { b } ) \right] ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $\alpha \in [ 0 , 1 ]$ is a trade-off coefficient. If $\alpha$ is close to 1, the minimization object focuses more on accuracy of the pruned model on clean data, while if $\alpha$ is close to 0, it focuses more on robustness against backdoor attacks.
|
| 108 |
+
|
| 109 |
+
Implementation of ANP. As shown in Algorithm 1, we start from an unpruned network, that is, initializing all masks as 1 (Line 2). We randomly initialize perturbations (Line 5), and update them using one step (Line 6-7), then project them onto the feasible regime (Line 8-9). Following that, we update mask values based on the adversarial neuron perturbation (Line 10) and project mask value onto [0, 1] (Line 11). As convergence after iterations, we pruned neurons with small mask value and keep others unchanged (Line 13). Note that the proposed ANP is data-driven, different from previous pruning-based defenses which are based on the thumb-of-rule [24, 43]. Besides, ANP can work well on an extremely small amount of clean data due to the small number of masks.
|
| 110 |
+
|
| 111 |
+
# Algorithm 1 Adversarial Neuron Pruning (ANP)
|
| 112 |
+
|
| 113 |
+
1: Input: Network $f ( \cdot ; { \bf w } , { \bf b } )$ , hyper-parameter $\alpha$ , learning rate $\eta$ , batch size $b$ , maximum perturba
|
| 114 |
+
tion size $\epsilon$
|
| 115 |
+
2: Initialize all elements in $\mathbf { m }$ as 1
|
| 116 |
+
3: repeat
|
| 117 |
+
4: Read mini-batch $B = \{ ( \mathbf { x } _ { 1 } , y _ { 1 } ) , . . . , ( \mathbf { x } _ { b } , y _ { b } ) \}$ from training set
|
| 118 |
+
5: $\delta _ { 0 } , \xi _ { 0 } \sim U ( - \epsilon , \epsilon )$ , where $U ( - \epsilon , \epsilon )$ is the uniform distribution
|
| 119 |
+
6: $\begin{array} { r } { \pmb { \delta } \pmb { \delta } _ { 0 } + \epsilon \mathrm { s i g n } ( \nabla _ { \delta } \mathcal { L } ( ( \mathbf { m } + \pmb { \delta } _ { 0 } ) \odot \mathbf { w } , } \end{array}$ , $( { \bf 1 } + { \pmb \xi } _ { 0 } ) \odot { \bf b } ) )$
|
| 120 |
+
7: $\pmb { \xi } \pmb { \xi } _ { 0 } + \epsilon \mathrm { s i g n } ( \nabla _ { \pmb { \xi } } \mathcal { L } ( ( \mathbf { m } + \pmb { \delta } _ { 0 } ) \odot \mathbf { w }$ , $\left( \mathbf { 1 } + \pmb { \xi } _ { 0 } \right) \odot \mathbf { b } ) _ { }$ )
|
| 121 |
+
8: $\delta \gets \operatorname* { m a x } ( - \epsilon , \operatorname* { m i n } ( \delta , \epsilon ) )$
|
| 122 |
+
9: $\pmb { \xi } \gets \operatorname* { m a x } ( - \epsilon , \operatorname* { m i n } ( \pmb { \xi } , \epsilon ) )$
|
| 123 |
+
10: m ← m − η∇m[αL(m w, b) + (1 − α)L((m + δ) w, (1 + ξ) b)]
|
| 124 |
+
11: $\mathbf { m } \gets \mathrm { m a x } ( 0 , \mathrm { m i n } ( \mathbf { m } , 1 ) )$
|
| 125 |
+
12: until training converged
|
| 126 |
+
13: $m _ { k } ^ { ( l ) } = \mathbb { I } ( m _ { k } ^ { ( \bar { l } ) } > t h r e s h o l d )$ , for all $k , l$
|
| 127 |
+
14: Output: A robust network $f ( \cdot ; \mathbf { m } \odot \mathbf { w } , \mathbf { b } )$ against backdoor attacks
|
| 128 |
+
|
| 129 |
+
Adaptation to Batch Normalization. Batch Normalization (BatchNorm) [16] always normalizes its input and controls the mean and variance of the output by a pair of trainable parameters (scale $\gamma$ and shift $\beta$ ). If BatchNorm is inserted between matrix multiplication and the nonlinear activation, the perturbations to weight and bias may cancel each other out. For example, if we perturb the weight and bias of a neuron to the maximum by multiplying $( 1 + \epsilon )$ , the normalization offsets them and nothing changes after BatchNorm. To address this problem, we perturb the scale and shift parameters instead. We also make similar changes to the pruning masks.
|
| 130 |
+
|
| 131 |
+
Table 1: Performance (average over 5 random runs) of 4 defense methods against 6 backdoor attacks on $1 \%$ (500 images) of clean data on CIFAR-10 training set using ResNet-18. The AvgDrop indicates the average changes in ACC or ASR over 6 backdoor attacks compared to no defense results (Before).
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan=1 colspan=1>Metric</td><td rowspan=1 colspan=1>Defense</td><td rowspan=1 colspan=1>Badnets Blend IAB-one IAB-all CLB SIG</td><td rowspan=1 colspan=1>AvgDrop</td></tr><tr><td rowspan=5 colspan=1>ACC</td><td rowspan=5 colspan=1>BeforeFT(lr = 0.01)FT(lr = 0.02)FPMCR(t = 0.3)ANP</td><td rowspan=1 colspan=1>93.73 94.82 93.89 94.10 93.78 93.64</td><td rowspan=1 colspan=1>一</td></tr><tr><td rowspan=1 colspan=1>90.48 92.12 88.68 89.06 91.26 91.19</td><td rowspan=1 colspan=1>↓3.53</td></tr><tr><td rowspan=1 colspan=1>87.23 88.98 84.85 83.77 88.25 88.63</td><td rowspan=1 colspan=1>↓7.04</td></tr><tr><td rowspan=2 colspan=1>92.18 92.40 91.57 92.28 91.91 91.6485.95 88.26 86.30 84.53 86.87 85.8890.20 93.44 92.62 92.79 92.67 93.40</td><td rowspan=1 colspan=1>↓2.00</td></tr><tr><td rowspan=1 colspan=1>7.70↓1.47</td></tr><tr><td rowspan=5 colspan=1>ASR</td><td rowspan=5 colspan=1>BeforeFT(lr = 0.01)FT(lr = 0.02)FPMCR(t = 0.3)ANP</td><td rowspan=1 colspan=1>99.97 100.0 98.49 92.88 99.94 94.2611.70 47.17 0.99 1.36 12.51 0.40</td><td rowspan=1 colspan=1>一↓85.24</td></tr><tr><td rowspan=2 colspan=1>2.95 10.20 1.70 1.83 1.17 0.395.34 65.39 20.73 32.36 3.40 0.32</td><td rowspan=1 colspan=1>↓94.55</td></tr><tr><td rowspan=1 colspan=1>↓76.33</td></tr><tr><td rowspan=1 colspan=1>5.70 13.57 30.23 35.17 12.77 0.52</td><td rowspan=1 colspan=1>←81.26</td></tr><tr><td rowspan=1 colspan=1>0.45 0.46 0.88 0.86 3.98 0.28</td><td rowspan=1 colspan=1>↓96.44</td></tr></table>
|
| 134 |
+
|
| 135 |
+
# 4 Experiments
|
| 136 |
+
|
| 137 |
+
In this section, we conduct comprehensive experiments to evaluate the effectiveness of ANP, including its benchmarking robustness, ablation studies and performance under limited computation resources.
|
| 138 |
+
|
| 139 |
+
# 4.1 Experimental Settings
|
| 140 |
+
|
| 141 |
+
Backdoor Attacks and Settings. We consider 5 state-of-the-art backdoor attacks: 1) BadNets [14], 2) Blend backdoor attack (Blend) [6], 3) Input-aware backdoor attack with all-to-one target label (IAB-one) or all-to-all target label (IAB-all) [30], 4) Clean-label backdoor (CLB) [42], and 5) Sinusoidal signal backdoor attack (SIG) [1]. For fair comparisons, we follow the default configuration in their original papers such as the trigger patterns, the trigger sizes and the target labels. We evaluate the performance of all attacks and defenses on CIFAR-10 [19] using ResNet-18 [15] as the base model. We use $9 0 \%$ training data to train the backdoored DNNs and use the all or part of the remaining $1 0 \%$ training data for defense. More details about implementation can be found in Appendix A.
|
| 142 |
+
|
| 143 |
+
Backdoor Defenses and Settings. We compare our proposed ANP with 3 existing model repairing methods: 1) standard fine-tuning (FT), 2) fine-pruning (FP) [24], and 3) mode connectivity repair (MCR) [48]. All defense methods are assumed to have access to the same $1 \%$ of clean training data (500 images). The results based on $1 0 \%$ (5000 images) and $0 . 1 \%$ (50 images) of clean training data can be found in Appendix. For ANP, we optimize all masks using Stochastic Gradient Descent (SGD) with the perturbation budget $\epsilon = 0 . 4$ and the trade-off coefficient $\alpha = 0 . 2$ . We set the batch size 128, the constant learning rate 0.2, and the momentum 0.9 for 2000 iterations in total. Typical data augmentation like random crop and horizontal flipping are applied. After optimization, neurons with mask value smaller than 0.2 are pruned.
|
| 144 |
+
|
| 145 |
+
Evaluation Metrics. We evaluate the performance of different defenses using two metrics: 1) the accuracy on clean data (ACC), and 2) and the attack success rate (ASR) that is the ratio of triggered samples that are misclassified as the target label. For better comparison between different strategies for the target label (e.g., all-to-one and all-to-all), we remove the samples whose ground-truth labels already belong to the target class in the all-to-one setting before calculating ASR. Therefore, an ideal defense always has close-to-zero ASR and high ACC.
|
| 146 |
+
|
| 147 |
+
# 4.2 Benchmarking the State-of-the-art Robustness
|
| 148 |
+
|
| 149 |
+
To verify the effectiveness of the proposed ANP, we compare its performance with other 3 existing model repairing methods using ACC and ASR in Table 1. All experiments are repeated over 5 runs with different random seeds, and we only report the average performance without the standard deviation due to the space constraint. More detailed results including the standard deviation can be found in Appendix C.
|
| 150 |
+
|
| 151 |
+
Table 2: The average training time of defense method against 6 backdoor attacks on $1 \%$ (500 images) of clean data on CIFAR-10 training set using ResNet-18.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Defense</td><td>FT</td><td>FP</td><td>MCR</td><td>ANP</td></tr><tr><td>Time (s)</td><td>93.80</td><td>1427.1</td><td>286.1</td><td>241.5</td></tr></table>
|
| 154 |
+
|
| 155 |
+
The experimental results show that the proposed ANP remarkably provides almost the highest robustness against several state-of-the-art backdoor attacks. In particular, in 5 of total 6 attacks, our proposed ANP successfully reduces the ASR to lower than $1 \%$ while only has a slight drop $( \sim 1 . 4 7 \%$ on average) in ACC. Note that we only use $1 \%$ of clean data from CIFAR-10 training set, which is extremely small. We find the standard fine-tuning (FT) with a larger learning rate ${ l r = 0 . 0 2 } )$ also provides strong robustness similar to ANP. However, it has an obvious drop in ACC since a large learning rate may destroy the features learned before and the new ones learned on limited data are poor in generalization. The poor accuracy hinders its usage in practical scenarios. In contrast, ANP has similar robustness against backdoor attacks while maintains ACC at a relatively high level at the same time. Similar to our method, Fine-pruning (FP) [24] also prunes some neurons and fine-tunes the pruned model on clean data. Specifically, It only prunes neurons in the last convolutional layer using a rule-of-thumb6, and provides limited robustness against backdoor attacks. Differently, the proposed ANP is data-driven (i.e., optimizing pruning masks based on data) and prunes neurons globally (i.e., pruning neurons in all layers), leading to higher ACC and lower ASR than FP. MCR suggests mitigating backdoor by using a curve model lying on a path connection between two backdoored models in the loss landscapes. However, with limited data, it fails in providing high robustness against complex triggers (e.g. a random trigger sampled from Gaussian in blend backdoor attack or the dynamic trigger in input-aware attack). By contrast, ANP always reduces ASR significantly no matter what the trigger looks like. Note that ANP only prunes neurons and never changes any parameters of backdoored DNNs, while other methods all fine-tune parameters. Under this situation, ANP still provides the almost best robustness against these state-of-the-art attacks, which indicates that pure pruning (without fine-tuning) is still a promising defense against backdoor attacks.
|
| 156 |
+
|
| 157 |
+
We also compare the training time of ANP and other baselines in Table 2, which indicates the efficiency of the proposed ANP. In particular, we apply 2000 iterations for FT, FP, and ANP, and 200 epochs (i.e., 800 iterations) for MCR following the open-sourced code7. Note that ANP is not as slow as the vanilla adversarial training (AT) since ANP only requires one extra backpropagation while PGD inside AT usually needs 10 extra backpropagations (PGD-10) in each update of model parameters. Besides, although ANP takes $2 . 5 \times$ time compared to FT, it improves accuracy (e.g., $8 8 . 9 8 \% 9 3 . 4 4 \%$ for Blend) and reduce vulnerability $( e . g . , \bar { 1 0 . 2 0 \% } \to 0 . 4 6 \%$ for Blend) significantly, making the overhead caused by ANP acceptable.
|
| 158 |
+
|
| 159 |
+
# 4.3 Ablation Studies
|
| 160 |
+
|
| 161 |
+
Effect of Adversarial Neuron Perturbation. Recalling Section 3.2, we apply adversarial neuron perturbations to induce the injected backdoor and then defend against backdoor attacks. Here, we evaluate the effect of the adversarial neuron perturbation in our defense strategy. In the following experiments, we defend against Badnets attack by default, unless otherwise specified. First, we optimize masks with perturbations $\alpha = 0 . 2$ and $\epsilon = 0 . 4$ , i.e., ANP) and without perturbations $\alpha = 1 . 0$ , i.e., the vanilla pruning method). Figure 2(a) shows the ACC and ASR on the test set during optimization. We find the optimization under adversarial neuron perturbations helps the backdoored model suppress ASR significantly while the vanilla one always has high ASR throughout the training process. Next, we illustrate the mask distribution after optimization. Figure 2(b) illustrates a certain fraction of masks becomes zero, which means that adversarial neuron perturbations indeed find some sensitive neurons and helps the model to remove them. In contrast, there is no mask close to 0 for the vanilla pruning method in Figure 2(c). Finally, we prune different fractions of neurons according to their mask in Figure 2(d). For both methods, ASR becomes low after pruning more than $5 \%$ of neurons8. However, ACC also starts to degrade significantly for the vanilla pruning method with more than $5 \%$ of neurons pruned. Since backdoored-related neurons are still mixed with other neurons (e.g., discriminant neurons), the vanilla pruning method prunes some discriminant neurons incorrectly. Meanwhile, ANP always keeps ACC at a relatively high level. In conclusion, the adversarial neuron perturbation is the key to distinguish the backdoor-related neurons from the other neurons, which thereby successfully obtains high ACC as well as low ASR.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 2: Comparison between optimization with and without adversarial neuron perturbations.
|
| 165 |
+
|
| 166 |
+
Table 3: Results with small budget $\epsilon = 0 . 1$ against Blend attack on 500 clean images. “Neurons↓” indicates the number of neurons pruned by ANP.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Steps</td><td>1</td><td>2</td><td>5</td><td>10</td></tr><tr><td>Time (s)</td><td>239.9</td><td>359.2</td><td>551.8</td><td>943.9</td></tr><tr><td>Neurons↓</td><td>159</td><td>188</td><td>235</td><td>259</td></tr><tr><td>ASR (%)</td><td>65.19</td><td>13.40</td><td>1.06</td><td>0.90</td></tr><tr><td>ACC (%)</td><td>93.62</td><td>93.07</td><td>92.95</td><td>92.72</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 4: Results with large budget $\epsilon = 0 . 4$ against Blend attack on 500 clean images. “Neurons↓” indicates the number of neurons pruned by ANP.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Steps</td><td>1</td><td>2</td><td>5</td><td>10</td></tr><tr><td>Time (s)</td><td>241.5</td><td>357.2</td><td>557.1</td><td>950.1</td></tr><tr><td>Neurons↓</td><td>233</td><td>239</td><td>281</td><td>296</td></tr><tr><td>ASR (%)</td><td>0.46</td><td>1.30</td><td>5.30</td><td>31.34</td></tr><tr><td>ACC (%)</td><td>93.44</td><td>94.07</td><td>93.57</td><td>94.28</td></tr></table>
|
| 173 |
+
|
| 174 |
+
In addition, we explore the effects of number of iterations in crafting adversarial neuron perturbations. We conduct experiments with varying numbers of steps (1/2/5/10) in ANP with a small perturbation budget $\mathit { \check { \Psi } } _ { \epsilon } = 0 . 1 $ ) and a large perturbation budget $\mathit { \check { \Psi } } \epsilon = 0 . 4$ ) respectively. The other settings are the same as Section 4.1. The experimental results are shown in Tables 3-4. Under a small perturbation budget, with more steps for ANP, the ASR decreases with a slight drop in ACC. This is because ANP with a single step and small size is too weak to distinguish benign neurons and backdoor-related neurons, while more steps can help ANP find more backdoor-related neurons. However, under a large perturbation budget, ANP with more steps has worse robustness. This is because, with a large perturbation budget, more neurons become sensitive. As a result, ANP with more steps finds too many “suspicious” neurons, and it is unable to identify backdoor-related neurons from them. In conclusion, we can strengthen the power of ANP to find backdoor-related neurons using a larger perturbation budget or more steps. Among them, single-step ANP with a slightly larger budget is more practical due to its time efficiency, and we adopt this by default.
|
| 175 |
+
|
| 176 |
+
Results with Varying Hyperparameters. As mentioned in Section 3.3, the hyper-parameter $\alpha$ in ANP controls the trade-off between the accuracy on clean data and the robustness against backdoor attacks. To test the performance with different $\alpha$ , we optimize masks for a Badnets ResNet-18 based on $1 \%$ of clean data using different $\alpha \in [ 0 , 1 ]$ with a fixed budget $\epsilon = 0 . 4$ . In pruning, we always prune neurons by the threshold 0.2. As shown in the left plot of Figure 4, ANP is able to achieve a high robustness $\mathrm { \Delta A S R } < 4 \%$ ) when $\alpha \leq 0 . 6$ . Meanwhile, ANP maintains a high natural accuracy $( \mathrm { A C C } \geq 9 0 \% )$ as long as $\alpha \ge 0 . 1$ . As a result, ANP behaves well with high ACC and low ASR in a range of $\alpha \in [ 0 . 1 , 0 . 6 ]$ .
|
| 177 |
+
|
| 178 |
+
Similarly, we also test the performance with different perturbation budgets $\epsilon$ . The experiment settings are almost the same except a fixed trade-off coefficient $\alpha = 0 . 2$ and varying budgets $\epsilon \in [ 0 , 1 ]$ . For example, we can provide obvious robustness (ASR becomes $7 . 4 5 \%$ ) with a small perturbation budget $\epsilon = 0 . 2$ ) as shown in the right plot of Figure 4. However, we find the accuracy on clean data degrades with a large perturbation budget. This is because too large perturbation budget brings much difficulty to converge well and ANP only finds a poor solution, which fails in identifying these discriminant and robust neurons and prunes part of them. As a result, ACC decreases significantly. In conclusion, the proposed ANP is stable in a large range of the trade-off coefficient $\alpha \in [ 0 . 1 , 0 . 6 ]$ and the perturbation budget $\epsilon \in [ 0 . 2 , 0 . 7 ]$ , demonstrating that ANP is not sensitive to hyper-parameters.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 3: Performance $\pm$ std over 5 random runs) of pruned models using different architectures by different pruning fractions or different thresholds.
|
| 182 |
+
|
| 183 |
+
From the discussion above, we find that the hyperparameters are insensitive as shown in Figure 4 and ANP performs well across a wide range of hyperparameters, e.g., trade-off coefficient $\alpha \in [ 0 . 1 , 0 . 6 ]$ against Badnets attack. In addition, with varying hyperparameters, the performance trends are very consistent across different backdoor attacks as shown in Figure $\mathrm { X }$ in Appendix C.1. As a result, even though the attack (e.g., Blend) is unknown, the defender could tune $\alpha$ against a known attack (e.g., Badnets) and find the 0.2 is a good choice. ANP with $\alpha = 0 . 2$ also achieves satisfactory performance against Blend attack. In conclusion, the selection of hyperparameters in ANP is not difficult.
|
| 184 |
+
|
| 185 |
+
Pruning by Fraction or by Threshold. Different from previous pruning methods that use a fixed pruning fraction, the proposed ANP prunes neurons by a threshold when generalized across different model architectures. To verify this, we train different Badnets models using ResNet-18 [15], ResNet50 [15], and VGG-19 [37] with the same settings as Section 4.1. We also train a model with Badnets MobileNet-V2 with 300 epochs . We optimize the pruning masks for these models with $\epsilon = 0 . 4 , \alpha = 0 . 2$ for ResNet-18, ResNet-50, and VGG-19. For MobileNet-V2, we found the perturbation budget $\epsilon = 0 . 4$ is too large, leading to a failure in convergence. So we apply a smaller budget $\epsilon = 0 . 2$ and the same trade-off coefficient $\alpha = 0 . 2$ . We show the ACC and ASR after pruning by varying pruning fractions in Figure 3(a) and 3(b), which indicates that the suitable fraction varies across model architectures. For example, ResNet-18 only has low ASR after pruning $5 \%$ of neurons, while MobileNet-V2 has a large accuracy drop on clean samples with more than $5 \%$ neurons pruned. Figure 3(c) and Figure 3(d) show ACC and ASR after pruning by different thresholds respectively. When pruning by the threshold, we find there is a large overlap in [0.2, 0.5] (the gray zone) in which all models have high ACC and low ASR simultaneously. That is why we adopt the strategy of pruning by the threshold in ANP. Note that, even for low-capacity models as MobileNet-V2, it is still possible to remove the injected backdoor by neuron pruning (without the fine-tuning).
|
| 186 |
+
|
| 187 |
+
Pruning on Different Components. We also compare the performance when applying ANP to different components inside DNNs. We prune a backdoored 4-layer CNN (2 conv layers $^ { + 1 }$ fullyconnected layer $^ +$ output layer) on MNIST, and find it more efficient to prune neurons in some layers. In particular, we achieve $0 . 4 3 \%$ of ASR $( 9 9 . 0 4 \%$ of ACC) when two neurons in the 2nd layer are pruned, while we only achieve $4 . 4 2 \%$ of ASR $( 9 2 . 4 8 \%$ of ACC) even after pruning 150 neurons in the fully-connected layer. The experimental settings and more results can be found in Appendix C.2. This indicates that the structure of components matter in pruning-based defense. We leave this in our future work.
|
| 188 |
+
|
| 189 |
+
# 4.4 Performance under Limited Computation Resource
|
| 190 |
+
|
| 191 |
+
In practical scenarios, the defender usually has limited clean data and computation resources, bringing more difficulty to repair backdoored models. While Section 4.2 has discussed the effectiveness of the proposed ANP on the extremely small amount of data, this part focuses on the performance with limited computation resources in defense.
|
| 192 |
+
|
| 193 |
+
In particular, we optimize all masks for a Badnets ResNet-18 with varying number of iterations (20, 100, 400, and 2000) on $1 \%$ of clean data (500 images) and prune the model from neurons with the small mask to neurons with the large mask. Figure 5 shows the ACC and ASR with varying pruning fractions based on different numbers of iterations. We find that some backdoor-related neurons have already been distinguished just after 20 iterations. For example, after removing $4 \%$ of neurons with the smallest masks, the pruned model has $6 . 2 8 \%$ of ASR and $8 6 . 6 5 \%$ of ACC. As the pruning fraction increases, ASR falls significantly first and raises again after $1 0 \%$ of neurons are pruned. This is because ANP has not yet separated them completely due to extremely limited computation (only 20 iterations). With more than 100 iterations, this phenomenon disappears. And ANP based on 100 iterations already has comparable performance to ANP on 2000 iterations, especially when we have not pruned too many neurons $( < 8 \%$ ).
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 4: Performance ( $\pm$ std over 5 random runs) of the pruned model by a threshold 0.2 with different hyper-parameters (Left: trade-off coefficient $\alpha$ ; Right: perturbation budget $\dot { \epsilon }$ ).
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 5: Performance ( $\pm$ std over 5 random runs) of the proposed ANP with varying pruning fractions based on different numbers of iterations.
|
| 200 |
+
|
| 201 |
+
We also find that ANP with 2000 iterations should prune more $( + 1 \% )$ neurons to degrade ASR than ones with fewer iterations. We conjecture this is because there also exist some sensitive neurons that are unrelated to the injected backdoor9, which are assigned with small masks at the late optimization stage. Besides, for ACC, we can see that more iterations maintain a higher ACC than fewer iterations, especially when more neurons are pruned, as the left neurons are almost the discriminant and robust ones. In conclusion, even with extremely small number of iterations (e.g., 20 iterations), ANP is able to distinguish the backdoor-related neurons from other neurons and obtains satisfactory robustness against backdoor attacks.
|
| 202 |
+
|
| 203 |
+
# 5 Conclusion
|
| 204 |
+
|
| 205 |
+
In this paper, we identified a sensitivity of backdoored DNNs to adversarial neuron perturbations, which induces them to present backdoor behaviours even without the presence of the trigger patterns. Based on these findings, we proposed Adversarial Neuron Pruning (ANP) to prune the sensitive neurons under adversarial neuron perturbations. Comprehensive experiments show that ANP consistently removes the injected backdoor and provides the highest robustness against several state-of-the-art backdoor attacks even with a limited amount of clean data and computation resources. Finally, our work also reminds researchers that pruning (without fine-tuning) is still a promising defense against backdoor attacks.
|
| 206 |
+
|
| 207 |
+
# Broader Impact
|
| 208 |
+
|
| 209 |
+
The backdoor attack has become a threat to outsourcing training and open-sourcing models. We propose ANP to improve the robustness against these backdoor attacks, which may help to build a more secure model even trained in an untrustworthy third-party platform. Further, we do not want this paper to bring overoptimism about AI safety to the society. Since the backdoor attack is only a part of potential risks ( e.g., adversarial attacks, privacy leakage, and model extraction), there is still a long way towards secure AI and trustworthy AI.
|
| 210 |
+
|
| 211 |
+
# Acknowledgments
|
| 212 |
+
|
| 213 |
+
Yisen Wang is partially supported by the National Natural Science Foundation of China under Grant 62006153, and Project 2020BD006 supported by PKU-Baidu Fund.
|
| 214 |
+
|
| 215 |
+
# References
|
| 216 |
+
|
| 217 |
+
[1] Mauro Barni, Kassem Kallas, and Benedetta Tondi. A new backdoor attack in cnns by training set corruption without label poisoning. In ICIP, 2019.
|
| 218 |
+
[2] Battista Biggio, Blaine Nelson, and Pavel Laskov. Support vector machines under adversarial label noise. In ACML, 2011.
|
| 219 |
+
[3] Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndic, Pavel Laskov, ´ Giorgio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In ECML/PKDD, 2013.
|
| 220 |
+
[4] Eitan Borgnia, Valeriia Cherepanova, Liam Fowl, Amin Ghiasi, Jonas Geiping, Micah Goldblum, Tom Goldstein, and Arjun Gupta. Strong data augmentation sanitizes poisoning and backdoor attacks without an accuracy tradeoff. In ICASSP, 2021.
|
| 221 |
+
[5] Huili Chen, Cheng Fu, Jishen Zhao, and Farinaz Koushanfar. Deepinspect: A black-box trojan detection and mitigation framework for deep neural networks. In IJCAI, 2019.
|
| 222 |
+
[6] Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017.
|
| 223 |
+
[7] Xinyun Chen, Wenxiao Wang, Chris Bender, Yiming Ding, Ruoxi Jia, Bo Li, and Dawn Song. Refit: a unified watermark removal framework for deep learning systems with limited data. arXiv preprint arXiv:1911.07205, 2019.
|
| 224 |
+
[8] Ilias Diakonikolas, Gautam Kamath, Daniel Kane, Jerry Li, Jacob Steinhardt, and Alistair Stewart. Sever: A robust meta-algorithm for stochastic optimization. In ICML, 2019.
|
| 225 |
+
[9] Chao Gao, Yuan Yao, and Weizhi Zhu. Generative adversarial nets for robust scatter estimation: A proper scoring rule perspective. Journal of Machine Learning Research, 21(160):1–48, 2020.
|
| 226 |
+
[10] Yansong Gao, Change Xu, Derui Wang, Shiping Chen, Damith C Ranasinghe, and Surya Nepal. Strip: A defence against trojan attacks on deep neural networks. In ACSAC, 2019.
|
| 227 |
+
[11] Amirata Ghorbani and James Zou. Neuron shapley: Discovering the responsible neurons. In NeurIPS, 2021.
|
| 228 |
+
[12] Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Data security for machine learning: Data poisoning, backdoor attacks, and defenses. arXiv preprint arXiv:2012.10544, 2020.
|
| 229 |
+
[13] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 230 |
+
[14] Tianyu Gu, Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Evaluating backdooring attacks on deep neural networks. IEEE Access, 7:47230–47244, 2019.
|
| 231 |
+
[15] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 232 |
+
[16] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 233 |
+
[17] Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In ICML, 2017.
|
| 234 |
+
[18] Pang Wei Koh, Jacob Steinhardt, and Percy Liang. Stronger data poisoning attacks break data sanitization defenses. arXiv preprint arXiv:1811.00741, 2018.
|
| 235 |
+
[19] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical Report, University of Toronto, 2009.
|
| 236 |
+
[20] Alexander Levine and Soheil Feizi. Deep partition aggregation: Provable defense against general poisoning attacks. arXiv preprint arXiv:2006.14768, 2020.
|
| 237 |
+
[21] Alexander Levine and Soheil Feizi. Deep partition aggregation: Provable defense against general poisoning attacks. In ICLR, 2021.
|
| 238 |
+
[22] Yige Li, Nodens Koren, Lingjuan Lyu, Xixiang Lyu, Bo Li, and Xingjun Ma. Neural attention distillation: Erasing backdoor triggers from deep neural networks. In ICLR, 2021.
|
| 239 |
+
[23] Yige Li, Xixiang Lyu, Nodens Koren, Lingjuan Lyu, Bo Li, and Xingjun Ma. Anti-backdoor learning: Training clean models on poisoned data. In NeurIPS, 2021.
|
| 240 |
+
[24] Kang Liu, Brendan Dolan-Gavitt, and Siddharth Garg. Fine-pruning: Defending against backdooring attacks on deep neural networks. In RAID, 2018.
|
| 241 |
+
[25] Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. In NDSS, 2018.
|
| 242 |
+
[26] Yunfei Liu, Xingjun Ma, James Bailey, and Feng Lu. Reflection backdoor: A natural backdoor attack on deep neural networks. In ECCV, 2020.
|
| 243 |
+
[27] Yuntao Liu, Yang Xie, and Ankur Srivastava. Neural trojans. In ICCD, 2017.
|
| 244 |
+
[28] Shiqing Ma and Yingqi Liu. Nic: Detecting adversarial samples with neural network invariant checking. In NDSS, 2019.
|
| 245 |
+
[29] Yuzhe Ma, Xiaojin Zhu Zhu, and Justin Hsu. Data poisoning against differentially-private learners: Attacks and defenses. In IJCAI, 2019.
|
| 246 |
+
[30] Anh Nguyen and Anh Tran. Input-aware dynamic backdoor attack. In NeurIPS, 2020.
|
| 247 |
+
[31] Anh Nguyen and Anh Tran. Wanet–imperceptible warping-based backdoor attack. In ICLR, 2021.
|
| 248 |
+
[32] Ren Pang, Hua Shen, Xinyang Zhang, Shouling Ji, Yevgeniy Vorobeychik, Xiapu Luo, Alex Liu, and Ting Wang. A tale of evil twins: Adversarial inputs versus poisoned models. In CCS, 2020.
|
| 249 |
+
[33] Ximing Qiao, Yukun Yang, and Hai Li. Defending neural backdoors via generative distribution modeling. In NeurIPS, 2019.
|
| 250 |
+
[34] Elan Rosenfeld, Ezra Winston, Pradeep Ravikumar, and Zico Kolter. Certified robustness to label-flipping attacks via randomized smoothing. In ICML, 2020.
|
| 251 |
+
[35] Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. In NeurIPS, 2018.
|
| 252 |
+
[36] 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.
|
| 253 |
+
[37] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 254 |
+
[38] Jacob Steinhardt, Pang Wei Koh, and Percy Liang. Certified defenses for data poisoning attacks. In NeurIPS, 2017.
|
| 255 |
+
[39] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 256 |
+
[40] Lue Tao, Lei Feng, Jinfeng Yi, Sheng-Jun Huang, and Songcan Chen. Better safe than sorry: Preventing delusive adversaries with adversarial training. In NeurIPS, 2021.
|
| 257 |
+
[41] Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. In NeurIPS, 2018.
|
| 258 |
+
[42] Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Label-consistent backdoor attacks. arXiv preprint arXiv:1912.02771, 2019.
|
| 259 |
+
[43] Bolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In S&P, 2019.
|
| 260 |
+
[44] Ren Wang, Gaoyuan Zhang, Sijia Liu, Pin-Yu Chen, Jinjun Xiong, and Meng Wang. Practical detection of trojan neural networks: Data-limited and data-free cases. In ECCV, 2020.
|
| 261 |
+
[45] Yisen Wang, Xuejiao Deng, Songbai Pu, and Zhiheng Huang. Residual convolutional ctc networks for automatic speech recognition. arXiv preprint arXiv:1702.07793, 2017.
|
| 262 |
+
[46] Maurice Weber, Xiaojun Xu, Bojan Karlas, Ce Zhang, and Bo Li. Rab: Provable robustness against backdoor attacks. arXiv preprint arXiv:2003.08904, 2020.
|
| 263 |
+
[47] Dongxian Wu, Shu-Tao Xia, and Yisen Wang. Adversarial weight perturbation helps robust generalization. In NeurIPS, 2020.
|
| 264 |
+
[48] Pu Zhao, Pin-Yu Chen, Payel Das, Karthikeyan Natesan Ramamurthy, and Xue Lin. Bridging mode connectivity in loss landscapes and adversarial robustness. In ICLR, 2019.
|
| 265 |
+
[49] Haoti Zhong, Cong Liao, Anna Cinzia Squicciarini, Sencun Zhu, and David Miller. Backdoor embedding in convolutional neural network models via invisible perturbation. In CODASPY, 2020.
|
| 266 |
+
[50] Liuwan Zhu, Rui Ning, Cong Wang, Chunsheng Xin, and Hongyi Wu. Gangsweep: Sweep out neural backdoors by gan. In MM, 2020.
|
md/train/5m3SEczOV8L/5m3SEczOV8L.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/B1p461b0W/B1p461b0W.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP LEARNING IS ROBUST TOMASSIVE LABEL NOISE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks trained on large supervised datasets have led to impressive results in recent years. However, since well-annotated datasets can be prohibitively expensive and time-consuming to collect, recent work has explored the use of larger but noisy datasets that can be more easily obtained. In this paper, we investigate the behavior of deep neural networks on training sets with massively noisy labels. We show on multiple datasets such as MINST, CIFAR-10 and ImageNet that successful learning is possible even with an essentially arbitrary amount of noise. For example, on MNIST we find that accuracy of above 90 percent is still attainable even when the dataset has been diluted with 100 noisy examples for each clean example. Such behavior holds across multiple patterns of label noise, even when noisy labels are biased towards confusing classes. Further, we show how the required dataset size for successful training increases with higher label noise. Finally, we present simple actionable techniques for improving learning in the regime of high label noise.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has proven to be powerful for a wide range of problems, from image classification to machine translation. Typically, deep neural networks are trained using supervised learning on large, carefully annotated datasets. However, the need for such datasets restricts the space of problems that can be addressed. This has led to a proliferation of deep learning results on the same tasks using the same well-known datasets. Carefully annotated data is difficult to obtain, especially for classification tasks with large numbers of classes (requiring extensive annotation) or with fine-grained classes (requiring skilled annotation). Thus, annotation can be expensive and, for tasks requiring expert knowledge, may simply be unattainable at scale.
|
| 12 |
+
|
| 13 |
+
To address this limitation, other training paradigms have been investigated to alleviate the need for expensive annotations, such as unsupervised learning (Le, 2013), self-supervised learning (Pinto et al., 2016; Wang & Gupta, 2015) and learning from noisy annotations (Joulin et al., 2016; Natarajan et al., 2013; Veit et al., 2017). Very large datasets (e.g., Krasin et al. (2016); Thomee et al. (2016)) can often be attained, for example from web sources, with partial or unreliable annotation. This can allow neural networks to be trained on a much wider variety of tasks or classes and with less manual effort. The good performance obtained from these large noisy datasets indicates that deep learning approaches can tolerate modest amounts of noise in the training set.
|
| 14 |
+
|
| 15 |
+
In this work, we take this trend to an extreme, and consider the performance of deep neural networks under extremely low label reliability, only slightly above chance. We envision a future in which arbitrarily large amounts of data will easily be obtained, but in which labels come without any guarantee of validity and may merely be biased towards the correct distribution.
|
| 16 |
+
|
| 17 |
+
The key takeaways from this paper may be summarized as follows:
|
| 18 |
+
|
| 19 |
+
• Deep neural networks are able to learn from data that has been diluted by an arbitrary amount of noise. We demonstrate that standard deep neural networks still perform well even on training sets in which label accuracy is as low as 1 percent above chance. On MNIST, for example, performance still exceeds 90 percent even with this level of label noise (see Figure 1). This behavior holds, to varying extents, across datasets as well as patterns of label noise, including when noisy labels are biased towards confused classes.
|
| 20 |
+
|
| 21 |
+
• A sufficiently large training set can accommodate a wide range of noise levels. We find that the minimum dataset size required for effective training increases with the noise level. A large enough training set can accommodate a wide range of noise levels. Increasing the dataset size further, however, does not appreciably increase accuracy.
|
| 22 |
+
|
| 23 |
+
• Adjusting batch size and learning rate can allow conventional neural networks to operate in the regime of very high label noise. We find that label noise reduces the effective batch size, as noisy labels roughly cancel out and only a small learning signal remains. We show that dataset noise can be partly compensated for by larger batch sizes and by scaling the learning rate with the effective batch size.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Learning from noisy data. Several studies have investigated the impact of noisy datasets on machine classifiers. Approaches to learn from noisy data can generally be categorized into two groups: In the first group, approaches aim to learn directly from noisy labels and focus on noise-robust algorithms, e.g., Beigman & Klebanov (2009); Guan et al. (2017); Joulin et al. (2016); Krause et al. (2016); Manwani & Sastry (2013); Misra et al. (2016); Van Horn et al. (2015). The second group comprises mostly label-cleansing methods that aim to remove or correct mislabeled data, e.g., Brodley & Friedl (1999). Methods in this group frequently face the challenge of disambiguating between mislabeled and hard training examples. To address this challenge, they often use semi-supervised approaches by combining noisy data with a small set of clean labels (Zhu, 2005). Some approaches model the label noise as conditionally independent from the input image (Natarajan et al., 2013; Sukhbaatar et al., 2014) and some propose image-conditional noise models (Veit et al., 2017; Xiao et al., 2015). Our work differs from these approaches in that we do not aim to clean the training dataset or propose new noise-robust training algorithms. Instead, we study the behavior of standard neural network training procedures in settings with massive label noise. We show that even without explicit cleaning or noise-robust algorithms, neural networks can learn from data that has been diluted by an arbitrary amount of label noise.
|
| 28 |
+
|
| 29 |
+
Analyzing the robustness of neural networks. Several investigative studies aim to improve our understanding of convolutional neural networks. One particular stream of research in this space seeks to investigate neural networks by analyzing their robustness. For example, Veit et al. (2016) show that network architectures with residual connections have a high redundancy in terms of parameters and are robust to the deletion of multiple complete layers during test time. Further, Szegedy et al. (2014) investigate the robustness of neural networks to adversarial examples. They show that even for fully trained networks, small changes in the input can lead to large changes in the output and thus misclassification. In contrast, we are focusing on non-adversarial noise during training time. Within this stream of research, closest to our work are studies that focus on the impact of noisy training datasets on classification performance (e.g., Sukhbaatar et al. (2014); Van Horn et al. (2015); Zhang et al. (2017)). In these studies an increase in noise is assumed to decrease not only the proportion of correct examples, but also their absolute number. In contrast to these studies, we separate the effects and show in $\ S 4$ that a decrease in the number of correct examples is more destructive to learning than an increase in the number of noisy labels.
|
| 30 |
+
|
| 31 |
+
# 3 LEARNING WITH MASSIVE LABEL NOISE
|
| 32 |
+
|
| 33 |
+
In this work, we are concerned with scenarios of abundant data of very poor label quality, i.e., the regime in which falsely labeled training examples vastly outnumber correctly labeled examples. In particular, our experiments involve observing the performance of deep neural networks on multiclass classification tasks as label noise is increased.
|
| 34 |
+
|
| 35 |
+
To formalize the problem, we denote the number of original training examples by $n$ . To model the amount of noise, we dilute the dataset by adding $\alpha$ noisy examples to the training set for each original training example. Thus, the total number of noisy labels in the training set is αn. Note that by varying the noise level $\alpha$ , we do not change the available number of original examples. Thus, even in the presence of high noise, there is still appreciable data to learn from, if we are able to pick it out. This is in contrast to previous work (e.g., Sukhbaatar et al. (2014); Van Horn et al. (2015); Zhang et al. (2017)), in which an increase in noise also implies a decrease in the absolute number of correct examples. In the following experiments we investigate three different types of noise: uniform label-swapping, structured label-swapping, and out-of-vocabulary examples.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Performance on Figure 2: Performance on MNIST as different amounts of CIFAR-10 as different amounts noisy labels are added to a fixed of noisy labels are added to a training set of clean labels. We fixed training set of clean lacompare a perceptron, MLPs bels. We tested ConvNets with with 1, 2, and 4 hidden layers, 4 and 6 layers, and a ResNet and a 4-layer ConvNet. Even with 101 layers. Even with 10 with 100 noisy labels for every noisy labels for every clean laclean label the ConvNet still at- bel the ResNet still attains a pertains a performance of $91 \%$ . formance of $85 \%$ .
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 3: Performance on ImageNet as different amounts of noisy labels are added to a fixed training set of clean labels. Even with 5 noisy labels for every clean label, the 18- layer ResNet still attains a performance of $70 \%$ .
|
| 44 |
+
|
| 45 |
+
A key assumption in this paper is that unreliable labels are better modeled by an unknown stochastic process rather than by the output of an adversary. This is a natural assumption for data that is pulled from the environment, in which antagonism is not to be expected in the noisy annotation process. Deep neural networks have been shown to be exceedingly brittle to adversarial noise patterns (Szegedy et al., 2014). In this work, we demonstrate that even massive amounts of non-adversarial noise present far less of an impediment to learning.
|
| 46 |
+
|
| 47 |
+
# 3.1 EXPERIMENT 1: TRAINING WITH UNIFORM LABEL NOISE
|
| 48 |
+
|
| 49 |
+
As a first experiment, we will show that common training procedures for neural networks are resilient even to settings where correct labels are outnumbered by labels sampled uniformly at random at a ratio of 100 to 1. For this experiment we focus on the task of image classification and work with three commonly used datasets, MNIST (LeCun et al., 1998), CIFAR-10 (Krizhevsky & Hinton, 2009) and ImageNet (Deng et al., 2009).
|
| 50 |
+
|
| 51 |
+
In Figures 1 and 2 we show the classification performance with varying levels of label noise. For MNIST, we vary the ratio $\alpha$ of randomly labeled examples to cleanly labeled examples from 0 (no noise) to 100 (only 11 out of 101 labels are correct, as compared with 10.1 for pure chance). For the more challenging dataset CIFAR-10, we vary $\alpha$ from 0 to 10. For the most challenging dataset ImageNet, we let $\alpha$ range from 0 to 5. We compare various architectures of neural networks: multilayer perceptrons with different numbers of hidden layers, convolutional networks (ConvNets) with different numbers of convolutional layers, and residual networks (ResNets) with different numbers of layers (He et al., 2016). We evaluate performance after training on a test dataset that is free from noisy labels. Full details of our experimental setup are provided in $\ S 3 . 4$ .
|
| 52 |
+
|
| 53 |
+
Our results show that, remarkably, it is possible to attain over 90 percent accuracy on MNIST, even when there are 100 randomly labeled images for every cleanly labeled example, to attain over 85 percent accuracy on CIFAR-10 with 10 random labels for every clean label, and to attain over 70 percent top-5 accuracy on ImageNet with 5 random labels for every clean label. Thus, in this highnoise regime, deep networks are able not merely to perform above chance, but to attain accuracies that would be respectable even without noise.
|
| 54 |
+
|
| 55 |
+
Further, we observe from Figures 1 and 2 that larger neural network architectures tend also to be more robust to label noise. On MNIST, the performance of a perceptron decays rapidly with increasing noise (though it still attains 40 percent accuracy, well above chance, at $\alpha = 1 0 0$ ). The performance of a multilayer perceptron drops off more slowly, and the ConvNet is even more robust. Likewise, for CIFAR-10, the accuracy of the residual network drops more slowly than that of the smaller ConvNets. This observation provides further support for the effectiveness of ConvNets and ResNets in particular for applications where noise tolerance may be important.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 4: Illustration of uniform and structured noise models. In the case of structured noise, the order of false labels is important; we tested decreasing order of confusion, increasing order of confusion, and random order. The parameter $\delta$ parameterizes the degree of structure in the noise. It defines how much more likely the second most likely class is over chance.
|
| 59 |
+
|
| 60 |
+
# 3.2 EXPERIMENT 2: TRAINING WITH STRUCTURED LABEL NOISE
|
| 61 |
+
|
| 62 |
+
We have seen that neural networks are extremely robust to uniform label noise. However, label noise in datasets gathered from a natural environment is unlikely to follow a perfectly uniform distribution. In this experiment, we investigate the effects of various forms of structured noise on the performance of neural networks. Figure 4 illustrates the procedure used to model noise structure.
|
| 63 |
+
|
| 64 |
+
In the uniform noise setting, as illustrated on the left side of Figure 4, correct labels are more likely than any individual false label. However, overall false labels vastly outnumber correct labels. We denote the likelihood over chance for a label to be correct as $\epsilon$ . Note that $\epsilon = 1 / ( 1 + \alpha )$ , where $\alpha$ is the ratio of noisy labels to certainly correct labels. To induce structure in the noise, we bias noisy labels to certain classes. We introduce the parameter $\delta$ to parameterize the degree of structure in the noise. It defines how much more likely the second most likely class is over chance. With $\delta = 0$ the noise is uniform, whereas for $\delta = 1$ the second most likely class is equally likely as the correct class. The likelihood for the remaining classes is scaled linearly, as illustrated in Figure 4 on the right. We investigate three different setups for structured noise: labels biased towards easily confused classes, towards hardly confused classes and towards random classes.
|
| 65 |
+
|
| 66 |
+
Figure 5 shows the results on MNIST for the three different types of structured noise, as $\delta$ varies from 0 to 1. In this experiment, we train 4-layer ConvNets on a dataset that is diluted with 20 noisy labels for each clean label. We vary the order of false labels so that, besides the correct class, labels are assigned most frequently to (1) those most often confused with the correct class, (2) those least often confused with it, and (3) in a random order. We determine commonly confused labels by training the network repeatedly on a small subset of MNIST and observing the errors it makes on a test set.
|
| 67 |
+
|
| 68 |
+
The results show that deep neural nets are robust even to structured noise, as long as the correct label remains the most likely by at least a small margin. Generally, we do not observe large differences between the different models of noise structure, only that bias towards random classes seems to hurt the performance a little more than bias towards confused classes. This result might help explain why we often observe quite good results from real world noisy datasets, where label noise is more likely to be biased towards related and confusing classes.
|
| 69 |
+
|
| 70 |
+
# 3.3 EXPERIMENT 3: SOURCE OF NOISY LABELS
|
| 71 |
+
|
| 72 |
+
In the preceding experiments, we diluted the training sets with noisy examples drawn from the same dataset; i.e., falsely labeled examples were images from within other categories of the dataset. In natural scenarios, however, noisy examples likely also include categories not included in the dataset that have erroneously been assigned labels within the dataset.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
Figure 5: Performance on MNIST with fixed $\alpha = 2 0$ noisy labels per clean label. Noise is drawn from three types of structured distribution: (1) “confusing order” (highest probability for the most confusing label), (2) “reverse confusing order”, and (3) random order. We interpolate between uniform noise, $\delta = 0$ , and noise so highly skewed that the most common false label is as likely as the correct label, $\delta \ = \ 1$ Except for $\delta \approx 1$ , performance is similar to uniform noise.
|
| 76 |
+
Figure 6: Performance on CIFAR-10 for varying amounts of noisy labels. Noisy training examples are drawn from (1) CIFAR-10 itself, but mislabeled uniformly at random, (2) CIFAR100, with uniformly random labels, and (3) white noise with mean and variance chosen to match those of CIFAR-10. Noise drawn from CIFAR-100 resulted in only half the drop in performance observed with noise from CIFAR-10 itself, while white noise examples did not appreciable affect performance.
|
| 77 |
+
|
| 78 |
+
Thus, we now consider two alternative sources for noisy training examples. First, we dilute the training set with examples that are drawn from a similar but different dataset. In particular, we use CIFAR-10 as our training dataset and dilute it with examples from CIFAR-100, assigning each image a category from CIFAR-10 at random. Second, we also consider a dilution of the training set with “examples” that are simply white noise; in this case, we match the mean and variance of pixels within CIFAR-10 and again assign labels uniformly at random.
|
| 79 |
+
|
| 80 |
+
Figure 6 shows the results obtained by a six-layer ConvNet on the different noise sources for varying levels of noise. We observe that both alternative sources of noise lead to better performance than the noise originating from the same dataset. For noisy examples drawn from CIFAR-100, performance drops only about half as much as when noise originates from CIFAR-10 itself. This trend is consistent across noise levels. For white noise, performance does not drop regardless of noise level; this is in line with prior work that has shown that neural networks are able to fit random input (Zhang et al., 2017). This indicates the scenarios considered in Experiments 1 and 2 represent in some sense a worst case.
|
| 81 |
+
|
| 82 |
+
In natural scenarios, we may expect massively noisy datasets to fall somewhere in between the cases exemplified by CIFAR-10 and CIFAR-100. That is, some examples will be relevant but mislabeled. However, it is likely that many examples will not be from any classes under consideration and therefore will influence training less negatively. In fact, it is possible that such examples might increase accuracy, if the erroneous labels reflect underlying similarity between the examples in question.
|
| 83 |
+
|
| 84 |
+
# 3.4 EXPERIMENTAL SETUP
|
| 85 |
+
|
| 86 |
+
All models are trained with AdaDelta (Zeiler, 2012) as optimizer and a batch size of 128. For each level of label noise we train separate models with different learning rates ranging from 0.01 to 1 and pick the learning rate that results in the best performance. Generally, we observe that the higher the label noise, the lower the optimal learning rate. We investigate this trend in detail in §5.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 7: Comparison of the effect of reusing images vs. using novel images as noisy examples. Essentially no difference is observed between the two types of noisy examples, supporting the use of repeated examples in our experiments.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 8: Performance on MNIST at various noise levels, as a function of the number of clean labels. There seems to be a critical amount of clean training data required to successfully train the networks. This threshold increases as the noise level rises. For example, at $\alpha = 1 0$ , 2,000 clean labels are needed to attain $90 \%$ performance, while at $\alpha = 5 0$ , 10,000 clean labels are needed.
|
| 93 |
+
|
| 94 |
+
In Experiments 1 and 2, noisy labels are drawn from the same dataset as the labels guaranteed to be correct. This involves drawing the same example many times from the dataset, giving it the correct label once, and in every other instance picking a random label according to the noise distribution in question. We show in Figure 7 that performance would have been comparable had we been able to draw noisy labels from an extended dataset, instead of repeating images. Specifically, we train a convolutional network on a subset of MNIST, with 2,500 certainly correct labels and with noisy labels drawn either with repetition from this set of 2,500 or without repetition from the remaining examples in the MNIST dataset. The results are essentially identical between repeated and unique examples, supporting our setup in the preceding experiments.
|
| 95 |
+
|
| 96 |
+
# 4 THE IMPORTANCE OF LARGER DATASETS
|
| 97 |
+
|
| 98 |
+
Underlying the ability of deep networks to learn from massively noisy data is the size of the data in question. It is well-established, see e.g., Deng et al. (2009), that traditional deep learning relies upon large datasets. We will now see how this is particularly true of noisy datasets.
|
| 99 |
+
|
| 100 |
+
In Figure 8, we compare the performance of a ConvNet on MNIST as the size of the training set varies. We also show the performance of the same ConvNet trained on MNIST diluted with noisy labels sampled uniformly. We show how the performance of the ConvNet varies with the number of cleanly labeled training examples. For example, for the blue curve of $\alpha = 1 0$ and 1,000 clean labels, the network is trained on 11,000 examples: 1,000 cleanly labeled examples and 10,000 with random labels.
|
| 101 |
+
|
| 102 |
+
Generally, we observe that independent of the noise level the networks benefit from more data and that, given sufficient data, the networks reach similar results. Further, the results indicate that there seems to be a critical amount of clean training data that is required to successfully train the networks. This critical amount of clean data depends on the noise level; in particular, it increases as the noise level rises. Since performance rapidly levels off past the critical threshold the main requirement for the clean training set is to be of sufficient size.
|
| 103 |
+
|
| 104 |
+
It is because of the critical amount of required clean data that we have not attempted to train networks for $\alpha \gg 1 0 0$ . The number of correct examples needed to train such a network might rise above the 60,000 provided in the MNIST dataset. In a real-world dataset, the amount of (noisy) data available for training is likely not to be the limiting factor. Rather, considerations such as training time and learning rate may play a more important role, as we discuss in the following section.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 9: Performance on MNIST for varying batch size as a function of noise level. Higher batch size gives better performance. We approximate the limit of infinite batch size by training without noisy labels, but using the noisy loss function $H _ { \alpha }$ .
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 10: Performance on CIFAR-10 for varying learning rate as a function of noise level. Lower learning rates are generally optimal as the noise level increases.
|
| 111 |
+
|
| 112 |
+
# 5 TRAINING ON NOISY DATASETS
|
| 113 |
+
|
| 114 |
+
In the preceding sections, our results were obtained by training neural networks with fixed batch size and running a parameter search to pick the optimal learning rate. We now look in more detail into how the choice of hyperparameters affects learning on noisy datasets.
|
| 115 |
+
|
| 116 |
+
# 5.1 BATCH SIZE
|
| 117 |
+
|
| 118 |
+
First, we investigate the effect of the batch size on the noise robustness of neural network training. In Figure 9, we compare the performance of a simple 2-layer ConvNet on MNIST with increasing noise, as batch size varies from 32 to 256. We observe that increasing the batch size provides greater robustness to noisy labels. One reason for this behavior could be that, within a batch, gradient updates from randomly sampled noisy labels cancel out, while gradients from correct examples that are marginally more frequent sum together and contribute to learning. By this logic, large batch sizes would be more robust to noise since the mean gradient over a larger batch is closer to the gradient for correct labels. All other experiments in this paper are performed with a fixed batch size of 128.
|
| 119 |
+
|
| 120 |
+
We may also consider the theoretical case of infinite batch size, in which gradients are averaged over the entire space of possible inputs at each training step. While this is often impossible to perform in practice, we can simulate such behavior by an auxiliary loss function.
|
| 121 |
+
|
| 122 |
+
In classification tasks, we are given an input $\mathbf { x }$ and aim to predict the class $f ( \mathbf { x } ) \in \{ 1 , 2 , \dots , m \}$ . The value $f ( \mathbf { x } )$ is encoded within a neural network by the 1-hot vector $\mathbf { y } ( \mathbf { x } )$ such that
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
y _ { k } ( \mathbf x ) = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { ~ i f ~ } } k = f ( \mathbf x ) } \\ { 0 } & { { \mathrm { ~ o t h e r w i s e ~ } } } \end{array} \right. }
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
for $1 \leq k \leq m$ . Then, the standard cross-entropy loss over a batch $X$ is given by:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
H ( X ) = - \langle \log \hat { y } _ { f ( \mathbf { x } ) } \rangle _ { X } ,
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\hat { \mathbf { y } }$ is the predicted vector and $\langle \cdot \rangle _ { X }$ denotes the expected value over the batch $X$ . We assume that $\hat { \mathbf { y } }$ is normalized (e.g. by the softmax function) so that the entries sum to 1.
|
| 135 |
+
|
| 136 |
+
For a training set with noisy labels, we may consider the label $f ( \mathbf { x } )$ given in the training set to be merely an approximation to the true label $f _ { 0 } ( x )$ . Consider the case of $n$ training examples, and $\alpha n$ noisy labels that are sampled uniformly at random from the set $\{ 1 , 2 , \ldots , m \}$ . Then, $f ( \mathbf { x } ) = f _ { 0 } ( \mathbf { x } )$ with probability $\frac { 1 } { 1 + \alpha }$ , and otherwise it is $1 , 2 , \ldots , m$ , each with probability $\frac { \alpha } { m ( 1 + \alpha ) }$ . As batch size increases, the expected value over the batch $X$ is approximated more closely by these probabilities. In the limit of infinite batch size, equation (2) takes the form of a noisy loss function $H _ { \alpha }$ :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { l } { { \displaystyle { \cal H } _ { \alpha } ( X ) : = - \frac { 1 } { 1 + \alpha } \langle \log \hat { y } _ { f _ { 0 } ( { \bf x } ) } \rangle _ { X } - \frac { \alpha } { m ( 1 + \alpha ) } \sum _ { k = 1 } ^ { m } \langle \log \hat { y } _ { k } \rangle _ { X } } } \\ { { \displaystyle \propto - \langle \log \hat { y } _ { f _ { 0 } ( { \bf x } ) } \rangle _ { X } - \alpha \left. \log \prod _ { k = 1 } ^ { m } \hat { y } _ { k } ^ { 1 / m } \right. _ { X } } } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
We can therefore compare training using the cross-entropy loss with $\alpha n$ noisy labels to training using the noisy loss function $H _ { \alpha }$ without noisy labels. The term on the right-hand side of (3) represents the noise contribution, and is clearly minimized where $\hat { y } _ { k }$ are all equal. As $\alpha$ increases, this contribution is weighted more heavily against $- \left. \log \hat { y } _ { f _ { 0 } ( \mathbf { x } ) } \right. _ { X }$ , which is minimized at $\hat { \mathbf { y } } ( \mathbf x ) = \mathbf { y } ( \mathbf x )$ .
|
| 143 |
+
|
| 144 |
+
We show in Figure 9 the results of training our 2-layer ConvNet on MNIST with the noisy loss function $H _ { \alpha }$ , simulating $\alpha n$ noisy labels with infinite batch size. We can observe that the network’s accuracy does not decrease as $\alpha$ increases. This can be explained by the observation that an increasing $\alpha$ is merely decreasing the magnitude of the true gradient, rather than altering its direction.
|
| 145 |
+
|
| 146 |
+
Our observations indicate that increasing noise in the training set reduces the effective batch size, as noisy signals roughly cancel out and only small learning signal remains. We show that increasing the batch size is a simple practical means to mitigate the effect of noisy training labels.
|
| 147 |
+
|
| 148 |
+
# 5.2 LEARNING RATE
|
| 149 |
+
|
| 150 |
+
It has become common practice in training deep neural networks to scale the learning rate with the batch size. In particular, it has been shown that the smaller the batch size, the lower the optimal learning rate (Krizhevsky, 2014). In our experiments, we have observed that noisy labels reduce the effective batch size. As such, we would expect that lower learning rates perform better than large learning rates as noise increases. Figure 10 shows the performance of a 4-layer ConvNet trained with different learning rates on CIFAR-10 for varying label noise. As expected, we observe that the optimal learning rate decreases as noise increases. For example, the optimal learning rate for the clean dataset is 1, while, with the introduction of noise, this learning rate becomes unstable.
|
| 151 |
+
|
| 152 |
+
To sum up, we observe that increasing label noise reduces the effective batch size. We have shown that the effect of label noise can be partly counterbalanced for by a larger training batch size. Now, we see that one can additionally scale the learning rate to compensate for any remaining change in effective batch size induced by noisy labels.
|
| 153 |
+
|
| 154 |
+
# 6 CONCLUSION
|
| 155 |
+
|
| 156 |
+
In this paper, we have considered the behavior of deep neural networks on training sets with very noisy labels. In a series of experiments, we have demonstrated that learning is robust to an essentially arbitrary amount of label noise, provided that the number of clean labels is sufficiently large. We have further shown that the threshold required for clean labels increases as the noise level does. Finally, we have observed that noisy labels reduce the effective batch size, an effect that can be mitigated by larger batch sizes and downscaling the learning rate.
|
| 157 |
+
|
| 158 |
+
It is worthy of note that although deep networks appear robust to even high degrees of label noise, clean labels still always perform better than noisy labels, given the same quantity of training data. Further, one still requires expert-vetted test sets for evaluation. Lastly, it is important to reiterate that our studies focus on non-adversarial noise.
|
| 159 |
+
|
| 160 |
+
Our work suggests numerous directions for future investigation. For example, we are interested in how label-cleaning and semi-supervised methods affect the performance of networks in a high-noise regime. Are such approaches able to lower the threshold for training set size? Finally, it remains to translate the results we present into an actionable trade-off between data annotation and acquisition costs, which can be utilized in real world training pipelines for deep networks on massive noisy data.
|
| 161 |
+
|
| 162 |
+
# REFERENCES
|
| 163 |
+
|
| 164 |
+
Eyal Beigman and Beata Beigman Klebanov. Learning with annotation noise. In Proceedings of the Joint Conference of the 47th Annual Meeting of the ACL and the 4th International Joint Conference on Natural Language Processing of the AFNLP. Association for Computational Linguistics, 2009.
|
| 165 |
+
|
| 166 |
+
Carla E Brodley and Mark A Friedl. Identifying mislabeled training data. Journal of artificial intelligence research (JAIR), 11:131–167, 1999.
|
| 167 |
+
|
| 168 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, (CVPR), 2009.
|
| 169 |
+
|
| 170 |
+
Melody Y Guan, Varun Gulshan, Andrew M Dai, and Geoffrey E Hinton. Who said what: Modeling individual labelers improves classification. arXiv:1703.08774, 2017.
|
| 171 |
+
|
| 172 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, (CVPR), 2016.
|
| 173 |
+
|
| 174 |
+
Armand Joulin, Laurens van der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In European Conference on Computer Vision, (ECCV). Springer, 2016.
|
| 175 |
+
|
| 176 |
+
I Krasin, T Duerig, N Alldrin, A Veit, S Abu-El-Haija, S Belongie, D Cai, Z Feng, V Ferrari, V Gomes, et al. Openimages: A public dataset for large-scale multi-label and multiclass image classification. Dataset available from https://github. com/openimages, 2(6):7, 2016.
|
| 177 |
+
|
| 178 |
+
Jonathan Krause, Benjamin Sapp, Andrew Howard, Howard Zhou, Alexander Toshev, Tom Duerig, James Philbin, and Li Fei-Fei. The unreasonable effectiveness of noisy data for fine-grained recognition. In European Conference on Computer Vision, (ECCV). Springer, 2016.
|
| 179 |
+
|
| 180 |
+
Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. arXiv preprint arXiv:1404.5997, 2014.
|
| 181 |
+
|
| 182 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 2009.
|
| 183 |
+
|
| 184 |
+
Quoc V Le. Building high-level features using large scale unsupervised learning. In International Conference on Acoustics, Speech and Signal Processing, (ICASSP). IEEE, 2013.
|
| 185 |
+
|
| 186 |
+
Yann LeCun, Corinna Cortes, and Christopher JC Burges. The MNIST database of handwritten digits, 1998.
|
| 187 |
+
|
| 188 |
+
Naresh Manwani and PS Sastry. Noise tolerance under risk minimization. IEEE Transactions on cybernetics, 43(3):1146–1151, 2013.
|
| 189 |
+
|
| 190 |
+
Ishan Misra, C Lawrence Zitnick, Margaret Mitchell, and Ross Girshick. Seeing through the human reporting bias: Visual classifiers from noisy human-centric labels. In Computer Vision and Pattern Recognition, (CVPR), 2016.
|
| 191 |
+
|
| 192 |
+
Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in neural information processing systems, (NIPS), 2013.
|
| 193 |
+
|
| 194 |
+
Lerrel Pinto, Dhiraj Gandhi, Yuanfeng Han, Yong-Lae Park, and Abhinav Gupta. The curious robot: Learning visual representations via physical interactions. In European Conference on Computer Vision, (ECCV). Springer, 2016.
|
| 195 |
+
|
| 196 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 197 |
+
|
| 198 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, (ICLR), 2014.
|
| 199 |
+
|
| 200 |
+
Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. YFCC100M: The new data in multimedia research. Communications of the ACM, 59(2):64–73, 2016.
|
| 201 |
+
|
| 202 |
+
Grant Van Horn, Steve Branson, Ryan Farrell, Scott Haber, Jessie Barry, Panos Ipeirotis, Pietro Perona, and Serge Belongie. Building a bird recognition app and large scale dataset with citizen scientists: The fine print in fine-grained dataset collection. In Computer Vision and Pattern Recognition, (CVPR), 2015.
|
| 203 |
+
|
| 204 |
+
Andreas Veit, Michael Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In Neural Information Processing Systems, (NIPS), 2016.
|
| 205 |
+
|
| 206 |
+
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Computer Vision and Pattern Recognition, (CVPR), 2017. URL https://vision.cornell.edu/se3/ wp-content/uploads/2017/04/DeepLabelCleaning_CVPR.pdf.
|
| 207 |
+
|
| 208 |
+
Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In International Conference on Computer Vision, (ICCV), 2015.
|
| 209 |
+
|
| 210 |
+
Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2691–2699, 2015.
|
| 211 |
+
|
| 212 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 213 |
+
|
| 214 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations, (ICLR), 2017.
|
| 215 |
+
|
| 216 |
+
Xiaojin Zhu. Semi-supervised learning literature survey. Computer Science, University of Wisconsin-Madison, 2(3):4, 2005.
|
md/train/B8fp0LVMHa/B8fp0LVMHa.md
ADDED
|
@@ -0,0 +1,586 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EMAQ: EXPECTED-MAX Q-LEARNING OPERATORFOR SIMPLE YET EFFECTIVE OFFLINE AND ONLINERL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Off-policy reinforcement learning (RL) holds the promise of sample-efficient learning of decision-making policies by leveraging past experience. However, in the offline RL setting – where a fixed collection of interactions are provided and no further interactions are allowed – it has been shown that standard off-policy RL methods can significantly underperform. Recently proposed methods often aim to address this shortcoming by constraining learned policies to remain close to the given dataset of interactions. In this work, we closely investigate an important simplification of BCQ (Fujimoto et al., 2018a) – a prior approach for offline RL – which removes a heuristic design choice and naturally restrict extracted policies to remain exactly within the support of a given behavior policy. Importantly, in contrast to their original theoretical considerations, we derive this simplified algorithm through the introduction of a novel backup operator, Expected-Max Q-Learning (EMaQ), which is more closely related to the resulting practical algorithm. Specifically, in addition to the distribution support, EMaQ explicitly considers the number of samples and the proposal distribution, allowing us to derive new sub-optimality bounds which can serve as a novel measure of complexity for offline RL problems. In the offline RL setting – the main focus of this work – EMaQ matches and outperforms prior state-of-the-art in the D4RL benchmarks (Fu et al., 2020a). In the online RL setting, we demonstrate that EMaQ is competitive with Soft Actor Critic (SAC). The key contributions of our empirical findings are demonstrating the importance of careful generative model design for estimating behavior policies, and an intuitive notion of complexity for offline RL problems. With its simple interpretation and fewer moving parts, such as no explicit function approximator representing the policy, EMaQ serves as a strong yet easy to implement baseline for future work.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Leveraging past interactions in order to improve a decision-making process is the hallmark goal of off-policy reinforcement learning (RL) (Precup et al., 2001; Degris et al., 2012). Effectively learning from past experiences can significantly reduce the amount of online interaction required to learn a good policy, and is a particularly crucial ingredient in settings where interactions are costly or safety is of great importance, such as robotics Gu et al. (2017); Kalashnikov et al. (2018a), health Murphy et al. (2001), dialog agents (Jaques et al., 2019), and education Mandel et al. (2014). In recent years, with neural networks taking a more central role in the RL literature, there have been significant advances in developing off-policy RL algorithms for the function approximator setting, where policies and value functions are represented by neural networks (Mnih et al., 2015; Lillicrap et al., 2015; Gu et al., 2016b;a; Haarnoja et al., 2018; Fujimoto et al., 2018b). Such algorithms, while off-policy in nature, are typically trained in an online setting where algorithm updates are interleaved with additional online interactions. However, in purely offline RL settings, where a dataset of interactions are provided ahead of time and no additional interactions are allowed, the performance of these algorithms degrades drastically (Fujimoto et al., 2018a; Jaques et al., 2019).
|
| 12 |
+
|
| 13 |
+
A number of recent methods have been developed to address this shortcoming of off-policy RL algorithms. A particular class of algorithms for offline RL that have enjoyed recent success are those based on dynamic programming and value estimation (Fujimoto et al., 2018a; Jaques et al., 2019; Kumar et al., 2019; Wu et al., 2019; Levine et al., 2020). Most proposed algorithms are designed with a key intuition that it is desirable to prevent policies from deviating too much from the provided collection of interactions. By moving far from the actions taken in the offline data, any subsequently learned policies or value functions may not generalize well and lead to the belief that certain actions will lead to better outcomes than they actually would. Furthermore, due to the dynamics of the MDP, taking out-of-distribution actions may lead to states not covered in the offline data, creating a snowball effect (Ross et al., 2011). In order to prevent learned policies from straying from the offline data, various methods have been introduced for regularizing the policy towards a base behavior policy (e.g. through a divergence penalty (Jaques et al., 2019; Wu et al., 2019; Kumar et al., 2019) or clipping actions (Fujimoto et al., 2018a)).
|
| 14 |
+
|
| 15 |
+
Taking the above intuitions into consideration, in this work we investigate a simplifcation of the BCQ algorithm (Fujimoto et al., 2018a) (a notable prior work in offline RL), which removes a heuristic design choice and has the property that extracted policies remain exactly within the support of a given behavior policy. In contrast to the theoretical considerations in the original work, we derive this simplified algorithm in a theoretical setup that more closely reflects the resulting algorithm. We introduce the Expected-Max Q-Learning (EMaQ) operator, which interpolates between the standard Q-function evaluation and Q-learning backup operators. The EMaQ operator makes explicit the relation between the proposal distribution and number of samples used, and leads to sub-optimality bounds which introduce a novel notion of complexity for offline RL problems. In its practical implementation for the continuous control and function approximator setting, EMaQ has only two standard components (an estimate of the base behavior policy, and Q functions) and does not explicitly represent a policy, requiring fitting one less function approximator than prior approaches (Fujimoto et al., 2018a; Kumar et al., 2019; Wu et al., 2019).
|
| 16 |
+
|
| 17 |
+
In online RL, EMaQ is competitive with Soft Actor Critic (SAC) (Haarnoja et al., 2018) and surpasses SAC in the deployment-efficient setting (Matsushima et al., 2020). In the offline RL setting – the main focus of this work – EMaQ matches and outperforms prior state-of-the-art in the D4RL (Fu et al., 2020a) benchmark tasks. Through our explorations with EMaQ we make two intriguing findings. First, due to the strong dependence of EMaQ on the quality of behavior policy used, our results demonstrate the significant impact of careful considerations in modeling the behavior policy that generate the offline interaction datasets. Second, relating to the introduced notion of complexity, in a diverse array of benchmark settings considered in this work we observe that surprisingly little modification to a base behavior policy is necessary to obtain a performant policy. As an example, we observe that while a HalfCheetah random policy obtains a return of 0, a policy that at each state uniformly samples only 5 actions and chooses the one with the best value obtains a return of 2000. The simplicity, intuitive interpretation, and strong empirical performance of EMaQ make it a great test-bed for further examination and theoretical analyses, and an easy to implement yet strong baseline for future work in offline RL.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
Throughout this work, we represent Markov Decision Process (MDP) as $M = \langle S , \mathcal { A } , r , \mathcal { P } , \gamma \rangle$ , with state space $s$ , action space $\mathcal { A }$ , reward function $r : S { \times } A { } \mathbb { R }$ , transition dynamics $\mathcal { P }$ , and discount $\gamma$ . In offline RL, we assume access to a dataset of interactions with the MDP, which we will represent as collection of tuples $D = \{ ( s , a , s ^ { \prime } , r , t ) \} ^ { N }$ , where $t$ is an indicator variable that is set to True when $s ^ { \prime }$ is a terminal state. We will use $\mu$ to represent the behavior policy used to collect $D$ , and depending on the context, we will overload this notation and use $\mu$ to represent an estimate of the true behavior policy. For a given policy $\pi$ , we will use the notation $d ^ { \pi } ( s ) , d ^ { \pi } ( s , a )$ to represent the state-visitation and state-action visitation distributions respectively.
|
| 22 |
+
|
| 23 |
+
As alluded to above, a significant challenge of offline RL methods is the problem of distribution shift. At training-time, there is no distribution shift in states as a fixed dataset $D$ is used for training, and the policy and value functions are never evaluated on states outside of $d ^ { \mu } ( s )$ . However, a very significant challenge is the problem of distribution shift in actions. Consider the Bellman backup for obtaining the Q-function of a given policy $\pi$ ,
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\begin{array} { r } { \mathcal T _ { \pi } Q ( s , a ) : = r ( s , a ) + \gamma \cdot \mathbb E _ { s ^ { \prime } } \mathbb E _ { a ^ { \prime } \sim \pi ( a ^ { \prime } | s ^ { \prime } ) } \Big [ Q ( s ^ { \prime } , a ^ { \prime } ) \Big ] } \end{array}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
The target Q-values on the right hand side depend on action samples $a ^ { \prime } \sim \pi ( a ^ { \prime } | s ^ { \prime } )$ . If the sampled actions are outside the distribution of actions observed in $D$ , the estimated Q-values can be erroneous leading to incorrect target values. The effects of action distribution shift are further exacerbated in actor-critic algorithms; out of distribution (OOD) actions may incorrectly be assigned high values, in which case the policy will be updated to further sample OOD actions, leading to a hazardous loop.
|
| 30 |
+
|
| 31 |
+
An important approach – with particular recent interest – to mitigate the effects of both kinds of distributional shift is to devise methods for constraining learned policies to remain close to the behavior policy $\mu$ : $d ^ { \pi } ( s , a ) \approx d ^ { \mu } ( s , a )$ . Below, we set the stage by reviewing a closely related prior work in offline RL.
|
| 32 |
+
|
| 33 |
+
Batch Constrained Q-Learning (BCQ) In BCQ (Fujimoto et al., 2018a) the aim is to constrain a Q-Learning based algorithm such that it will be effective in the offline RL continuous control setting with function approximators. To do so, the trained policy is parameterized as:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r l } & { \pi _ { \theta } ( a | s ) = \underset { a _ { i } + \xi _ { \theta } ( s , a _ { i } ) } { \arg \operatorname* { m a x } } Q _ { \psi } ( s , a _ { i } + \xi _ { \theta } ( s , a _ { i } ) ) \qquad \mathrm { f o r } \qquad a _ { i } \sim \mu ( a | s ) , i = 1 , . . . , N } \\ & { } \\ & { y ( s , a , s ^ { \prime } , r , t ) = \bigg ( r + ( 1 - t ) \cdot \gamma \operatorname* { m a x } _ { a _ { i } ^ { \prime } } Q _ { \psi ^ { \prime } } ( s ^ { \prime } , a _ { i } ^ { \prime } ) \bigg ) \qquad \mathrm { f o r } \qquad a _ { i } ^ { \prime } \sim \pi _ { \theta } ( a ^ { \prime } | s ^ { \prime } ) , i = 1 , . . . , N } \\ & { } \\ & { \mathcal { L } _ { Q } = \left( y ( s , a , s ^ { \prime } , r , t ) - Q _ { \psi } ( s , a ) \right) ^ { 2 } } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $y ( s , a )$ are target $\mathrm { Q }$ -values, $Q _ { \psi }$ is learned with the objective in equation 4, $\mu ( a | s )$ is an estimate of the base behavior policy (a generative model trained using the dataset $D$ ), and $\xi _ { \theta }$ is an action perturbation model trained to modify actions towards more optimal ones. Crucially, each component of the output of $\xi _ { \theta }$ is bounded to the range $[ - \Phi , \Phi ]$ . The key intuition is that because $a _ { i }$ are sampled from an estimate of the behavior policy, they should hopefully be within the distribution observed in $D$ . Thus, since the perturbation model is constrained by the hyperparameter $\Phi$ , the perturbed actions should not be too far from actions in the dataset. This should mitigate errors in value estimates, which should in turn lead to better updates for the perturbation model.
|
| 40 |
+
|
| 41 |
+
# 3 EXPECTED-MAX Q-LEARNING
|
| 42 |
+
|
| 43 |
+
We make the observation that, in the BCQ algorithm, if we could obtain a good estimate $\mu ( a | s )$ and sufficiently increased the number of samples $N$ , there would be no need for the perturbation network $\xi _ { \theta }$ . This simplification would remove one additional function approximator and the associated hyperparameter $\Phi$ . This is the driving intuition of our work, which we frame theoretically in a manner that encapsulates the key components: the behavior policy $\mu$ and number of samples $N$ . Below, we introduce the Expected-Max Q operator, illustrate its key properties for tabular MDPs, and obtain sub-optimality bounds which can serve as a novel measure of complexity of an offline RL problem for future theoretical work. We then provide an extension to the offline RL setting with function approximators, and then discuss the generative model used to approximate the behavior policy.
|
| 44 |
+
|
| 45 |
+
# 3.1 EXPECTED-MAX Q OPERATOR
|
| 46 |
+
|
| 47 |
+
Let $\mu ( a | s )$ be an arbitrary behavior policy, and let $\{ a _ { i } \} ^ { N } \sim \mu ( a | s )$ denote sampling $N$ iid actions from $\mu ( a | s )$ . Let $Q : { \mathcal { S } } \times { \mathcal { A } } \mathbb { R }$ be an arbitrary function. For a given choice of $N$ , we define the Expected-Max Q-Learning operator (EMaQ) $\mathcal { T } _ { \mu } ^ { N } Q$ as follows:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } & { \mathcal { T } _ { \mu } ^ { N } Q ( s , a ) : = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { i } ^ { \prime } \} ^ { N } \sim \mu ( \cdot \vert s ^ { \prime } ) } \left[ \underset { a ^ { \prime } \in \{ a _ { i } ^ { \prime } \} ^ { N } } { \operatorname* { m a x } } Q ( s ^ { \prime } , a ^ { \prime } ) \right] } \\ { \mathrm { Q . E v a l u a t i o n ~ f o r } \mu \quad } & { \mathcal { T } _ { \mu } Q ( s , a ) : = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { a ^ { \prime } \sim \mu ( \cdot \vert s ^ { \prime } ) } \left[ Q ( s ^ { \prime } , a ^ { \prime } ) \right] } \\ { \mathrm { Q . L e a r n i n g } \quad } & { \mathcal { T } ^ { \ast } Q ( s , a ) : = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \left[ \underset { a ^ { \prime } } { \operatorname* { m a x } } Q ( s ^ { \prime } , a ^ { \prime } ) \right] } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
This operator provides a natural interpolant between the on-policy backup for $\mu$ (Eq. 6) when $N = 1$ , and the Q-learning backup (Eq. 7) as $N \infty$ (if $\mu ( a | s )$ has full support over $\mathcal { A }$ ). We formalize these observations more precisely below when we articulate the key properties in the tabular MDP setting. We discuss how this relates to existing modified backup operators in the related work.
|
| 54 |
+
|
| 55 |
+
# 3.2 DYNAMIC PROGRAMMING PROPERTIES IN THE TABULAR MDP SETTING
|
| 56 |
+
|
| 57 |
+
To understand any novel backup operator it is useful to first characterize its key dynamic programming properties in the tabular MDP setting. First, we establish that EMaQ retains essential contraction and fixed-point existence properties, regardless of the choice of $N \in \mathbb { N }$ . In the interest of space, all missing proofs can be found in Appendix A.
|
| 58 |
+
|
| 59 |
+
Theorem 3.1. In the tabular setting, for any $N \in \mathbb { N }$ , $\mathcal { T } _ { \mu } ^ { N }$ is a contraction operator in the $\mathcal { L } _ { \infty }$ norm. Hence, with repeated applications of the $\mathcal { T } _ { \mu } ^ { N }$ , any initial $Q$ function converges to a unique fixed point.
|
| 60 |
+
|
| 61 |
+
Theorem 3.2. Let $Q _ { \mu } ^ { N }$ denote the unique fixed point achieved in Theorem 3.1, and let $\pi _ { \mu } ^ { N } ( a | s )$ denote the policy that samples $N$ actions from $\mu ( a | s ) , \{ a _ { i } \} ^ { N }$ , and chooses the action with the maximum $\bar { Q } _ { \mu } ^ { N }$ . Then $Q _ { \mu } ^ { N }$ is the $Q$ -value function corresponding to $\pi _ { \mu } ^ { N } ( a | s )$ .
|
| 62 |
+
|
| 63 |
+
Proof. (Theorem 3.2) Rearranging the terms in equation 5 we have,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \mathcal { T } _ { \mu } ^ { N } Q _ { \mu } ^ { N } ( s , a ) = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { a ^ { \prime } \sim \pi _ { \mu } ^ { N } ( a ^ { \prime } | s ^ { \prime } ) } [ Q _ { \mu } ^ { N } ( s ^ { \prime } , a ^ { \prime } ) ] } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Since by definition $Q _ { \mu } ^ { N }$ is the unique fixed point of $\mathcal { T } _ { \mu } ^ { N }$ , we have our result.
|
| 70 |
+
|
| 71 |
+
From these results we can then rigorously establish the interpolation properties of the EMaQ family. Theorem 3.3. Let $\pi _ { \mu } ^ { \ast }$ denote the optimal policy from the class of policies whose actions are restricted to lie within the support of the policy $\mu ( a | s )$ . Let $Q _ { \mu } ^ { * }$ denote the $Q$ -value function corresponding to $\pi _ { \mu } ^ { \ast }$ . Furthermore, let $Q _ { \mu }$ denote the $Q$ -value function of the policy $\mu ( a | s )$ . Let $\begin{array} { r } { \mu ^ { * } ( s ) : = \int _ { S u p p o r t ( \pi _ { \mu } ^ { * } ( a \left| s ) ) \right|} \mu ( a s ) } \end{array}$ denote the probability of optimal actions under $\mu ( a | s )$ . Under the assumption that $\operatorname* { i n f } _ { s } \mu ^ { * } ( s ) > 0$ and $r ( s , a )$ is bounded, we have that,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
Q _ { \mu } ^ { 1 } = Q _ { \mu } \qquad a n d \qquad \operatorname * { l i m } _ { N \to \infty } Q _ { \mu } ^ { N } = Q _ { \mu } ^ { * }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
That is, Theorem 3.3 shows that, given a base behavior policy $\mu ( a | s )$ , the choice of $N$ makes the EMaQ operator interpolate between evaluating the Q-value of $\mu$ on the one hand, and learning the optimal $\mathbf { Q }$ -value function on the other (optimal subject to the support constraint discussed in Theorem 3.3). In the special case where $\mu ( a | s )$ has full support over the action space $\mathcal { A }$ , EMaQ interpolates between the standard Q-Evaluation and Q-Learning operators in reinforcement learning.
|
| 78 |
+
|
| 79 |
+
Intuitively, as we increase $N$ , the fixed-points $Q _ { \mu } ^ { N }$ should correspond to increasingly better policies $\pi _ { \mu } ^ { N } ( a | s )$ . We show that this is indeed the case.
|
| 80 |
+
|
| 81 |
+
Theorem 3.4. For all $N , M \in \mathbb { N } ,$ , where $N > M$ , we have that $\forall s \in S , \forall a \in \operatorname { S u p p o r t } ( \mu ( \cdot | s ) )$ $Q _ { \mu } ^ { N } ( s , a ) \geq Q _ { \mu } ^ { M } ( s , a ) .$ . Hence, $\pi _ { \mu } ^ { N } ( a | s )$ is at least as good of a policy as $\pi _ { \mu } ^ { M } ( a | s )$ .
|
| 82 |
+
|
| 83 |
+
It is also valuable to obtain a sense of how suboptimal $\pi _ { \mu } ^ { N } ( a | s )$ may be with respect to the optimal policy supported by the policy $\mu ( a | s )$ .
|
| 84 |
+
|
| 85 |
+
Theorem 3.5. For $s \in S$ let,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\Delta ( s , N ) = \operatorname* { m a x } _ { a \in \mathrm { S u p p o r t } ( \mu ( \cdot | s ) ) } Q _ { \mu } ^ { * } ( s , a ) - \mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( \cdot | s ) } [ \operatorname* { m a x } _ { b \in \{ a _ { i } \} ^ { N } } Q _ { \mu } ^ { * } ( s , b ) ]
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
The suboptimality of $Q _ { \mu } ^ { N }$ can be upperbounded as follows,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\bigl \| Q _ { \mu } ^ { N } - Q _ { \mu } ^ { * } \bigr \| _ { \infty } \leq \frac { \gamma } { 1 - \gamma } \operatorname* { m a x } _ { s , a } \mathbb { E } _ { s ^ { \prime } } \Bigl [ \Delta ( s ^ { \prime } , N ) \Bigr ] \leq \frac { \gamma } { 1 - \gamma } \operatorname* { m a x } _ { s } \Delta ( s , N )
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
The same also holds when $Q _ { \mu } ^ { * }$ is replaced with $Q _ { \mu } ^ { N }$ in the definition of $\Delta$ .
|
| 98 |
+
|
| 99 |
+
# 3.3 A MEASURE OF COMPLEXITY FOR OFFLINE RL
|
| 100 |
+
|
| 101 |
+
The bounds in equation 8 capture the main intuitions about the interplay between $\mu ( a | s )$ and the choice of $N$ . If for each state, $\mu ( a | s )$ places sufficient mass over the optimal actions, $\dot { \pi } _ { \mu } ^ { N }$ will be
|
| 102 |
+
|
| 103 |
+
# Algorithm 1: Test-Time Policy $\pi _ { \mathrm { t e s t } }$
|
| 104 |
+
|
| 105 |
+
Function TestEnsemble(values): return $\lambda \cdot \operatorname* { m i n } ( v a l u e s ) + ( 1 - \lambda ) \cdot \operatorname* { m a x } ( v a l u e s )$
|
| 106 |
+
Function $\pi _ { \mathrm { t e s t } } \left( s \right)$ : $\{ a _ { i } \} ^ { N } \sim \mu ( a | s )$ return arg $\operatorname* { m a x } _ { \{ a _ { i } \} ^ { N } }$ TestEnsemble [Qi(s, a) for all i]
|
| 107 |
+
|
| 108 |
+
close to $\pi _ { \underline { { \mu } } } ^ { * }$ . The two variants of $\Delta ( s , N )$ , based on $Q _ { \mu } ^ { * }$ or $Q _ { \mu } ^ { N }$ , suggest an intriguing notion of difficulty for an offline RL problem. If we could estimate either of these $\mathrm { Q }$ -value functions, then for a desired set of states (such as initial states) we could plot $\Delta ( s , N )$ as decreasing function of $N$ . The rate at which this function decreases could serve as an intuitive notion of difficulty for a given offline offline RL problem which consists of an MDP and a given behavior policy. While we leave theoretical investigations of this measure for future work, our empirical results in Section 5 demonstrate that the effective value of $N$ may be surprisingly small.
|
| 109 |
+
|
| 110 |
+
# 3.4 OFFLINE RL SETTING WITH FUNCTION APPROXIMATORS
|
| 111 |
+
|
| 112 |
+
Typically, we are not provided with the policies that generated the provided trajectories. Hence, as a first step we fit a generative model $\mu ( a | s )$ to the $( s , a )$ pairs in the offline dataset, representing the mixture of policies that generated this data (details below). Having obtained $\mu ( a | s )$ , we move on to the EMaQ training procedure. Similar to prior works (Fujimoto et al., 2018a; Kumar et al., 2019; Wu et al., 2019), we train $K$ Q functions (represented by MLPs) and make use of an ensembling procedure to combat overestimation bias (Hasselt, 2010; Van Hasselt et al., 2016; Fujimoto et al., 2018b). Letting $D$ represent the offline dataset, the objective for the Q functions takes the following form:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r l } & { \mathcal { L } ( \theta _ { i } ) = \mathbb { E } _ { ( s , a , s ^ { \prime } , r , t ) \sim D } \left[ \Big ( Q _ { \theta _ { i } } ( s , a ) - y ( s , a , s ^ { \prime } , r , t ) \Big ) ^ { 2 } \right] } \\ & { y ( s , a , s ^ { \prime } , r , t ) = \bigg ( r + ( 1 - t ) \cdot \gamma \operatorname* { m a x } _ { a _ { i } ^ { \prime } } Q _ { e n s } ^ { \prime } ( s ^ { \prime } , a _ { i } ^ { \prime } ) \Big ) \quad \mathrm { f o r } \quad a _ { i } ^ { \prime } \sim \mu ( a ^ { \prime } | s ^ { \prime } ) , i = 1 , . . . , N } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $t$ is the indicator variable $\mathbb { 1 } [ s ^ { \prime }$ is terminal], and $Q _ { e n s } ^ { \prime }$ represents the ensemble of target Q functions. In short, we sample $N$ actions from $\mu ( \bar { a } ^ { \prime } | s ^ { \prime } )$ and take the value of the best action to form the target. The algorithm box describing the full training loop can be viewed in Algorithm 2.
|
| 119 |
+
|
| 120 |
+
Notably, we do not train an explicit neural network representing the policy. At test-time, given a state $s$ , we sample $N$ actions from $\mu ( a | s )$ and choose the action with the maximum value under the ensemble of Q functions (see Algorithm 1). While TestEnsemble can differ from the Ensemble function used to compute target Q values1, in this work we used the same ensembling procedure with $\lambda = 1 . 0$ (with the exception of experiments in Section F).
|
| 121 |
+
|
| 122 |
+
# 3.5 INTUITION FOR OFFLINE EMAQ AND MODELING $\mu ( a | s )$
|
| 123 |
+
|
| 124 |
+
The intuition for how offline $\mathrm { E M a Q }$ aims to address the problem of erroneous value estimates can be understood from attending to equation 10 and the form of the test-time policy (Algorithm 1). In equation 10 we observe that target values for the Q functions are computed by sampling actions from the behavior policy estimate $\pmb { \mu }$ , and not a separately learned policy that may sample out of distribution actions, as in BCQ. At test-time, our implicit policy is also formed by choosing amongst actions sampled from $\mu$ . Hence, if $\mu$ accurately estimates the behavior policy well, we will never sample actions outside the support and will not need to evaluate the value of such actions. In the practical setting where $\mu$ may have inaccuracies, the hyperparameter $N$ acts as an implicit regularizer: Using very large values of $N$ maximizes the chance of sampling actions that are out of distribution and have erroneous value estimates, while smaller $N$ reduces the chance of this happening in every update iteration and therefore smoothens the incorrect values.
|
| 125 |
+
|
| 126 |
+
With the importance of a good behavior estimates accentuated in our proposed method, we pay closer attention to the choice of generative model used for representing $\mu$ . Past works (Fujimoto et al., 2018a; Kumar et al., 2019; Wu et al., 2019) have typically used Variational Auto-Encoders (VAEs) (Kingma & Welling, 2013; Rezende et al., 2014) to represent the behavior distribution $\mu ( a | s )$ . Unfortunately, after training the aggregate posterior $q _ { \mathrm { a g g } } \bar { ( z ) } : = \mathbb { E } _ { x } [ q ( \boldsymbol { z } | \boldsymbol { x } ) ]$ of a VAE does not typically align well with its prior, making it challenging to sample from in a manner that effectively covers the distribution it was trained $\mathrm { { \dot { o } n ^ { 2 } } }$ . We opt for using an autoregressive architecture based on MADE (Germain et al., 2015) as it allows for representing more expressive distributions and enables more accurate sampling. Inspired by recent works (Metz et al., 2017; Van de Wiele et al., 2020), our generative model architecture also makes use of discretization in each action dimension. Full details can be found in Appendix B.
|
| 127 |
+
|
| 128 |
+
# 4 RELATED WORK
|
| 129 |
+
|
| 130 |
+
Offline RL Many recent methods for offline RL (Fujimoto et al., 2018a; Kumar et al., 2019; Wu et al., 2019; Jaques et al., 2019), where no interactive data collection is allowed during training, mostly rely on constraining the learned policy to stay close to the data collection distribution. Fujimoto et al. (2018a) clip the maximum deviation from actions sampled from a base behavior policy, while Kumar et al. (2019); Wu et al. (2019); Jaques et al. (2019) incorporate additional distributional penalties (such as KL divergence or MMD) for regularizing learned policies to remain close to the base policy. Our work is an instance of this family of approaches for offline RL; however, arguably our method is simpler as it does not involve learning an additional proposal-modifying policy Fujimoto et al. (2018a), or modifying reward functions (Kumar et al., 2019; Jaques et al., 2019).
|
| 131 |
+
|
| 132 |
+
Finding Maximizing Actions Na¨ıvely, EMaQ can also be seen as just performing approximate search for maxa $Q ( s , a )$ in standard Q-learning operator, which has been studied in various prior works for Q-learning in large scale spaces (e.g. continuous). NAF (Gu et al., 2016b) and ICNN (Amos et al., 2017) directly constrain the function family of Q-functions such that the optimization can be closed-form or tractable. QT-OPT (Kalashnikov et al., 2018b) makes use of two iterations of the Cross-Entropy Method (Rubinstein & Kroese, 2013), while CAQL (Ryu et al., 2019) uses Mixed-Integer Programming to find the exact maximizing action while also introducing faster approximate alternatives. In (Van de Wiele et al., 2020) – the most similar approach to our proposed method EMaQ – throughout training a mixture of uniform and learned proposal distributions are used to sample actions. The sampled actions are then evaluated under the learned Q functions, and the top K maximizing actions are distilled back into the proposal distribution. In contrast to our work, these works assume these are approximate maximization procedures and do not provide extensive analysis for the resulting TD operators. Our theoretical analysis on the family of TD operators described by EMaQ can therefore provide new perspectives on some of these highly successful Q-learning algorithms (Kalashnikov et al., 2018a; Van de Wiele et al., 2020) – particularly on how the proposal distribution affects convergence.
|
| 133 |
+
|
| 134 |
+
Modified Backup Operators Many prior works study modifications to standard backup operators to achieve different convergence properties for action-value functions or their induced optimal policies. $\Psi$ -learning (Rawlik et al., 2013) proposes a modified operator that corresponds to policy iterations with KL-constrained updates (Kakade, 2002; Peters et al., 2010; Schulman et al., 2015) where the action-value function converges to negative infinity for all sub-optimal actions. Similarly but distinctly, Fox et al. (2015); Jaques et al. (2017); Haarnoja et al. (2018); Nachum et al. (2017) study smoothed TD operators for a modified entropy- or KL-regularized RL objective. Bellemare et al. (2016) derives a family of consistent Bellman operators and shows that they lead to increasing action gaps (Farahmand, 2011) for more stable learning. However, most of these operators have not been studied in offline learning. Our work adds a novel family operators to this rich literature of operators for RL, and provides strong empirical validation on how simple modifications of operators can translate to effective offline RL with function approximations.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 1: Results for evaluating EMaQ on D4RL benchmark’s (Fu et al., 2020b) standard Mujoco domains, with $N \in \{ 5 , 1 0 , 2 5 , 5 0 , 1 0 0 , 2 0 0 , 4 0 0 \}$ . Values above $\mu ( a | s )$ represent the result of evaluating the base behavior policies. Horizontal green lines represent the reported performance of BEAR in the D4RL benchmark (apples to apples comparisons in Figure 2). The types of offline datasets are: random: 1M transitions are collected by a random agent, medium: 1M transitions are collected by a half-trained SAC (Haarnoja et al., 2018) policy, mixed: the replay buffer of this half-trained policy, and medium-expert: combination of the medium dataset and 1M additional transitions from a fully trained policy. Refer to main text (Section 5.1) for description of color-coding. For better legibility, we have included a larger variant of these plots in the Appendix L. Full experimental details in Appendix G.
|
| 138 |
+
|
| 139 |
+
# 5 EXPERIMENTS
|
| 140 |
+
|
| 141 |
+
For all experiments we make use of the codebase of (Wu et al., 2019), which presents the BRAC off-policy algorithm and examines the importance of various factors in BCQ (Fujimoto et al., 2018a) and BEAR (Kumar et al., 2019) methods. We implement EMaQ into this codebase. We make use of the recently proposed D4RL (Fu et al., 2020b) datasets for bechmarking offline RL.
|
| 142 |
+
|
| 143 |
+
Online EMaQ Despite obtaining strong online RL results competitive with and outperforming SAC (Haarnoja et al., 2018) (Figure 3), as the main focus of our work is for the offline setting, we have placed our online RL methodology and results in Appendix F. However, we emphasize that significance of obtaining strong online RL performance with effectively the same algorithm as the offline setting should not be overlooked. Most prior offline RL works have not considered how their methods might transfer to online or batched online setting, and recent work (Nair et al., 2020) has demonstrated the challenges of finetuning from a policy trained offline, in the online setting.
|
| 144 |
+
|
| 145 |
+
# 5.1 PRACTICAL EFFECT OF $N$ AND THE CHOICE OF GENERATIVE MODEL $\mu$
|
| 146 |
+
|
| 147 |
+
We begin by empirically evaluating key aspects of offline EMaQ, namely the effect of $N$ , and choice of generative model used for representing the behavior estimate $\mu$ . In prior approaches such as those described in the background section of this work, care must be taken in choosing the hyperparameter that dictates the extent to which learned policies can deviate from the base behavior policies; too small and we cannot improve upon the base policy, too large and the value of actions cannot be correctly estimated. In EMaQ, at least in theory, choosing higher values of $N$ should result in strictly better policies. Additionally, there exists a concern that $N$ may need to be impractically large. Thus, we empirically investigate to what extent the monotonic trend holds in practice, and seek to understand what magnitudes of $N$ result in good policies in practical benchmark domains. Figure 1 presents our results with $N \in \{ 5 , 1 0 , 2 5 , 5 0 , 1 0 0 , 2 0 0 , 4 0 0 \}$ . In the green plots, we observe that empirical results follow our intuitions: with increasing $N$ the resultant policies become better. In the medium-expert settings (i.e. orange plots), while for smaller values of $N$ we observe strong performance, there appears to be a downward trend. As discussed in Section 3.5, smaller values of $N$ result in an implicit regularization. Hence, the orange plots may indicate that even with the stronger choice of generative models in EMaQ, inaccuracies in value estimates may still exist, suggesting the need for future work that introduces better regularizers for the value functions than ensembling (Kumar et al., 2020). Lastly, the red plots indicate settings where behavior is erratic. Closer examination of training curves and our experiments with other off-policy methods (Figure 2) suggests that this may be due to the intrinsic nature of these environment and data settings.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 2: Comparison of EMaQ, BCQ, and BEAR on D4RL (Fu et al., 2020b) benchmark domains when using our proposed autoregressive $\mu ( a | s )$ . For both BCQ and BEAR, from left to right as the value of the hyperparameter increases, the allowed deviation from $\mu ( a | s )$ increases. Horizontal green lines represent the reported performance of BEAR in the D4RL benchmark. Color-coding follows Figure 1. For better legibility, we have included a larger variant of these plots in the Appendix L. Full experimental details in Appendix G.
|
| 151 |
+
|
| 152 |
+
The dashed horizontal lines in Figure 2 represent the performance of BEAR – which uses a VAE for representing $\mu - \mathrm { a s }$ reported in the D4RL (Fu et al., 2020b) benchmark paper (apples to apples comparison in Section 5.2). Our results demonstrate that the combination of a strong generative model and EMaQ’s simply constrained backup operator can match and in many cases noticeably exceed results from prior algorithms and design choices. Comparing Figure 2 to Figure 6 in the Appendix, we observe that our choice of generative model is crucial to the performance of EMaQ. With a VAE architecture as used in prior work, EMaQ’s performance is significantly reduced, in most cases worse than prior reported results for BEAR, and never exhibits a monotonic trend as a function of $N$ . This is despite the fact that when evaluating the performance of the behavior estimate $\mu$ under the two architecture choices results in almost identical results (the first column of each sub-plot corresponding to $\mu ( a | s ) ,$ ). We do not believe that autoregressive models are intrinsically better than VAEs, but rather our results demonstrate the need for more careful attention on the choice of $\mu ( a | s )$ . Since EMaQ is closely tied to the choice of behavior model, it may be more effective for evaluating how well $\mu ( a | s )$ represents the given offline dataset. From a practical perspective, our results suggest that for a given domain, focusing efforts on building-in good inductive biases in the generative models and value functions might be sufficient to obtain strong offline RL performance in many domains.
|
| 153 |
+
|
| 154 |
+
# 5.2 COMPARISON ON D4RL OFFLINE RL BENCHMARK
|
| 155 |
+
|
| 156 |
+
To evaluate EMaQ with respect to prior methods, we compare to two popular and closely related prior methods for offline RL, BCQ (Fujimoto et al., 2018a) and BEAR (Kumar et al., 2019). As with the previous section, full experimental details can be found in Appendix G.1. Figure 2 and Table 1 present our empirical results. Note that with our proposed autoregressive models, the results for BEAR are matched and in some cases noticeably above the values reported in the D4RL benchmark (Fu et al., 2020b) (green horizontal lines). For easier interpretation, the plots are colored
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan=1 colspan=1>Setting</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>BCQ</td><td rowspan=1 colspan=1>BEAR</td><td rowspan=1 colspan=1>EMaQ</td><td rowspan=1 colspan=1>EMaQ N</td></tr><tr><td rowspan=1 colspan=1>kitchen-completekitchen-partialkitchen-mixed</td><td rowspan=1 colspan=1>27.2 ± 3.246.2 ± 2.852.5 ± 3.8</td><td rowspan=1 colspan=1>26.5 ± 4.869.3 ± 5.265.5 ± 1.8</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>36.9 ± 3.774.6 ± 0.670.8 ± 2.3</td><td rowspan=1 colspan=1>6488</td></tr><tr><td rowspan=1 colspan=1>antmaze-umazeantmaze-umaze-diverse</td><td rowspan=1 colspan=1>59.0± 5.558.8± 9.5</td><td rowspan=1 colspan=1>25.5 ± 20.068.0 ± 19.0</td><td rowspan=1 colspan=1>56.3± 28.857.5 ± 39.2</td><td rowspan=1 colspan=1>91.0 ± 4.694.0 ± 2.4</td><td rowspan=1 colspan=1>10050</td></tr><tr><td rowspan=1 colspan=1> antmaze-medium-playantmaze-medium-diverseantmaze-large-playantmaze-large-diverse</td><td rowspan=1 colspan=1>0.7 ± 1.00.4 ± 0.80.0 ± 0.00.0 ± 0.0</td><td rowspan=1 colspan=1>3.5 ± 6.10.5 ± 0.90.0 ± 0.00.0 ± 0.0</td><td rowspan=1 colspan=1>0.2 ± 0.40.2 ± 0.40.0 ± 0.00.0± 0.0</td><td rowspan=1 colspan=1>0.0± 0.00.0 ± 0.00.0 ± 0.00.0 ± 0.0</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>door-clonedhammer-clonedpen-clonedrelocate-cloned</td><td rowspan=1 colspan=1>0.0± 0.01.2 ± 0.624.5 ± 10.2-0.2 ± 0.0</td><td rowspan=1 colspan=1>0.2 ± 0.41.3 ± 0.543.8 ± 6.4-0.2 ± 0.0</td><td rowspan=1 colspan=1>0.0± 0.00.3 ± 0.0-3.1 ± 0.20.0 ± 0.0</td><td rowspan=1 colspan=1>0.2 ± 0.31.0 ± 0.727.9 ± 3.7-0.2 ± 0.2</td><td rowspan=1 colspan=1>646412816</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 1: Results on a series of other environments and data settings from the D4RL benchmark (Fu et al., 2020a). Results are normalized to the range [0, 100], per the D4RL normalization scheme. For each method, for each environment and data setting the results of the best hyperparameter setting are reported. The last column indicates the best value of $N$ in EMaQ amongst the considered hyperparameters (for the larger antmaze domains, we do not report this value since no value of $N$ obtains nonzero returns). All the domains below the blue double-line are effectively unsolved by all methods. We have technical difficulties in evaluating BEAR on the kitchen domains. This manuscript will be updated upon obtaining these results. Additional details can be found in Appendix G.3.
|
| 161 |
+
|
| 162 |
+
the same as in Figure 1. Our key take-away is that despite its simplistic form, EMaQ is strongly competitive with prior state-of-the-art methods, and in the case of Table 1 outperforms prior approaches. Despite this, there remain many domains in the D4RL benchmark on which none of the considered algorithms make any progress (Table 1), indicating that much algorithmic advances are still necessary for solving many of the considered domains.
|
| 163 |
+
|
| 164 |
+
A very eye-catching result in above figures is that in almost all settings of the standard Mujoco environments (Figures 1 and 2), just $N = 5$ significantly improves upon $\mu ( a | s )$ and in most settings matches or exceeds significantly beyond previously reported results. Concretely, this means that in the HalfCheetah-Random setting, if at each state we sample 5 actions uniformly random and choose the best one under the learned Q-value function, we convert a random policy with return 0 to a policy with return 2000. In this way, EMaQ provides a quite intuitive and surprising measure of the complexity for offline RL problems. This empirical observation also corroborates our discussion in Section 3.3, encouraging future theoretical investigations into $\Delta ( s , N )$ .
|
| 165 |
+
|
| 166 |
+
# 6 CONCLUSION
|
| 167 |
+
|
| 168 |
+
In this work, we investigate a significant simplification of the BCQ (Fujimoto et al., 2018a) algorithm by removing the heuristic perturbation network. By introducing the Expect-Max Q-Learning operator, we present a novel theoretical setup that takes into account the proposal distribution $\mu ( a | s )$ and the number of action samples $N$ , and hence more closely matches the resulting practical algorithm. With fewer moving parts and one less function approximator, EMaQ matches and outperforms prior state-of-the-art in online and offline RL. Our investigations with EMaQ demonstrate the significance of careful considerations in the design of generative models used. Furthermore, our theoretical and empirical findings bring into light novel notions of complexity for offline RL problems. Given the simplicity, tractable theory, and state-of-the-art performance of EMaQ, we hope our work can serve as a foundation for future works on understanding and improving offline RL.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Brandon Amos, Lei Xu, and J Zico Kolter. Input convex neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 146–155. JMLR. org, 2017.
|
| 173 |
+
|
| 174 |
+
Marc G Bellemare, Georg Ostrovski, Arthur Guez, Philip S Thomas, and Remi Munos. Increasing ´ the action gap: New operators for reinforcement learning. In Thirtieth AAAI Conference on Artificial Intelligence, 2016.
|
| 175 |
+
|
| 176 |
+
Richard Y Chen, Szymon Sidor, Pieter Abbeel, and John Schulman. Ucb exploration via qensembles. arXiv preprint arXiv:1706.01502, 2017.
|
| 177 |
+
|
| 178 |
+
Thomas Degris, Martha White, and Richard S Sutton. Off-policy actor-critic. arXiv preprint arXiv:1205.4839, 2012.
|
| 179 |
+
|
| 180 |
+
Amir-massoud Farahmand. Action-gap phenomenon in reinforcement learning. In Advances in Neural Information Processing Systems, pp. 172–180, 2011.
|
| 181 |
+
|
| 182 |
+
Roy Fox, Ari Pakman, and Naftali Tishby. Taming the noise in reinforcement learning via soft updates. arXiv preprint arXiv:1512.08562, 2015.
|
| 183 |
+
|
| 184 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning, 2020a.
|
| 185 |
+
|
| 186 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. Datasets for data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020b.
|
| 187 |
+
|
| 188 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv preprint arXiv:1812.02900, 2018a.
|
| 189 |
+
|
| 190 |
+
Scott Fujimoto, Herke Van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018b.
|
| 191 |
+
|
| 192 |
+
Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. In International Conference on Machine Learning, pp. 881–889, 2015.
|
| 193 |
+
|
| 194 |
+
Shixiang Gu, Timothy Lillicrap, Zoubin Ghahramani, Richard E Turner, and Sergey Levine. Qprop: Sample-efficient policy gradient with an off-policy critic. arXiv preprint arXiv:1611.02247, 2016a.
|
| 195 |
+
|
| 196 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning, 2016b.
|
| 197 |
+
|
| 198 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In International Conference on Robotics and Automation, 2017.
|
| 199 |
+
|
| 200 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018.
|
| 201 |
+
|
| 202 |
+
Hado V Hasselt. Double q-learning. In Advances in neural information processing systems, pp. 2613–2621, 2010.
|
| 203 |
+
|
| 204 |
+
Natasha Jaques, Shixiang Gu, Dzmitry Bahdanau, Jose Miguel Hern ´ andez-Lobato, Richard E ´ Turner, and Douglas Eck. Sequence tutor: Conservative fine-tuning of sequence generation models with kl-control. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 1645–1654. JMLR. org, 2017.
|
| 205 |
+
|
| 206 |
+
Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
|
| 207 |
+
|
| 208 |
+
Sham M Kakade. A natural policy gradient. In Advances in neural information processing systems, pp. 1531–1538, 2002.
|
| 209 |
+
|
| 210 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, and Sergey Levine. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, 2018a.
|
| 211 |
+
|
| 212 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018b.
|
| 213 |
+
|
| 214 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 215 |
+
|
| 216 |
+
Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, 2019.
|
| 217 |
+
|
| 218 |
+
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 219 |
+
|
| 220 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 221 |
+
|
| 222 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 223 |
+
|
| 224 |
+
Travis Mandel, Yun-En Liu, Sergey Levine, Emma Brunskill, and Zoran Popovic. Offline policy evaluation across representations with applications to educational games. In International Conference on Autonomous Agents and Multiagent Systems, 2014.
|
| 225 |
+
|
| 226 |
+
Tatsuya Matsushima, Hiroki Furuta, Yutaka Matsuo, Ofir Nachum, and Shixiang Gu. Deploymentefficient reinforcement learning via model-based offline optimization. arXiv preprint arXiv:2006.03647, 2020.
|
| 227 |
+
|
| 228 |
+
Luke Metz, Julian Ibarz, Navdeep Jaitly, and James Davidson. Discrete sequential prediction of continuous actions for deep rl. arXiv preprint arXiv:1705.05035, 2017.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Susan A Murphy, Mark J van der Laan, James M Robins, and Conduct Problems Prevention Research Group. Marginal mean models for dynamic regimes. Journal of the American Statistical Association, 2001.
|
| 233 |
+
|
| 234 |
+
Ofir Nachum, Mohammad Norouzi, and Dale Schuurmans. Bridging the gap between value and policy based reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2772–2782, 2017.
|
| 235 |
+
|
| 236 |
+
Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. arXiv preprint arXiv:2006.09359, 2020.
|
| 237 |
+
|
| 238 |
+
Jan Peters, Katharina Mulling, and Yasemin Altun. Relative entropy policy search. In Twenty-Fourth AAAI Conference on Artificial Intelligence, 2010.
|
| 239 |
+
|
| 240 |
+
Doina Precup, Richard S Sutton, and Sanjoy Dasgupta. Off-policy temporal-difference learning with function approximation. In International Conference on Machine Learning, 2001.
|
| 241 |
+
|
| 242 |
+
Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In Twenty-Third International Joint Conference on Artificial Intelligence, 2013.
|
| 243 |
+
|
| 244 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 245 |
+
|
| 246 |
+
Stephane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and struc- ´ tured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 627–635, 2011.
|
| 247 |
+
|
| 248 |
+
Reuven Y Rubinstein and Dirk P Kroese. The cross-entropy method: a unified approach to combinatorial optimization, Monte-Carlo simulation and machine learning. Springer Science & Business Media, 2013.
|
| 249 |
+
|
| 250 |
+
Moonkyung Ryu, Yinlam Chow, Ross Anderson, Christian Tjandraatmadja, and Craig Boutilier. Caql: Continuous action q-learning. arXiv preprint arXiv:1909.12397, 2019.
|
| 251 |
+
|
| 252 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pp. 1889–1897, 2015.
|
| 253 |
+
|
| 254 |
+
Tom Van de Wiele, David Warde-Farley, Andriy Mnih, and Volodymyr Mnih. Q-learning in enormous action spaces via amortized approximate maximization. arXiv preprint arXiv:2001.08116, 2020.
|
| 255 |
+
|
| 256 |
+
Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. In Thirtieth AAAI conference on artificial intelligence, 2016.
|
| 257 |
+
|
| 258 |
+
Lilian Weng. Exploration strategies in deep reinforcement learning, Jun 2020. URL https://lilianweng.github.io/lil-log/2020/06/07/ exploration-strategies-in-deep-reinforcement-learning.html.
|
| 259 |
+
|
| 260 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
|
| 261 |
+
|
| 262 |
+
# A PROOFS
|
| 263 |
+
|
| 264 |
+
All the provided proofs operate under the setting where $\mu ( a | s )$ has full support over the action space. When this assumption is not satisfied, the provided proofs can be transferred by assuming we are operating in a new MDP $M _ { \mu }$ as defined below.
|
| 265 |
+
|
| 266 |
+
Given the MDP $\begin{array} { c c l } { M } & { = } & { \langle { \mathcal S } , { \mathcal A } , r , { \mathcal P } , \gamma \rangle } \end{array}$ and $\mu ( a | s )$ , let us define the new MDP $\begin{array} { r l } { M _ { \mu } } & { { } = } \end{array}$ $\langle S _ { \mu } , \mathcal { A } _ { \mu } , r , \mathcal { P } , \gamma \rangle$ , where $S _ { \mu }$ denotes the set of reachable states by $\mu$ , and $\mathcal { A } _ { \boldsymbol { \mu } }$ is $\mathcal { A }$ restricted to the support of $\mu ( a | s )$ in each state in $S _ { \mu }$ .
|
| 267 |
+
|
| 268 |
+
# A.1 CONTRACTION MAPPING
|
| 269 |
+
|
| 270 |
+
Theorem 3.1. In the tabular setting, for any $N \in \mathbb { N }$ , $\mathcal { T } _ { \mu } ^ { N }$ is a contraction operator in the $\mathcal { L } _ { \infty }$ norm. Hence, with repeated applications of the $\mathcal { T } _ { \mu } ^ { N }$ , any initial $Q$ function converges to a unique fixed point.
|
| 271 |
+
|
| 272 |
+
Proof. Let $Q _ { 1 }$ and $Q _ { 2 }$ be two arbitrary $Q$ functions.
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { l l } { \displaystyle \left\| { \mathcal T } _ { \mu } ^ { N } Q _ { 1 } - { \mathcal T } _ { \mu } ^ { N } Q _ { 2 } \right\| _ { \infty } = } & { ( 1 1 \nu , \forall \mathbf { x } , t _ { \infty } ) } \\ { \displaystyle \operatorname* { m a x } _ { s , a } \left. \left( r ( s , a ) + \gamma \cdot { \mathbb E } _ { s ^ { \prime } } { \mathbb E } _ { \left\{ a _ { i } \right\} ^ { N } } \left[ \operatorname* { m a x } _ { \left\{ a _ { i } \right\} ^ { N } } Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) \right] \right) - \left( r ( s , a ) + \gamma \cdot { \mathbb E } _ { s ^ { \prime } } { \mathbb E } _ { \left\{ a _ { i } \right\} ^ { N } } \left[ \operatorname* { m a x } _ { \left\{ a _ { i } \right\} ^ { N } } Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) \right] \right) \right) } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\begin{array} { r l } & { \gamma \cdot \underset { s , a } { \operatorname* { m a x } } \left| { \mathbb { E } } _ { s ^ { \prime } } { \mathbb { E } } _ { \{ a _ { i } \} ^ { N } } \left[ \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) - \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) \right] \right| \leq } \\ & { \gamma \cdot \underset { s , a } { \operatorname* { m a x } } { \mathbb { E } } _ { s ^ { \prime } } { \mathbb { E } } _ { \{ a _ { i } \} ^ { N } } \left| \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) - \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) \right| \leq } \\ & { \gamma \cdot \underset { s , a } { \operatorname* { m a x } } { \mathbb { E } } _ { s ^ { \prime } } { \mathbb { E } } _ { \{ a _ { i } \} ^ { N } } \left\| Q _ { 1 } - Q _ { 2 } \right\| _ { \infty } = } \\ & { \gamma \cdot \left\| Q _ { 1 } - Q _ { 2 } \right\| _ { \infty } } \end{array}
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
where line 15 is due to the following: Let $\hat { a } = \arg \operatorname* { m a x } _ { \{ a _ { i } \} ^ { N } } Q _ { 1 } ( s ^ { \prime } , a _ { i } ) ,$
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\begin{array} { r l } & { \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 1 } ( s ^ { \prime } , a ^ { \prime } ) - \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) = Q _ { 1 } ( s ^ { \prime } , \hat { a } ) - \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { 2 } ( s ^ { \prime } , a ^ { \prime } ) } \\ & { \qquad \leq Q _ { 1 } ( s ^ { \prime } , \hat { a } ) - Q _ { 2 } ( s ^ { \prime } , \hat { a } ) } \\ & { \qquad \leq \left\| Q _ { 1 } - Q _ { 2 } \right\| _ { \infty } } \end{array}
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
# A.2 LIMITING BEHAVIOR
|
| 289 |
+
|
| 290 |
+
Theorem 3.3. Let $\pi _ { \mu } ^ { \ast }$ denote the optimal policy from the class of policies whose actions are restricted to lie within the support of the policy $\mu ( a | s )$ . Let $Q _ { \mu } ^ { \ast }$ denote the $Q$ -value function corresponding to $\pi _ { \mu } ^ { \ast }$ . Furthermore, let $Q _ { \mu }$ denote the $Q$ -value function of the policy $\mu ( a | s )$ . Let $\begin{array} { r } { \mu ^ { * } ( s ) : = \int _ { S u p p o r t ( \pi _ { \mu } ^ { * } ( a \left| s ) ) \right|} \mu ( a s ) } \end{array}$ denote the probability of optimal actions under $\mu ( a | s )$ . Under the assumption that i $\operatorname* { i n f } _ { s } \mu ^ { * } ( s ) > 0$ and $r ( s , a )$ , we have that,
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
Q _ { \mu } ^ { 1 } = Q _ { \mu } \qquad a n d \qquad \operatorname * { l i m } _ { N \to \infty } Q _ { \mu } ^ { N } = Q _ { \mu } ^ { * }
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
Let $\begin{array} { r } { \mu ^ { * } ( s ) : = \int _ { \mathrm { S u p p o r t } ( \pi _ { \mu } ^ { * } ( a | s ) ) } \mu ( a | s ) } \end{array}$ denote the probability of optimal actions under $\mu ( a | s )$ . To show $\mathrm { l i m } _ { N \to \infty } Q _ { \mu } ^ { N } = Q _ { \mu } ^ { * }$ , we also require the additional assumption that $\operatorname* { i n f } _ { s } \mu ^ { * } ( s ) > 0$ .
|
| 297 |
+
|
| 298 |
+
Proof. Given that,
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r } { \mathcal { T } _ { \mu } ^ { 1 } Q ( s , a ) : = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( \cdot \vert s ^ { \prime } ) } \left[ Q ( s ^ { \prime } , a ^ { \prime } ) \right] } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
the unique fixed-point of $\mathcal { T } _ { \mu } ^ { 1 }$ is the Q-value function of the policy $\mu ( a | s )$ . Hence $Q _ { \mu } ^ { 1 } = Q _ { \mu }$
|
| 305 |
+
|
| 306 |
+
The second part of this theorem will be proven as a Corollary to Theorem 3.5
|
| 307 |
+
|
| 308 |
+
# A.3 INCREASINGLY BETTER POLICIES
|
| 309 |
+
|
| 310 |
+
Theorem 3.4. For all $N , M \in \mathbb { N } ,$ , where $N > M$ , we have that $\forall s \in S , \forall a \in \operatorname { S u p p o r t } ( \mu ( \cdot | s ) )$ , $Q _ { \mu } ^ { N } ( s , a ) \geq Q _ { \mu } ^ { M } ( s , a ) .$ . Hence, $\pi _ { \mu } ^ { N } ( a | s )$ is at least as good of a policy as $\pi _ { \mu } ^ { M } ( a | s )$ .
|
| 311 |
+
|
| 312 |
+
Proof. It is sufficient to show that $\forall s , a , Q _ { \mu } ^ { N + 1 } ( s , a ) \geq Q _ { \mu } ^ { N } ( s , a )$ . We will do so by induction. Let $Q ^ { i }$ denote the resulting function after applying $\mathcal { T } _ { \mu } ^ { N + 1 }$ , $i$ times, starting from $Q _ { \mu } ^ { N }$ .
|
| 313 |
+
|
| 314 |
+
# Base Case
|
| 315 |
+
|
| 316 |
+
By definition $Q ^ { 0 } : = Q _ { \mu } ^ { N }$ . Let $s \in \mathcal S , a \in \mathcal A$
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\begin{array} { r l } & { Q ^ { 1 } ( s , a ) = { \mathcal T } _ { \mu } ^ { N + 1 } Q ^ { 0 } ( s , a ) } \\ & { \qquad = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { \pm } \} ^ { N + 1 } \sim \mu ( a ^ { \prime } \mid s ^ { \prime } ) } \big [ \operatorname* { m a x } _ { \{ a _ { \pm } \} ^ { N + 1 } } Q ^ { 0 } ( s ^ { \prime } , a ^ { \prime } ) \big ] } \\ & { \qquad \geq r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { \pm } \} ^ { N } \sim \mu ( a ^ { \prime } \mid s ^ { \prime } ) } \big [ \operatorname* { m a x } _ { \{ a _ { \pm } \} ^ { N } } Q ^ { 0 } ( s ^ { \prime } , a ^ { \prime } ) \big ] } \\ & { \qquad = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { \pm } \} ^ { N } \sim \mu ( a ^ { \prime } \mid s ^ { \prime } ) } \big [ \operatorname* { m a x } _ { \{ a _ { \pm } \} ^ { N } } Q _ { \mu } ^ { N } ( s ^ { \prime } , a ^ { \prime } ) \big ] } \\ & { \qquad = Q _ { \mu } ^ { N } ( s , a ) } \\ & { \qquad = Q ^ { 0 } ( s , a ) } \end{array}
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
Induction Step
|
| 323 |
+
|
| 324 |
+
Assume $\forall s , a , Q ^ { i } ( s , a ) \geq Q ^ { i - 1 } ( s , a )$ .
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\begin{array} { r l r } { Q ^ { i + 1 } ( s , a ) - Q ^ { i } ( s , a ) = \mathcal { T } _ { \mu } ^ { N + 1 } Q ^ { i } ( s , a ) - \mathcal { T } _ { \mu } ^ { N + 1 } Q ^ { i - 1 } ( s , a ) } & { ( a ) } & { \mathrm { ~ ( ~ s ~ o ~ r ~ } ) } \\ { \ } & { = \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { i } \} ^ { N + 1 } \sim \mu ( a ^ { \prime } \mid s ^ { \prime } ) } \big [ \underset { \{ a _ { i } \} ^ { N + 1 } } { \operatorname* { m a x } } Q ^ { i } ( s ^ { \prime } , a ^ { \prime } ) - \underset { \{ a _ { i } \} ^ { N + 1 } } { \operatorname* { m a x } } Q ^ { i - 1 } ( s ^ { \prime } , a ^ { \prime } ) \big ] } & { ( a ) } & { ( a ) } \\ { \ } & { \mathrm { ~ ( ~ s ~ o ~ r ~ } ) } & { ( a ) } \\ { \ } & { \geq 0 } & { ( a ) } & { ( a ) } \end{array}
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
Hence, by induction we have to $\forall i , j , i > j \implies \forall s , a , Q ^ { i } ( s , a ) \geq Q ^ { j } ( s , a )$ . Since $Q ^ { 0 } = Q _ { \mu } ^ { N }$ and $\begin{array} { r } { \operatorname* { l i m } _ { i \to \infty } Q ^ { i } = Q _ { \mu } ^ { N + 1 } } \end{array}$ , we have than $\forall s , a , Q _ { \mu } ^ { N + 1 } ( s , a ) \geq Q _ { \mu } ^ { N } ( s , a )$ . Thus $\pi _ { \mu } ^ { N + 1 }$ is a better policy than $\pi _ { \mu } ^ { N }$ , and by a simple induction argument, $\pi _ { \mu } ^ { N }$ is a better policy than $\pi _ { \mu } ^ { M }$ when $N > M$ .
|
| 331 |
+
|
| 332 |
+
# A.4 BOUNDS
|
| 333 |
+
|
| 334 |
+
Theorem 3.5. For $s \in S$ let,
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\Delta ( s ) = \operatorname* { m a x } _ { a \in \mathrm { S u p p o r t } ( \mu ( \cdot | s ) ) } Q _ { \mu } ^ { * } ( s , a ) - \mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( \cdot | s ) } [ \operatorname* { m a x } _ { b \in \{ a _ { i } \} ^ { N } } Q _ { \mu } ^ { * } ( s , b ) ]
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
The suboptimality of $Q _ { \mu } ^ { N }$ can be upperbounded as follows,
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\bigl \| Q _ { \mu } ^ { N } - Q _ { \mu } ^ { * } \bigr \| _ { \infty } \leq \frac { \gamma } { 1 - \gamma } \operatorname* { m a x } _ { s , a } \mathbb { E } _ { s ^ { \prime } } \Bigl [ \Delta ( s ^ { \prime } ) \Bigr ] \leq \frac { \gamma } { 1 - \gamma } \operatorname* { m a x } _ { s } \Delta ( s )
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
The same also holds when $Q _ { \mu } ^ { * }$ is replaced with $Q _ { \mu } ^ { N }$ in the definition of $\Delta$ .
|
| 347 |
+
|
| 348 |
+
Proof. The two versions where $\Delta ( s )$ is defined in terms of $Q _ { \mu } ^ { N }$ and $Q _ { \mu } ^ { * }$ have very similar proofs.
|
| 349 |
+
|
| 350 |
+
Version with $Q _ { \mu } ^ { N }$
|
| 351 |
+
|
| 352 |
+
Let $\mathcal { T } ^ { Q L }$ denote the backup operation in $Q$ -Learning. Let $( \mathcal T ^ { Q L } ) ^ { m } = \mathcal T ^ { Q L } \circ \mathcal T ^ { Q L } \circ \ldots \circ \mathcal T ^ { Q L }$ . We {zm times know the following statements to be true:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { r l } & { Q _ { \mu } ^ { N } = \mathcal { T } _ { \mu } ^ { N } Q _ { \mu } ^ { N } = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( a ^ { \prime } | s ^ { \prime } ) } \big [ \underset { \{ a _ { i } \} ^ { N } } { \operatorname* { m a x } } Q _ { \mu } ^ { N } ( s ^ { \prime } , a ^ { \prime } ) \big ] } \\ & { \mathcal { T } ^ { Q L } Q _ { \mu } ^ { N } = r ( s , a ) + \gamma \cdot \mathbb { E } _ { s ^ { \prime } } \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { \mu } ^ { N } ( s ^ { \prime } , a ^ { \prime } ) } \\ & { \underset { \{ m \infty } } { \operatorname* { l i m } } ( \mathcal { T } ^ { Q L } ) ^ { m } Q _ { \mu } ^ { N } = Q ^ { \ast } \\ & { \big \| ( \mathcal { T } ^ { Q L } ) ^ { m + 2 } Q _ { \mu } ^ { N } - ( \mathcal { T } ^ { Q L } ) ^ { m + 1 } Q _ { \mu } ^ { N } \big \| _ { \infty } \leq \gamma \cdot \big \| ( \mathcal { T } ^ { Q L } ) ^ { m + 1 } Q _ { \mu } ^ { N } - ( \mathcal { T } ^ { Q L } ) ^ { m } Q _ { \mu } ^ { N } \big \| _ { \infty } } \\ & { \big \| ( \mathcal { T } ^ { Q L } ) ^ { m + 1 } Q _ { \mu } ^ { N } - ( \mathcal { T } ^ { Q L } ) ^ { m } Q _ { \mu } ^ { N } \big \| _ { \infty } \leq \gamma ^ { m } \cdot \big \| \mathcal { T } ^ { Q L } Q _ { \mu } ^ { N } - Q _ { \mu } ^ { N } \big \| _ { \infty } } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Putting these together we have that,
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r l } { \| Q _ { p } ^ { N } - Q ^ { * } \| _ { \infty } } & { \leq \displaystyle \sum _ { i = 0 } ^ { \infty } \| ( 7 ^ { 2 } E ^ { 2 } ) ^ { n + 1 } Q _ { p } ^ { N } - ( 7 ^ { 0 } E ^ { 2 } ) ^ { n } Q _ { i } ^ { N } \| _ { \infty } } \\ & { \leq \displaystyle \sum _ { i = 0 } ^ { \infty } \gamma ^ { n + 1 } \| T ^ { 2 } E ^ { 2 } Q _ { p } ^ { N } - Q _ { p } ^ { N } \| _ { \infty } } \\ & { - \displaystyle \sum _ { i = 1 } ^ { \infty } \| T ^ { 2 } e ^ { 2 \theta } Q _ { p } ^ { N } \| _ { \infty } } \\ & { = \displaystyle \frac { 1 } { 1 - \frac { 1 } { 2 } } \frac { 1 } { | \alpha _ { 0 } | } \left[ ( 5 ^ { 0 } \alpha _ { 0 } ^ { 3 } ) \Big | \Big ( Y ^ { 1 } ( \alpha _ { 0 } ^ { 3 } ) + \frac { 1 } { 2 } \gamma \cdot \mathbb { E } _ { \alpha _ { 0 } ^ { 3 } } \frac { \cos { ( B _ { 0 } ^ { N } / \varepsilon ) } } { \sin \alpha _ { 0 } ^ { 3 } } \Big ) \right. } \\ & { \qquad \left. - \left( \Gamma ( \varepsilon ^ { 0 } , \alpha ) + \gamma \cdot \mathbb { E } _ { \alpha _ { 0 } ^ { 3 } } \frac { \cos { ( B _ { 0 } ^ { N } / \varepsilon ) } } { | \alpha _ { 0 } ^ { 3 } - \alpha | ^ { 3 } } \Big ) \frac { \sin { ( B _ { 0 } ^ { N } / \varepsilon ) } ^ { 2 } ( \beta _ { 0 } ^ { 3 } ) } { | \alpha _ { 0 } ^ { 3 } - \alpha | ^ { 3 } } \right] \right\| } \\ & = \displaystyle \frac { \gamma } { 1 - \frac { 3 } { 2 } } \frac \sin { ( B _ { 0 } ^ { N } / \varepsilon ) } \left[ \sin { ( B _ { 0 } ^ { N } / \varepsilon ^ { \prime } ) } - \sin { ( B _ { 0 } ^ { N } / \varepsilon ) } \sin { ( B _ { 0 } ^ { N } / \varepsilon ) } \sin { ( B _ { 0 } ^ { N } / \varepsilon ^ { \prime } ) } \right] \frac { \sin { ( B _ { 0 } ^ { N } / \varepsilon ^ { \prime } ) } ^ { 2 } } { | \alpha _ { 0 } ^ { 3 } - \alpha | ^ { 3 } } \rho _ { \alpha } ^ { N } ( \varepsilon ^ { \prime } ) \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Version with $Q _ { \mu } ^ { * }$
|
| 365 |
+
|
| 366 |
+
Very similarly we have,
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\begin{array} { r l } { \| Q _ { \nu } ^ { \nu } - Q ^ { * } \| _ { \infty } \leq } & { \displaystyle \sum _ { n = 0 } ^ { \infty } \| ( f _ { \nu } ^ { ( X _ { n } ) n + 1 } Q ^ { * } - ( f _ { \nu } ^ { ( X _ { n } ) n } ) ^ { n } Q ^ { * } \| _ { \infty } } \\ & { \leq \displaystyle \sum _ { n = 0 } ^ { \infty } \gamma ^ { n } \cdot \| T _ { \nu } ^ { ( X _ { n } ) n } Q ^ { * } - Q ^ { * } \| _ { \infty } } \\ & { = - \displaystyle \sum _ { 1 = \gamma } ^ { \infty } \| Q ^ { * } \ \gamma ^ { ( X _ { n } ) } Q ^ { * } \| _ { \infty } } \\ & { = \frac { 1 } { 1 - \gamma } \displaystyle \sum _ { n = 0 } ^ { \infty } \bigg \| \bigg ( f ( c ^ { ( X _ { n } ) n } + 7 \cdot \mathbb { E } _ { c } \cdot \operatorname* { m a x } _ { \theta \leq t } Q ^ { * } ( \nu ^ { ( X _ { n } ) n } , \theta ) \bigg ) } \\ & { \qquad - \left( f ( c ^ { ( X _ { n } ) n } + 7 \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \operatorname* { m a x } _ { \theta \leq t } ( \nu ^ { ( X _ { n } ) n } \log \mathbb { R } ^ { ( \theta _ { \theta } ) } , \theta ^ { * } ) \right) \bigg ) } \\ & { = - \frac { \gamma } { 1 - \gamma } \displaystyle \sum _ { n = 0 } ^ { \infty } \| Q ^ { * } \| _ { \infty } \mathbb { E } \cdot \Big [ \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \Big ( \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \Big ( \nu ^ { ( X _ { n } ) n } \Big ) \Big \| _ { \mathbb { R } ^ { 2 } } Q ^ { * } \Big ( \nu ^ { ( X _ { n } ) n } , \theta \Big ) \Big ] } \\ & = \frac { \gamma } { 1 - \gamma } \displaystyle \sum _ { n = 0 } ^ { \infty } \mathbb { E } \cdot \Big [ \mathbb { E } _ { c } \Big ( \mathbb { E } _ { c } \cdot \mathbb { E } _ { c } \cdot Q ^ { * } \Big ( \nu ^ { ( X _ { n } ) n } \Big ) \end{array}
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
Corollary A.1. Let $V _ { \mu } , Q _ { \mu } , A _ { \mu }$ denote the value, $Q _ { i }$ , and advantage functions of $\mu$ respectively. When $N = 1$ we have that,
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { r l } & { \| Q _ { \mu } - Q ^ { * } \| _ { \infty } \leq \frac { \gamma } { 1 - \gamma } \underset { s ^ { \prime } } { \operatorname* { m a x } } \left| \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { \mu } ( s ^ { \prime } , a ^ { \prime } ) - \mathbb { E } _ { a ^ { \prime } \sim \mu ( a ^ { \prime } | s ^ { \prime } ) } [ Q _ { \mu } ( s ^ { \prime } , a ^ { \prime } ) ] \right| } \\ & { \qquad = \frac { \gamma } { 1 - \gamma } \underset { s ^ { \prime } } { \operatorname* { m a x } } \left| \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { \mu } ( s ^ { \prime } , a ^ { \prime } ) - V _ { \mu } ( s ^ { \prime } ) \right| } \\ & { \qquad = \frac { \gamma } { 1 - \gamma } \underset { s ^ { \prime } , a ^ { \prime } } { \operatorname* { m a x } } A _ { \mu } ( s ^ { \prime } , a ^ { \prime } ) } \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
It is interesting how the sub-optimality can be upper-bounded in terms of a policy’s own advantage function.
|
| 379 |
+
|
| 380 |
+
# Corollary A.2. (Proof for second part of Theorem 3.3)
|
| 381 |
+
|
| 382 |
+
Proof. We want to show $\mathrm { l i m } _ { N \to \infty } Q _ { \mu } ^ { N } = Q ^ { * }$ . More exactly, what we seek to show is the following,
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\operatorname* { l i m } _ { N \to \infty } \left\| Q _ { \mu } ^ { N } - Q ^ { * } \right\| _ { \infty } = 0
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
or,
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\forall \epsilon > 0 , \exists N , \mathrm { ~ s . t . ~ } \forall M \ge N , \left\| Q _ { \mu } ^ { N } - Q ^ { * } \right\| _ { \infty } < \epsilon
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
Let $\epsilon > 0$ . Recall,
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\Delta ( s ) = \operatorname* { m a x } _ { a \in \mathrm { S u p p o r t } ( \mu ( \cdot | s ) ) } Q _ { \mu } ^ { * } ( s , a ) - \mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( \cdot | s ) } [ \operatorname* { m a x } _ { b \in \{ a _ { i } \} ^ { N } } Q _ { \mu } ^ { * } ( s , b ) ]
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
Let $\operatorname* { i n f } _ { s } \mu ^ { * } ( s ) = p > 0$ . Let the lower and upper bounds of rewards be $\ell$ and $L$ , and let $\begin{array} { r } { \alpha = \frac { 1 } { 1 - \gamma } \ell } \end{array}$ and $\begin{array} { r } { \beta = \frac { 1 } { 1 - \gamma } L } \end{array}$ . We have that,
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\mathbb { E } _ { \{ a _ { i } \} ^ { N } \sim \mu ( \cdot \vert s ) } [ \operatorname* { m a x } _ { b \in \{ a _ { i } \} ^ { N } } Q _ { \mu } ^ { * } ( s , b ) ] \geq ( 1 - p ) ^ { N } \cdot \alpha + ( 1 - ( 1 - p ) ^ { N } ) \cdot \operatorname* { m a x } _ { a \in \mathrm { S u p p o r } ( \mu ( \cdot \vert s ) ) } Q _ { \mu } ^ { * } ( s , a )
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
Hence $\forall s$
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\begin{array} { r l } & { \Delta ( s ) \leq ( 1 - p ) ^ { N } \cdot \underset { a \in \mathrm { { S u p p o r t } } ( \mu ( \cdot | s ) ) } { \operatorname* { m a x } } Q _ { \mu } ^ { * } ( s , a ) - ( 1 - p ) ^ { N } \cdot \alpha } \\ & { \qquad = ( 1 - p ) ^ { N } \cdot \Big ( \underset { a \in \mathrm { { S u p p o r t } } ( \mu ( \cdot | s ) ) } { \operatorname* { m a x } } Q _ { \mu } ^ { * } ( s , a ) - \alpha \Big ) } \\ & { \qquad \leq ( 1 - p ) ^ { N } \cdot \Big ( \beta - \alpha \Big ) } \end{array}
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
Thus, for large enough $N$ we have that,
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\left\| Q _ { \mu } ^ { N } - Q _ { \mu } ^ { * } \right\| _ { \infty } \leq \frac { \gamma } { 1 - \gamma } \operatorname* { m a x } _ { s } \Delta ( s ) < \epsilon
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
concluding the proof.
|
| 419 |
+
|
| 420 |
+
# B AUTOREGRESSIVE GENERATIVE MODEL
|
| 421 |
+
|
| 422 |
+
The architecture for our autoregressive generative model is inspired by the works of (Metz et al., 2017; Van de Wiele et al., 2020; Germain et al., 2015). Given a state-action pair from the dataset $( s , a )$ , first an MLP produces a $d$ -dimensional embedding for $s$ , which we will denote by $h$ . Below, we use the notation $a _ { i }$ to denote the $i ^ { t h }$ index of $a$ , and $a _ { [ : i ] }$ to represent a slice from first up to and not including the $i ^ { t h }$ index, where indexing begins at 0. We use a discretization in each action dimension. Thus, we discretize the range of each action dimension into $N$ uniformly sized bins, and represent $a$ by the labels of the bins. Let $\ell _ { i }$ denote the label of the $i ^ { t h }$ action index.
|
| 423 |
+
|
| 424 |
+
Training We use separate MLPs per action dimension. Each MLP takes in the $d$ -dimensional state embedding and ground-truth actions before that index, and outputs $N$ logits for the choice over bins. The probability of a given index’s label is given by,
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
p ( \ell _ { i } | s , a [ : i ] ) = \mathrm { S o f t M a x } \Big ( \mathbf { M L P } _ { i } ( d , a [ : i ] ) \Big ) \left[ \ell _ { i } \right]
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
We use standard maximum-likelihood training (i.e. cross-entropy loss).
|
| 431 |
+
|
| 432 |
+
Sampling Given a state $s$ , to sample an action we again embed the state, and sample the action indices one-by-one.
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\begin{array} { r l } & { p ( \ell _ { 0 } | s ) = \mathrm { S o f t M a x } \Big ( \mathrm { M L P } _ { i } ( d ) \Big ) \left[ \ell _ { 0 } \right] } \\ & { \ell _ { 0 } \sim p ( \ell _ { 0 } | s ) , a _ { 0 } \sim \mathrm { U n i f o r m } \big ( \mathrm { B i n c o r r e s p o n d i n g t o } \ell _ { 0 } \big ) } \\ & { p ( \ell _ { i } | s ) = \mathrm { S o f t M a x } \Big ( \mathrm { M L P } _ { i } ( d , a [ : i ] ) \Big ) \left[ \ell _ { i } \right] } \\ & { \ell _ { i } \sim p ( \ell _ { i } | s , a [ : i ] ) , a _ { i } \sim \mathrm { U n i f o r m } \big ( \mathrm { B i n c o r r e s p o n d i n g t o } \ell _ { i } \big ) } \end{array}
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
# C ALGORITHM BOX
|
| 439 |
+
|
| 440 |
+
# Algorithm 2: Full EMaQ Training Algorithm
|
| 441 |
+
|
| 442 |
+
Offline dataset $\mathcal { D }$ , Pretrain $\mu ( a | s )$ on $\mathcal { D }$
|
| 443 |
+
Initialize $K$ Q functions with parameters $\theta _ { i }$ , and $K$ target $\mathrm { Q }$ functions with parameters $\theta _ { i } ^ { \mathrm { t a r g e t } }$
|
| 444 |
+
Ensemble parameter $\lambda$ , Exponential moving average parameter $\alpha$
|
| 445 |
+
|
| 446 |
+
Function Ensemble(values):
|
| 447 |
+
|
| 448 |
+
\*/
|
| 449 |
+
|
| 450 |
+
while not converged do
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\begin{array} { r l } & { \mathcal { L } ( \boldsymbol { \theta } _ { i } ) = \sum _ { m } \Big ( Q _ { i } ( s _ { m } , a _ { m } ) - y _ { \mathrm { t a r g e t } } ( s _ { m } , a _ { m } , s _ { m } ^ { \prime } , r _ { m } , t _ { m } ) \Big ) ^ { 2 } } \\ & { \theta _ { i } \theta _ { i } - \mathrm { \normalfont ~ \mathscr { A } \mathrm { d } a m U p d a t e } \Big ( \mathcal { L } ( \boldsymbol { \theta } _ { i } ) , \theta _ { i } \Big ) } \\ & { \theta _ { i } ^ { \mathrm { t a r g e t } } \alpha \cdot \theta _ { i } ^ { \mathrm { t a r g e t } } + ( 1 - \alpha ) \cdot \theta _ { i } } \end{array}
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
# D INCONCLUSIVE EXPERIMENTS
|
| 457 |
+
|
| 458 |
+
# D.1 UPDATING THE PROPOSAL DISTRIBUTION
|
| 459 |
+
|
| 460 |
+
Akin to the work of (Van de Wiele et al., 2020), we considered maintaining a second proposal distribution $\tilde { \mu }$ that is updated to distill arg $\operatorname* { m a x } _ { \{ a _ { i } \} ^ { N } } Q ( s , a )$ , and sampling from the mixture of $\mu$ and $\tilde { \mu }$ . In our experiments however, we did not observe noticeabel gains. This may potentially be due to the relative simplicity of the Mujoco benchmark domains, and may become more important in more challenging domains with more uniformly distributed $\mu ( a | s )$ .
|
| 461 |
+
|
| 462 |
+
# E LAUNDRY LIST
|
| 463 |
+
|
| 464 |
+
• Autoregressive models are slow to generate samples from and EMaQ needs to take many samples, so it was slower to train than the alternative methods. However, this may be addressed by better generative models and engineering effort.
|
| 465 |
+
|
| 466 |
+
# F ONLINE RL
|
| 467 |
+
|
| 468 |
+
EMaQ is also applicable to online RL setting. Combining strong offline RL methods with good exploration policies has the potential for producing highly sample-efficient online RL algorithms. Concretely, we refer to online RL as the setting where iteratively, a batch of $M$ environment steps with an exploration policy are interleaved with $M$ RL updates (Levine et al., 2020; Matsushima et al., 2020).
|
| 469 |
+
|
| 470 |
+
EMaQ is designed to remain within the support of the provided training distribution. This however, is problematic for online RL which requires good exploration interleaved with RL updates. To this end, first, we modify our autoregressive proposal distribution $\mu ( a | s )$ by dividing the logits of all softmaxes by $\tau > 1$ . This has the effect of smoothing the $\mu ( a | s )$ distribution, and increasing the probability of sampling actions from the low-density regions and the boundaries of the support. Given this online proposal distribution, a criteria is required by which to choose amongst sampled actions. While there exists a rich literature on how to design effective RL exploration policies (Weng, 2020), in this work we used a simple UCB-style exploration criterion (Chen et al., 2017) as follows:
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
Q ^ { \mathrm { e x p l o r e } } ( s , a ) = \mathrm { m e a n } \Big ( \{ Q _ { i } ( s , a ) \} _ { K } \Big ) + \beta \cdot \mathrm { s t d } \Big ( \{ Q _ { i } ( s , a ) \} _ { K } \Big )
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
Given $N$ sampled actions from the modified proposal distribution, we take the action with highest $Q ^ { \mathrm { e x p l o r e } }$ .
|
| 477 |
+
|
| 478 |
+
We compare the online variant of EMaQ with entropy-constrained Soft Actor Critic (SAC) with automatic tuning of the temperature parameter (Haarnoja et al., 2018). For EMaQ we swept the temperatures and used a fixed bin size of 40, 8 Q-function ensembles and $N = 2 0 0$ . For fairness of comparisons, we also ran SAC with similar sweeps over different collection batch sizes and number of Q-function ensembles. In the fully online setting (trajectory batch size 1, Figure 3a), EMaQ is already competitive with SAC, and more excitingly, in the deployment-efficient setting3 (trajectory batch size 50K, Figure 3b), EMaQ can outperform $\mathsf { S A C ^ { 4 } }$ . Figures 4 and 5 present the results for all hyperparameter settings, for SAC and EMaQ, in the batch size 1 and batch size $5 0 K$ settings respectively. In the fully online setting, EMaQ is already competitive with SAC, and more excitingly, in the deployment-efficient setting, EMaQ can outperform SAC.
|
| 479 |
+
|
| 480 |
+
# G OFFLINE RL EXPERIMENTAL DETAILS
|
| 481 |
+
|
| 482 |
+
For each environment and data setting, we train an autoregressive model – as described above – on the provided data with 2 random seeds. These generative models are then frozen, and used by the downstream algorithms (EMaQ, BEAR, and BCQ) as the base behavior policy $( \mu ( a | s )$ in $\mathrm { E M a O } ) ^ { 5 }$ .
|
| 483 |
+
|
| 484 |
+
# G.1 COMPARING OFFLINE RL METHODS
|
| 485 |
+
|
| 486 |
+
Following the bechmarking efforts of (Wu et al., 2019), the range of clipping factor considered for BCQ was $\Phi \in \{ 0 . 0 0 5 , 0 . 0 \hat { 1 } 5 , 0 . 0 5 , 0 . 1 5 , 0 . 5 \}$ , and the range of target divergence value considered for BEAR was $\epsilon \in \{ 0 . 0 1 5 , 0 . 0 5 , 0 . 1 5 , 0 . 5 , 1 . 5 \}$ . For both methods, the larger the value of the hyperparameter is, the more the learned policy is allowed to deviate from the $\bar { \mu ( a | s ) }$ .
|
| 487 |
+
|
| 488 |
+
The rest of the hyperparameters use can be found in Table 2. The autoregressive models have the following architecture sizes (refer to Appendix B for description of the models used). The state embedding MLP consists of 2 hidden layers of dimension 750 with relu activations, followed by a linear embedding into a 750 dimensional state representation. The individual MLP for each action dimension consist of 3 hidden layers of dimension 256 with relu activations. Each action dimension is discretized into 40 equally sized bins.
|
| 489 |
+
|
| 490 |
+

|
| 491 |
+
|
| 492 |
+
(a) SAC vs. EMaQ, Trajectory Batch Size 1: For easier visual interpretration we plot a single hyperparameter setting of EMaQ that tended to perform well across the 4 domains considered. The hyperparameters considered were $N = 2 0 0$ , $\lambda = 1 . 0$ , $\beta = 1 . 0$ , $\tau \in \{ 1 , 5 , 1 0 , 2 0 \}$ . SAC performed worse when using 8 Q-functions as in EMaQ. $_ \textrm { x }$ -axis unit is 1 million environment steps.
|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
|
| 496 |
+
(b) SAC vs. EMaQ, Trajectory Batch Size 50K: For easier visual interpretration we plot a single hyperparameter setting of EMaQ that tended to perform well across the 4 domains considered. The hyperparameters considered were $N = 2 0 0$ , $\lambda \in \{ 0 . 7 5 , \bar { 1 . 0 } \}$ , $\beta \in \{ 0 . 1 , 1 . 0 \}$ , $\tau \in \{ 1 , 5 , 1 0 , 2 0 \}$ . $_ \textrm { x }$ -axis unit is 1 million environment steps.
|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
Figure 3: Online RL results under different trajectory batch sizes.
|
| 500 |
+
Figure 4: All results for batch size 1
|
| 501 |
+
|
| 502 |
+
# G.2 EMAQ ABLATION EXPERIMENT
|
| 503 |
+
|
| 504 |
+
Hyperparameters are identical to those in Table 2, except batch size is 100 and number of updates is 500K.
|
| 505 |
+
|
| 506 |
+
# G.3 DETAILS FOR TABLE ?? EXPERIMENTS
|
| 507 |
+
|
| 508 |
+
Generative Model The generative models used are almost identical to the description in Appendix B, with a slight modification that $\mathbf { M L P } _ { i } ( d , a [ : i ] )$ is replace with $\begin{array} { r l } { \mathbf { M L P } _ { i } ( d , \mathrm { L i n } _ { i } ( a [ : i ] ) ) } & { { } } \end{array}$ where $\operatorname { L i n } _ { i }$ is a linear transformation. This change was not necessary for good performance; it was as architectural detail that we experimented with and did not revert prior generating Table ??. The model dimensions for each domain are shown in 3 in the following format (state embedding MLP hidden size, state embedding MLP number of layers, action MLP hidden size, action MLP number of layers, Ouput size of $\operatorname { L i n } _ { i }$ , number of bins for action discretization). Increasing the number of discretization bins from 40 (value for standard Mujoco experiments) to 80 was the most important change. Output dimension of state-embedding MLP is the same as the hidden size.
|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
Figure 5: All results for batch size 50K
|
| 512 |
+
|
| 513 |
+
Table 2: Hyperparameters for Mujoco Experiments
|
| 514 |
+
|
| 515 |
+
<table><tr><td rowspan=1 colspan=2>Shared Hyperparameters</td></tr><tr><td rowspan=1 colspan=1>入Batch SizeNum UpdatesNum Q FunctionsQ Architectureμlrα</td><td rowspan=1 colspan=1>1.02561e68MLP,3layers,75O hid dim,relu5e-40.995</td></tr><tr><td rowspan=1 colspan=1>EMa0</td><td rowspan=1 colspan=1>EMaQHyperparameters</td></tr><tr><td rowspan=1 colspan=1>Qlr</td><td rowspan=1 colspan=1>1e-4</td></tr><tr><td rowspan=1 colspan=1>BEA】</td><td rowspan=1 colspan=1>BEARHyperparameters</td></tr><tr><td rowspan=1 colspan=1>πArchitectureQlrπlr</td><td rowspan=1 colspan=1>MLP,3layers,750 hid dim,relu1e-33e-5</td></tr><tr><td rowspan=1 colspan=1>(BCQ</td><td rowspan=1 colspan=1>BCQHyperparameters</td></tr><tr><td rowspan=1 colspan=1>πArchitectureQlrπlr</td><td rowspan=1 colspan=1>MLP,3layers,750 hiddim,relu1e-45e-4</td></tr></table>
|
| 516 |
+
|
| 517 |
+
Hyperparameters Table 3 shows the hyperparameters used for the experiments in Table ??.
|
| 518 |
+
Table 3: Hyperparameters for Table 1 Experiments
|
| 519 |
+
|
| 520 |
+
<table><tr><td rowspan=1 colspan=2>Shared Hyperparameters</td></tr><tr><td rowspan=1 colspan=1>入Batch SizeNum UpdatesNum Q FunctionsQ ArchitectureαμlrKitchen μ Arch ParamsAntmaze μ Arch ParamsAdroit μ Arch Params</td><td rowspan=1 colspan=1>1.01281e616MLP, 4 layers, 256 hid dim, relu0.9955e-4(256,4,128,1,128,80)(256,4,128,1,128,80)(256,4,128,1,128,80)</td></tr><tr><td rowspan=1 colspan=1>EMaQH</td><td rowspan=1 colspan=1>EMaQ Hyperparameters</td></tr><tr><td rowspan=1 colspan=1>QlrKitchen N's SearchedAntmaze N's SearchedAdroitN's Searched</td><td rowspan=1 colspan=1>1e-4{4,8,16,32,64}{50,100,150,200}{16,32,64,128}</td></tr><tr><td rowspan=1 colspan=1>BEARH</td><td rowspan=1 colspan=1>BEAR Hyperparameters</td></tr><tr><td rowspan=1 colspan=1>πArchitectureQlrπlr</td><td rowspan=1 colspan=1>MLP, 4 layers,256 hid dim, relu1e-45e-4</td></tr><tr><td rowspan=1 colspan=1>BCQH</td><td rowspan=1 colspan=1>BCQHyperparameters</td></tr><tr><td rowspan=1 colspan=1>πArchitectureQlrπlr</td><td rowspan=1 colspan=1>MLP,4layers,256 hid dim,relu1e-45e-4</td></tr></table>
|
| 521 |
+
|
| 522 |
+

|
| 523 |
+
Figure 6: Results for evaluating EMaQ on D4RL (Fu et al., 2020b) benchmark domains when using the described VAE implementation, with $N \in \{ 5 , 1 0 , 2 5 , 5 0 , 1 0 0 , 2 0 0 , 4 0 0 \}$ . Values above $\mu ( a | s )$ represent the result of evaluating the base behavior policies. Horizontal green lines represent the reported performance of BEAR in the D4RL benchmark (apples to apples comparisons in Figure 7).
|
| 524 |
+
|
| 525 |
+
H VAE RESULTS
|
| 526 |
+
|
| 527 |
+
# H.1 IMPLEMENTATION
|
| 528 |
+
|
| 529 |
+
We also ran experiments with VAE parameterizations for $\mu ( a | s )$ . To be approximately matched in parameter count with our autoregressive models, the encoder and decoder both have 3 hidden layers of size 1024 with relu activations. The dimension of the latent space was twice the number of action dimensions. The decoder outputs a vector $v$ which, and the decoder action distribution is defined to be $\mathcal { N } ( \mathrm { T a n h } ( v ) , I )$ . When sampling from the VAE, following prior work, samples from the VAE prior (spherical normal distribution) were clipped to the range $[ - 0 . 5 , 0 . 5 ]$ and mean of the decoder distibution was used (i.e. the decoder distribution was not sampled from). The KL divergence loss term was weighted by 0.5. This VAE implementation was the one used in the benchmarking codebase of (Wu et al., 2019), so we did not modify it.
|
| 530 |
+
|
| 531 |
+
# H.2 RESULTS
|
| 532 |
+
|
| 533 |
+
As can be seen in Figure 6, EMaQ has a harder time improving upon $\mu ( a | s )$ when using the VAE architecture described above. However, as can be seen in Figure 7, BCQ and BEAR do show some variability as well when switching to the VAEs. Since as an algorithm EMaQ is much more reliant on $\mu ( a | s )$ , our hypothesis is that if it is true that the autoregressive models better captured the action distribution, letting EMaQ not make poor generalizations to out-of-distribution actions. Figures 8 and 9 show autoregressive and VAE results side-by-side for easier comparison.
|
| 534 |
+
|
| 535 |
+
# I EMAQ MEDIUM-EXPERT SETTING RESULTS
|
| 536 |
+
|
| 537 |
+
In HalfCheetah, increasing $N$ significantly slows down the convergence rate of the training curves; while large $N s$ continue to improve, we were unable to train them long enough for convergence. In Walker, for EMaQ, BCQ, and most hyperparameter settings of BEAR, training curves have a prototypical shape of a hump, where performance improves up to a certain high value, and then continues to fall very low. In Hopper, for higher values of $N$ in EMaQ we observed that increasing batch size from 100 to 256 largely resolved the poor performance, but for consistency we did not alter Figure 1 with these values.
|
| 538 |
+
|
| 539 |
+
# J COMPARISON WITH SOFTMAX BACKUP OPERATORS
|
| 540 |
+
|
| 541 |
+

|
| 542 |
+
Figure 7: Comparison of EMaQ, BCQ, and BEAR on D4RL (Fu et al., 2020b) benchmark domains when using when using the described VAE implementation for $\mu ( a | s )$ . For both BCQ and BEAR, from left to right the allowed deviation from $\mu ( a | s )$ increases. Horizontal green lines represent the reported performance of BEAR in the D4RL benchmark.
|
| 543 |
+
|
| 544 |
+
We thank one of our ICLR 2021 reviewers for the motivation for this section. For clarity of writing, we will write the forms for deterministic dynamics and remove the expectations over the next state.
|
| 545 |
+
|
| 546 |
+
An interesting connection to our proposed backup operators would be the following Softmax backup operator with similarities to EMaQ,
|
| 547 |
+
|
| 548 |
+
$$
|
| 549 |
+
\begin{array} { r l } & { T _ { \mu } ^ { \alpha } Q ( s , a ) : = r ( s , a ) + \mathbb { E } _ { s o f t ( a ^ { \prime } | s ^ { \prime } ) } [ Q ( s ^ { \prime } , a ^ { \prime } ) ] } \\ & { \ s o f t ( a | s ) \propto \mu ( a | s ) \cdot \exp ( \alpha \cdot Q ( s , a ) ) } \end{array}
|
| 550 |
+
$$
|
| 551 |
+
|
| 552 |
+
As suggested by our reviewer, the policy corresponding to $s o f t ( a | s )$ is a policy that aims to maximize Q-values, subject to a KL-constraint between itself and the policy $\mu ( a | s )$ . The looser the constraint, the larger the effective $\alpha$ and the farther the policy will be from $\mu$ . One approach to Monte Carlo estimation of the expectation on the right hand side could be to take samples using methods from the energy-based generative modelling literature.
|
| 553 |
+
|
| 554 |
+
An alternative approach which will more closely resembles EMaQ is to use self-normalized importance sampling,
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\begin{array} { r l } & { T _ { \mu } ^ { \alpha } Q ( s , a ) : = r ( s , a ) + \mathbb { E } _ { s o f t ( a ^ { \prime } | s ^ { \prime } ) } [ Q ( s ^ { \prime } , a ^ { \prime } ) ] } \\ & { \quad \quad \quad = r ( s , a ) + \quad \quad \quad \quad \quad \quad \quad w _ { i } \cdot Q ( s ^ { \prime } , a ^ { \prime } ) } \\ & { \quad \quad \quad \quad \{ a _ { i } \} ^ { N \sim \mu ( a ^ { \prime } | s ^ { \prime } ) } } \\ & { \quad \quad \quad \tilde { w } _ { i } = \frac { \mu ( a _ { i } ^ { \prime } | s ^ { \prime } ) \cdot \exp ( \alpha \cdot Q ( s ^ { \prime } , a _ { i } ^ { \prime } ) ) } { \mu ( a _ { i } ^ { \prime } | s ^ { \prime } ) } } \\ & { \quad \quad \quad \quad w _ { i } = \frac { \tilde { w } _ { i } } { \sum \tilde { w } _ { i } } } \\ & { \quad \quad \quad \quad = s o f t m a x ( \alpha \cdot Q ( s ^ { \prime } , a _ { i } ^ { \prime } ) ) [ i ] } \end{array}
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
In this form, the soft backup is similar to EMaQ, where instead of taking ths max Q-value over the N samples, we take an average over the N Q-values, weighted by the softmax probabilities in equation 73. For a given N, the $\alpha = 0$ would be equivalent to Q-evaluation of the policy $\mu ( a | s )$ , and as $\alpha \to \infty$ , the soft backups approach EMaQ backups.
|
| 561 |
+
|
| 562 |
+
In Figure 10 we present empirical results with the soft backup operators, under a large range $\alpha \in$ {1, 4, 8, 16, 32, 64, 128, 256, 512, 1024}, in the Halfcheetah settings. The EMaQ and soft-EMaQ were run with the same architectures, but were smaller than the ones used for the results in the main text. We used the same checkpoints of the generative models as for the results in the main text. The test-time policy for both approaches is the same, sampling $N$ actions and taking the argmax action under the ensemble Q-value. The only difference between the EMaQ and soft-EMaQ implementations was a one-line change to replace max with a softmax average of the Q-values.
|
| 563 |
+
|
| 564 |
+
Some interesting observations are the following: As anticipated, the soft EMaQ backups approach EMaQ as the value of $\alpha$ is increased. However, the necessary value of $\alpha$ to match the performance of EMaQ can be quite large. In the medium-expert setting, where figure 1 suggests challenges arising from the combination of large $N s$ and function-approximators, we did not gain much advantage from soft backups, and only $\alpha \in \{ 8 , 1 6 , 3 2 \}$ seem to have provided some mitigation of the problem for $N = 2 5$ . Since the soft backup introduces an additional hyperparameter that cannot be determined ahead of time, and does not seem to provide an advantage (at least in the limited Halfcheetah settings considered), from a practical perspective, we would prefer to use the regular EMaQ backup.
|
| 565 |
+
|
| 566 |
+
# K QUALITATIVE DIFFERENCES IN TRAINING CURVES
|
| 567 |
+
|
| 568 |
+
We have sometimes observed that the curves representing agent performance throughout training can be significantly more stable under EMaQ in comparison to BEAR and BCQ. A domain where the differences are particularly striking are the antmaze-umaze and antmaze-umaze-diverse domains. In figure 4 we have included plots of agent performance during training under the variety of considered hyperparameters and random seeds. It can be seen that in these two domains, initially the BCQ agents improves in performance close to the performance of EMaQ, and the drastically degrades with more training. In constrast, EMaQ agents remain stable even after twice as many training iterations as BCQ, which may indicate the downside of the heuristic perturbation model for constraining actions.
|
| 569 |
+
|
| 570 |
+

|
| 571 |
+
|
| 572 |
+
Table 4: Comparison of agent returns throughout training, under the variety of hyperparameters and and random seeds, in the small ant domains. We observe that EMaQ is significantly more stable than BCQ in these domains, even though the values of $N$ in EMaQ were fairly large for these plots $N \in \{ 5 0 , 1 0 0 , 1 5 0 , 2 0 0 \}$ .
|
| 573 |
+
|
| 574 |
+
# L LARGER PLOTS FOR VISIBILITY
|
| 575 |
+
|
| 576 |
+
Due to larger size of plots, each plot is shown on a separate page below. For ablation results, see Figure 11. For MuJoCo results, see Figure 12.
|
| 577 |
+
|
| 578 |
+

|
| 579 |
+
|
| 580 |
+

|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
|
| 584 |
+

|
| 585 |
+
|
| 586 |
+

|
md/train/BJe-_CNKPH/BJe-_CNKPH.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ATTENTION INTERPRETABILITY ACROSS NLP TASKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The attention layer in a neural network model provides insights into the model’s reasoning behind its prediction, which are usually criticized for being opaque. Recently, seemingly contradictory viewpoints have emerged about the interpretability of attention weights (Jain & Wallace, 2019; Vig & Belinkov, 2019). Amid such confusion arises the need to understand attention mechanism more systematically. In this work, we attempt to fill this gap by giving a comprehensive explanation which justifies both kinds of observations (i.e., when is attention interpretable and when it is not). Through a series of experiments on diverse NLP tasks, we validate our observations and reinforce our claim of interpretability of attention through manual evaluation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Attention is a way of obtaining a weighted sum of the vector representations of a layer in a neural network model (Bahdanau et al., 2015). It is used in diverse tasks ranging from machine translation (Luong et al., 2015), language modeling (Liu & Lapata, 2018) to image captioning (Xu et al., 2015), and object recognition (Ba et al., 2014). Apart from substantial performance benefit (Vaswani et al., 2017), attention also provides interpretability to neural models (Wang et al., 2016; Lin et al., 2017; Ghaeini et al., 2018) which are usually criticized for being black-box function approximators (Chakraborty et al., 2017).
|
| 12 |
+
|
| 13 |
+
There has been substantial work on understanding attention in neural network models. On the one hand, there is work on showing that attention weights are not interpretable, and altering them does not significantly affect the prediction (Jain & Wallace, 2019; Serrano & Smith, 2019). While on the other hand, some studies have discovered how attention in neural models captures several linguistic notions of syntax and coreference (Vig & Belinkov, 2019; Clark et al., 2019; Tenney et al., 2019). Amid such contrasting views arises a need to understand the attention mechanism more systematically. In this paper, we attempt to fill this gap by giving a comprehensive explanation which justifies both kinds of observations.
|
| 14 |
+
|
| 15 |
+
The conclusions of Jain & Wallace (2019); Serrano & Smith (2019) have been mostly based on text classification experiments which might not generalize to several other NLP tasks. In Figure 1, we report the performance on text classification, Natural Language Inference (NLI) and Neural Machine Translation (NMT) of two models: one trained with neural attention and the other trained with attention weights fixed to a uniform distribution. The results show that the attention mechanism in text classification does not have an impact on the performance, thus, making inferences about interpretability of attention in these models might not be accurate. However, on tasks such as NLI and NMT uniform attention weights degrades the performance substantially, indicating that attention is a crucial component of the model for these tasks and hence the analysis of attention’s interpretability here is more reasonable.
|
| 16 |
+
|
| 17 |
+
In comparison to the existing work on interpretability, we analyze attention mechanism on a more diverse set of NLP tasks that include text classification, pairwise text classification (such as NLI), and text generation tasks like neural machine translation (NMT). Moreover, we do not restrict ourselves to a single attention mechanism and also explore models with self-attention. For examining the interpretability of attention weights, we perform manual evaluation. Our key contributions are:
|
| 18 |
+
|
| 19 |
+
1. We extend the analysis of attention mechanism in prior work to diverse NLP tasks and provide a comprehensive picture which alleviates seemingly contradicting observations.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Comparison of performance with and without neural attention on text classification (IMDB), Natural Language Inference tasks (SNLI) and Neural Machine Translation (News Commentary). Here, $\alpha$ and $c$ denote attention weights and context vector respectively. The results show that attention does not substantially effect performance on text classification. However, the same does not hold for other tasks.
|
| 23 |
+
|
| 24 |
+
2. We identify the conditions when attention weights are interpretable and correlate with feature importance measures – when they are computed using two vectors which are both functions of the input (Figure 1b, c). We also explain why attention weights are not interpretable when the input has only single sequence (Figure 1a), an observation made by Jain & Wallace (2019), by showing that they can be viewed as a gating unit.
|
| 25 |
+
|
| 26 |
+
3. We validate our hypothesis of interpretability of attention through manual evaluation.
|
| 27 |
+
|
| 28 |
+
# 2 TASKS AND DATASETS
|
| 29 |
+
|
| 30 |
+
We investigate the attention mechanism on the following three task categories.
|
| 31 |
+
|
| 32 |
+
1. Single Sequence tasks are those where the input consists of a single text sequence. For instance, in sentiment analysis, the task is to classify a review as positive or negative. This also includes other text classification tasks such as topic categorization. For the experiments, in this paper, we use three review rating datasets: (1) Stanford Sentiment Treebank (Socher et al., 2013), (2) IMDB (Maas et al., 2011) and (3) Yelp $2 0 1 7 ^ { 1 }$ and one topic categorization dataset AG News Corpus (business vs world).2
|
| 33 |
+
|
| 34 |
+
2. Pair Sequence tasks comprise of a pair of text sequences as input. The tasks like NLI and question answering come under this category. NLI involves determining whether a hypothesis entails, contradicts, or is undetermined given a premise. We use Stanford Natural Language Inference (SNLI) (Bowman et al., 2015) and Multi-Genre Natural Language Inference (MultiNLI) (Williams et al., 2018) datasets for our analysis. For question answering, similar to Jain & Wallace (2019), we use CNN News Articles (Hermann et al., 2015) and three tasks of the original babI dataset (Weston et al., 2015) in our experiments, i.e., using one, two and three supporting statements as the context for answering the questions.
|
| 35 |
+
|
| 36 |
+
3. Generation tasks involve generating a sequence based on the input sequence. Neural Machine translation is an instance of generation task which comprises of translating a source text to a target language given translation pairs from a parallel corpus. For our experiments, we use three English-German datasets: Multi30k (Elliott et al., 2016), En-De News Commentary v11 from WMT16 translation task3 and full En-De WMT13 dataset.
|
| 37 |
+
|
| 38 |
+
# 3 NEURAL ATTENTION MODELS
|
| 39 |
+
|
| 40 |
+
In this section, we give a brief overview of the neural attention-based models we analyze for different categories of tasks listed in Section 2. The overall architecture for each category is shown in Fig 1.
|
| 41 |
+
|
| 42 |
+
# 3.1 SINGLE SEQUENCE MODELS:
|
| 43 |
+
|
| 44 |
+
For single sequence tasks, we adopt the model architecture from Jain & Wallace (2019); Wiegreffe & Pinter (2019). For a given input sequence $\pmb { x } \in \mathbb { R } ^ { T \times | V | }$ , where $T$ and $| V |$ are the number of tokens and vocabulary size, we first represent each token with its $d$ -dimensional GloVe embedding Pennington et al. (2014) to obtain $\pmb { x } _ { e } \in \mathbb { R } ^ { T \times d }$ . Next, we use a Bi-RNN encoder $\mathbf { ( E n c ) }$ to obtain an $m$ -dimensional contextualized representation of tokens: $\pmb { h } = \mathbf { E n c } ( \pmb { x } _ { e } ) \in \mathbb { R } ^ { T \times m }$ . Then, we use the additive formulation of attention proposed by Bahdanau et al. (2015) for computing attention weights $\alpha _ { i }$ for all tokens defined as:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
u _ { i } = \operatorname { t a n h } ( W h _ { i } + b ) ; \quad \alpha _ { i } = \frac { \exp ( { \boldsymbol { u } _ { i } ^ { T } { \boldsymbol { c } } } ) } { \sum _ { j } \exp ( { \boldsymbol { u } _ { j } ^ { T } { \boldsymbol { c } } } ) } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where repres $\boldsymbol { W } \in \mathbb { R } ^ { d ^ { \prime } \times m } , \boldsymbol { b } , \boldsymbol { c } \in \mathbb { R } ^ { d ^ { \prime } }$ arameters of the model. Finally, the weighted instanceis fed to a dense layer (Dec) followed by softmax to $\begin{array} { r } { \pmb { h } _ { \alpha } = \sum _ { i = 1 } ^ { T } \alpha _ { i } \pmb { h } _ { i } \in \mathbb { R } ^ { m } } \end{array}$ obtain prediction $\hat { y } = \sigma ( { \mathbf { D e c } } ( { \pmb { h } } _ { \alpha } ) ) \in \mathbb { R } ^ { | \mathcal { V } | }$ , where $| \mathcal { V } |$ denotes the label set size.
|
| 51 |
+
|
| 52 |
+
We also analyze the hierarchical attention model (Yang et al., 2016), which involves first computing attention over the tokens to obtain a sentence representation. This is followed by attention over sentences to obtain an instance representation $h _ { \alpha }$ , which is fed to a dense layer for obtaining prediction $\left( \hat { y } \right)$ . At both word and sentence level the attention is computed similar to as defined in Equation 1.
|
| 53 |
+
|
| 54 |
+
# 3.2 PAIR SEQUENCE MODELS:
|
| 55 |
+
|
| 56 |
+
For pair sequence, the input consists of two text sequences: $\pmb { x } \in \mathbb { R } ^ { T _ { 1 } \times | V | } , \pmb { y } \in \mathbb { R } ^ { T _ { 2 } \times | V | }$ of length $T _ { 1 }$ and $T _ { 2 }$ . In NLI, $_ { \textbf { \em x } }$ indicates premise and $\textbf { { y } }$ is hypothesis while in question answering, it is the question and paragraph respectively. Following Bowman et al. (2015), we use two separate RNNs for encoding both the sequences to obtain $\{ h _ { 1 } ^ { x } , . . . , h _ { T _ { 1 } } ^ { x } \}$ and $\{ h _ { 1 } ^ { y } , . . . , h _ { T _ { 2 } } ^ { y } \}$ . Now, similar to Jain & Wallace (2019), attention weight $\alpha _ { i }$ 1over each token of $_ { \textbf { \em x } }$ 2 is computed as:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
u _ { i } = \operatorname { t a n h } ( W _ { 1 } h _ { i } ^ { x } + W _ { 2 } h _ { T _ { 2 } } ^ { y } ) ; \quad \alpha _ { i } = \frac { \exp ( u _ { i } ^ { T } c ) } { \sum _ { j } \exp ( u _ { j } ^ { T } c ) } ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where similar to Equation 1, $W _ { 1 } , W _ { 2 } \in \mathbb { R } ^ { d \times d ^ { \prime } }$ denotes the projection matrices and $\boldsymbol { c } \in \mathbb { R } ^ { d ^ { \prime } }$ is a parameter vector. Finally, the representation obtained from a weighted sum of tokens in $_ { \textbf { \em x } }$ : $h _ { \alpha } =$ $\textstyle \sum _ { i = 1 } ^ { T } { \alpha _ { i } } h _ { i } ^ { x }$ is fed to a classifier for prediction.
|
| 63 |
+
|
| 64 |
+
We also explore a variant of the above attention proposed by Rocktaschel et al. (2016). Instead of ¨ keeping the RNN encoders of both the sequences independent, Rocktaschel et al. (2016) use condi- ¨ the model to obtain a conditional encoding unlike the previous model, attention over the tional encoding where the encoder of is initialized with the final state of $\{ h _ { 1 } ^ { \prime y } , . . . , h _ { T _ { 2 } } ^ { \prime y } \}$ of de $\textbf { { y } }$ given the sequence ed as follows: $_ { \textbf { \em x } }$ ’s encoder. This allows $_ { \textbf { \em x } }$ . Moreover, $_ { \textbf { \em x } }$
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
M = \operatorname { t a n h } ( W _ { 1 } X + W _ { 2 } h _ { T _ { 2 } } ^ { \prime y } \otimes e _ { T _ { 1 } } ) ; \quad \alpha = \operatorname { s o f t m a x } ( { \pmb w } ^ { T } M ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where ${ \pmb X } = [ { \pmb h } _ { 1 } ^ { x } , . . . , { \pmb h } _ { T _ { 1 } } ^ { x } ]$ , $\boldsymbol { e } _ { T _ { 1 } } \in \mathbb { R } ^ { T _ { 1 } }$ is a vector of ones and outer product ${ \cal W } _ { 2 } h _ { T _ { 2 } } ^ { \prime y } \otimes e _ { T _ { 1 } }$ denotes repeating linearly transformed $h _ { T _ { 2 } } ^ { \prime y }$ as many times as words in the sequence $_ { \textbf { \em x } }$ (i.e. $T _ { 1 }$ times).
|
| 71 |
+
|
| 72 |
+
# 3.3 GENERATION TASK MODELS:
|
| 73 |
+
|
| 74 |
+
In this paper, for generation tasks, we focus on Neural Machine Translation (NMT) problem which involves translating a given source text sentence $\pmb { x } \in \mathbb { R } ^ { T _ { 1 } \times | V _ { 1 } | }$ to a sequence $\pmb { y } ^ { \mathrm { ~ ~ } } \in \mathbb { R } ^ { T _ { 2 } \times | V _ { 2 } | }$ in the target language. The model comprises of two components: (a) an encoder which computes a representation for each source sentence and (b) a decoder which generates a target word at each time step. In this work, we utilize RNN based encoder and decoder models. For each input sentence $_ { \textbf { \em x } }$ , we first obtain a contextualized representation $\{ h _ { 1 } , . . . , h _ { T _ { 1 } } \}$ of its tokens using a multi-layer Bi-RNN. Then, at each time step $t$ , the decoder has a hidden state defined as
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\pmb { c } _ { t } = f ( \pmb { c } _ { t - 1 } , y _ { t - 1 } , \pmb { h } _ { \alpha } ^ { t } ) , \mathrm { w h e r e } \pmb { h } _ { \alpha } ^ { t } = \sum _ { i = 1 } ^ { T _ { 1 } } \alpha _ { t , i } \pmb { h } _ { i } .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
In our work, we compute $\alpha _ { t , i }$ as proposed by Bahdanau et al. (2015) and Luong et al. (2015). The former computes attention weights using a feed-forward network, i.e., $\alpha _ { t , i } = { w } ^ { T } \mathrm { t a n h } ( { W } [ { c } _ { t } ; h _ { i } ] )$ while the latter define it simply as $\alpha _ { t , i } = \pmb { c } _ { t } ^ { T } h _ { i }$ .
|
| 81 |
+
|
| 82 |
+
# 3.4 SELF-ATTENTION BASED MODELS:
|
| 83 |
+
|
| 84 |
+
We also examine self-attention based models on all three categories of tasks. For single and pair sequence tasks, we fine-tune pre-trained BERT (Devlin et al., 2019) model on the downstream task. In pair sequence tasks, instead of independently encoding each text, we concatenate both separated by a delimiter and pass it to BERT model. Finally, the embedding corresponding to [CLS] token is fed to a feed-forward network for prediction. For neural machine translation, we use Transformer model proposed by Vaswani et al. (2017) with base configuration.
|
| 85 |
+
|
| 86 |
+
# 4 IS ATTENTION AN EXPLANATION?
|
| 87 |
+
|
| 88 |
+
In this section, we attempt to address the question: Is attention an explanation? through a series of experiments which involve analyzing attention weights in a variety of models (§3) on multiple tasks (§2). Following Jain & Wallace (2019), we take the definition of explainability of attention as: inputs with high attention weights are responsible for model output. Jain & Wallace (2019); Serrano & Smith (2019) have extensively investigated this aspect for certain class of problems and have shown that attention does not provide an explanation. However, another series of work (Vig & Belinkov, 2019; Clark et al., 2019; Tenney et al., 2019) has shown that attention does encode several linguistic notions. In our work, we claim that the findings of both the line of work are consistent. We note that the observations of the former works can be explained based on the following proposition.
|
| 89 |
+
|
| 90 |
+
Proposition 4.1. Attention mechanism as defined in Equation 1 as
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
{ \pmb u } _ { i } = \operatorname { t a n h } ( { \pmb W } { \pmb h } _ { i } + { \pmb b } ) ; \quad \alpha _ { i } = \frac { \exp ( { \pmb u } _ { i } ^ { T } { \pmb c } ) } { \sum _ { j } \exp ( { \pmb u } _ { j } ^ { T } { \pmb c } ) }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
for single sequence tasks can be interpreted as a gating unit in the network.
|
| 97 |
+
|
| 98 |
+
Proof: The attention weighted averaging computed in Equation 1 for single sequence tasks can be interpreted as gating proposed by Dauphin et al. (2017) which is defined as
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
h ( { \pmb x } ) = f ( { \pmb x } ) \times \sigma ( g ( { \pmb x } ) ) ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $\pmb { x } \in \mathbb { R } ^ { m }$ is the input and $\times$ denotes product between transformed input $f ( \pmb { x } ) \in \mathbb { R } ^ { m }$ and its computed gating scores $\sigma ( \ b { g } ( \pmb { x } ) ) \in \mathbb { R }$ . Equation 1 can be reduced to the above form by taking $f$ as an identity function and defining $g ( \pmb { x } ) \overset { \cdot } { = } c ^ { T } \mathrm { t a n h } ( \pmb { W } \pmb { x } + \pmb { b } ) \in \mathbb { R }$ and replacing $\sigma$ with softmax. We note that the same reduction does not hold in the case of pair sequence and generation tasks where attention along with input also depends on another text sequence $\mathbf { Y }$ and current hidden state $\mathbf { } _ { c _ { t } }$ , respectively. Thus, attention mechanism for these tasks take the form
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
h ( x , y ) = f ( x ) \times \sigma ( g ( x , y ) ) ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
which does not reduce to the above equation for gating unit.
|
| 111 |
+
|
| 112 |
+
<table><tr><td></td><td>SST</td><td>IMDB</td><td>AG News</td><td>YELP</td></tr><tr><td>Bahdanau et al. (2015)</td><td>83.4± 0.5</td><td>90.7± 0.7</td><td>96.4± 0.1</td><td>66.7± 0.1</td></tr><tr><td>Uniform (Train+Infer /Infer)</td><td>-1.0/-0.8</td><td>-0.8/-6.3</td><td>-0.1/-0.7</td><td>-0.5/-6.3</td></tr><tr><td>Random (Train+Infer /Infer)</td><td>-1.1/-0.9</td><td>-0.6/-6.4</td><td>-0.0/-0.7</td><td>-0.4/-6.4</td></tr><tr><td>Permute (Infer)</td><td>-1.7</td><td>-5.1</td><td>-0.9</td><td>-7.8</td></tr><tr><td>Yang et al. (2016)</td><td>83.2± 0.5</td><td>89.7± 0.6</td><td>96.1 ± 0.2</td><td>65.8 ± 0.1</td></tr><tr><td>Uniform (Train+Infer /Infer)</td><td>-1.0/-0.8</td><td>+0.2/-6.5</td><td>+0.1/-1.5</td><td>-0.7/-8.0</td></tr><tr><td>Random(Train+Infer /Infer)</td><td>-0.9/-1.0</td><td>-1.2/-8.2</td><td>-0.1/-1.8</td><td>-3.0/-10.2</td></tr><tr><td>Permute (Infer)</td><td>-1.8</td><td>-5.1</td><td>-0.7</td><td>-10.7</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 1: Evaluation results on single sequence tasks. We report the base performance of attention models and absolute change in accuracy for its variant. We note that across all datasets, degradation in performance on altering attention weights during inference is more compared to varying them during both training and inference. Overall, the change in performance is less compared to other tasks. Please refer to $\ S 4 . 1$ for more details.
|
| 115 |
+
|
| 116 |
+
Based on the above proposition, we argue that weights learned in single sequence tasks cannot be interpreted as attention, and therefore, they do not reflect the reasoning behind the model’s prediction. This justifies the observation that for the single sequence tasks examined in Jain & Wallace (2019); Serrano & Smith (2019), attention weights do not correlate with feature importance measures and permuting them does not change the prediction of the model. In light of this observation, we revisit the explainability of attention weights by asking the following questions.
|
| 117 |
+
|
| 118 |
+
4.1 HOW DOES ALTERING ATTENTION WEIGHTS AFFECT MODEL OUTPUT ON TASKS?
|
| 119 |
+
|
| 120 |
+
In this section, we compare the performance of various attention mechanism described in $\ S 3$ for different categories of tasks listed in $\ S 2$ . For each model, we analyze its three variants defined as:
|
| 121 |
+
|
| 122 |
+
• Uniform denotes the case when all the inputs are given equal weights, i.e., $\alpha _ { i } = 1 / T , \forall i \in$ $\{ 1 , . . . , T \}$ . This is similar to the analysis performed by Wiegreffe & Pinter (2019). However, we consider two scenarios when the weights are kept fixed both during training and inference (Train+Infer) and only during inference (Infer).
|
| 123 |
+
• Random refers to the variant where all the weights are randomly sampled from a uniform distribution: $\alpha _ { i } \sim U ( 0 , 1 )$ , $\forall i \in \{ 1 , . . . , T \}$ , this is followed by normalization. Similar to Uniform, we analyze both Train+Infer and Infer.
|
| 124 |
+
• Permute refers to the case when the learned attention weights are randomly permuted during inference, i.e., $\pmb { \alpha } = \mathrm { s h u f f e } ( \pmb { \alpha } )$ . Unlike the previous two, here we restrict our analysis to only permuting during inference as Tensorflow currently does not support backpropagation with shuffle operation.4
|
| 125 |
+
|
| 126 |
+
Effect on single sequence tasks: The evaluation results on single sequence datasets: SST, IMDB, AG News, and YELP are presented in Table 1. We observe that Train+Infer case of Uniform and Random attentions gives around 0.5 and 0.9 average decrease in accuracy compared to the base model. However, in Infer scenario the degradation on average increases to 3.9 and 4.5 absolute points respectively. This is so because the model becomes more robust to handle altered weights in the former case. The reduction in performance from Permute comes around to 4.2 across all datasets and models. The results support the observation of Jain & Wallace (2019); Serrano & Smith (2019) that alternating attention in text classification task does not have much effect on the model output. The slight decrease in performance can be attributed to corrupting the existing gating mechanism which has been shown to give some improvement (Oord et al., 2016; Dauphin et al., 2017; Marcheggiani & Titov, 2017).
|
| 127 |
+
|
| 128 |
+
Effect on pair sequence and generation tasks: The results on pair sequence and generation tasks are summarized in Table 2 and 3, respectively. Overall, we find that the degradation in performance from altering attention weights in case of pair sequence and generation tasks is much more substantial than single sequence tasks. For instance, in Uniform (Train+Infer), the average relative decrease in performance of single sequence tasks is $0 . 1 \%$ whereas in case of pair sequence and generation tasks it is $4 9 . 5 \%$ and $5 1 . 2 \%$ respectively. The results thereby validate our Proposition 4.1 and show that altering attention does affect model output for a task where the attention layer cannot be modeled as a gating unit in the network.
|
| 129 |
+
|
| 130 |
+
Table 2: The performance comparison of attention based models and their variants on pair sequence tasks. We find that the degradation in performance is much more than single sequence tasks.
|
| 131 |
+
|
| 132 |
+
<table><tr><td></td><td>SNLI</td><td>MultiNLI</td><td>CNN</td><td>babI 0</td><td>babI1</td><td>babI2</td></tr><tr><td>Bahdanau et al. (2015)</td><td>75.7± 0.3</td><td>61.1 ± 0.1</td><td>63.4±0.8</td><td>96.1 ± 4.3</td><td>95.8 ±0.3</td><td>92.8± 0.1</td></tr><tr><td>Uniform (Train+Infer Infer)</td><td>-41.8/-42.9</td><td>-26.6/-28.7</td><td>-30.8/-55.9</td><td>-44.4/-63.4</td><td>-47.4/-60.4</td><td>-48.4/-62.1</td></tr><tr><td>Random (Train+Infer /Infer)</td><td>-41.6 /-43.1</td><td>-26.7/-28.6</td><td>-30.9/-55.9</td><td>-45.0/-62.0</td><td>-47.3/-60.4</td><td>-49.9/-62.2</td></tr><tr><td>Permute (Infer)</td><td>-41.0</td><td>-27.6</td><td>-54.8</td><td>-67.8</td><td>-68.3</td><td>-66.7</td></tr><tr><td>Rocktäschel et al.(2016)</td><td>78.1±0.2</td><td>62.4± 0.6</td><td>63.6±0.6</td><td>98.6±1.6</td><td>96.2±0.9</td><td>93.2± 0.1</td></tr><tr><td>Uniform (Train+Infer/Infer)</td><td>-44.2/-45.4</td><td>-27.5/-30.3</td><td>-30.8/-43.1</td><td>−47.7/-67.8</td><td>-47.9/-62.8</td><td>-49.8/-60.9</td></tr><tr><td>Random (Train+Infer /Infer)</td><td>-44.3/-44.9</td><td>-27.9/-28.3</td><td>-30.6/-43.3</td><td>-47.5/-64.9</td><td>-48.4/-63.3</td><td>-49.8/-60.9</td></tr><tr><td>Permute (Infer)</td><td>-41.7</td><td>-29.2</td><td>-44.9</td><td>-68.8</td><td>-68.3</td><td>-65.2</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Table 3: Evaluation results on neural machine translation. Similar to pair sequence tasks, we find that the deterioration in performance is much more substantial than single sequence tasks. Please refer to $\ S 4 . 1$ for more details.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Dataset</td><td>Multi30k</td><td>News Commentary</td></tr><tr><td>Bahdanau et al. (2015)</td><td>31.3 ± 0.1</td><td>12.6 ± 0.1</td></tr><tr><td>Uniform (Train+Infer /Infer)</td><td>-10.4/-29.4</td><td>-8.7/-11.8</td></tr><tr><td>Random (Train+Infer /Infer)</td><td>-10.1/-29.4</td><td>-8.8/-11.9</td></tr><tr><td>Permute (Infer)</td><td>-29.7</td><td>-12.1</td></tr><tr><td>Luong et al. (2015)</td><td>31.5 ± 0.2</td><td>12.7 ± 0.2</td></tr><tr><td>Uniform (Train+Infer /Infer)</td><td>-10.6/-29.7</td><td>-8.8 /-12.0</td></tr><tr><td>Random (Train+Infer /Infer)</td><td>-10.3/-29.8</td><td>-8.9 /-12.0</td></tr><tr><td>Permute (Infer)</td><td>-30.1</td><td>-12.2</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Visualizing the effect of permuting attention weights: To further reinforce our claim, similar to Jain & Wallace (2019), we report the median of Total Variation Distance (TVD) between new and original prediction on permuting attention weights for each task. The TVD between two predictions $\hat { y } _ { 1 }$ and asses $\hat { y } _ { 2 }$ is defined as: the problem. $\begin{array} { r } { \mathrm { T V D } ( \hat { y _ { 1 } } , \hat { y } _ { 2 } ) = \frac { 1 } { 2 } \sum _ { i = 1 } ^ { | \bar { y } | } | \hat { y } _ { 1 i } - \hat { y } _ { 2 i } | } \end{array}$ , where nge in o $| \mathcal { V } |$ denotes the total number ofut distribution on permuting the attention weights. In Figure 2, we report the relationship between the maximum attention value and the median induced change in model output over 100 permutations on all categories of tasks. For NMT task, we present change in output at the 25th-percentile length of sentences for both datasets. Overall, we find that for single sequence tasks even with the maximum attention weight in range [0.75, 1.0], the change in prediction is considerably small (the violin plots are to the left of the figure) compared to the pair sequence and generation tasks (the violin plots are to the right of the figure).
|
| 139 |
+
|
| 140 |
+
# 4.2 DO ATTENTION WEIGHTS CORRELATE WITH FEATURE IMPORTANCE MEASURES?
|
| 141 |
+
|
| 142 |
+
In this section, similar to the analysis of Serrano & Smith (2019), we investigate the importance of attention weights only when one weight is removed. Let $i ^ { * }$ be the input corresponding to the highest attention weights and let $r$ be any randomly selected input. We denote the original model’s prediction as $\pmb { p }$ and output after removing $i ^ { * }$ and $r$ input as ${ \pmb q } _ { \{ i ^ { * } \} }$ and $\pmb q _ { \{ r \} }$ respectively. Now, to measure the impact of removing $i ^ { * }$ relative to any randomly chosen input $r$ on the model output, we compute the difference of Jensen-Shannon (JS) divergence between $\mathrm { J S } ( p , q _ { \{ i ^ { * } \} } )$ and $\mathrm { J S } ( \pmb { p } , \pmb { q } _ { \{ r \} } )$ given as: $\Delta \mathrm { J S } = \mathrm { J S } ( p , q _ { \{ i ^ { * } \} } ) - \mathrm { J S } ( p , q _ { \{ r \} } )$ . The relationship between the difference of attention weights corresponding to $i ^ { * }$ and $r$ , i.e., $\alpha _ { i ^ { * } } - \alpha _ { r }$ and $\Delta \mathrm { J S }$ for different tasks is presented in Figure 3. In general, we found that for single sequence tasks, the change JS divergence is small even for cases when the difference in attention weight is considerable. However, for pair sequence and generation tasks, there is a substantial change in the model output.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Relationship between maximum attention weight and median change in output on permuting attention weights. For single sequence tasks, indicate negative and positive class. For MultiNLI, , denotes contradiction, entailment and neutral respectively. The results reinforce the claim that altering attention weights in single sequence tasks does not have much effect on performance while the same does not hold with other tasks. Refer to $\ S 4 . 1$ for details.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: Analysis of correlation between attention weights and feature importance measure. We report relationship between difference in zeroed attention weights and corresponding change in $J S$ divergence for different tasks. Please refer to $\ S 4 . 2$ for more details.
|
| 149 |
+
|
| 150 |
+
# 4.3 HOW PERMUTING DIFFERENT LAYERS OF SELF-ATTENTION BASED MODELS AFFECT PERFORMANCE?
|
| 151 |
+
|
| 152 |
+
In this section, we analyze the importance of attention weights on the performance of self-attention based models as described in $\ S 3 . 4$ . We report the accuracy on single, and pair sequence tasks and BLEU score for NMT on WMT13 dataset on permuting the attention weights of layers cumulatively. For Transformer model, we analyze the effect of altering attention weights in encoder, decoder, and across encoder-decoder (denoted by Across). The results are presented in Figure 4. Overall, we find that unlike the pattern observed in $\ S 4 . 1$ and $\ S 4 . 2$ for single sequence tasks, altering weights in self-attention based models does have a substantial effect on the performance. We note that this is because while computing attention weights over all tokens with respect to a given token, Proposition 4.1 does not hold. Thus, altering them does have an impact across all three tasks. We note that in the case of transformer model, altering the weights in the first step of Decoder and in Across has maximum effect as it almost stops the flow of information from encoder to decoder.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 4: Performance comparison with permuting attention weights for different layers in selfattention based models. The results are reported on a representative instance of single sequence, pair sequence and generation tasks. The dotted lines denote the base performance on the task. Refer to $\ S 4 . 3$ for details.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 5: Manual evaluation of interpretability of attention weights on single and pair sequence tasks. Although with original weights the attention does remain interpretable on both tasks but in the case of single sequence tasks making it meaningless does not change the prediction substantially. However, the same does not hold with pair sequence tasks.
|
| 159 |
+
|
| 160 |
+
# 4.4 ARE ATTENTION WEIGHTS HUMAN INTERPRETABLE?
|
| 161 |
+
|
| 162 |
+
To determine if attention weights are human interpretable, here, we address the question of interpretability of attention weights by manually analyzing them on a representative dataset of single and pair sequence task. For each task, we randomly sample 100 samples with original attention weights and 100 with randomly permuted weights. Then, we shuffle all 200 samples together and present them to annotators for deciding whether the top three highest weighted words are relevant for the model’s prediction.
|
| 163 |
+
|
| 164 |
+
The overall results are reported in Figure 5. Cohen’s kappa score of inter-annotator agreement (Cohen, 1960) on IMDB and babI is 0.84 and 0.82, respectively, which shows near-perfect agreement (Landis & Koch, 1977). We find that in both single and pair sequence tasks, the attention weights in samples with original weights do make sense in general (highlighted with blue color). However, in the former case, the attention mechanism learns to give higher weights to tokens relevant to both kinds of sentiment. For instance, in “This is a great movie. Too bad it is not available on home video.”, tokens great, too, and bad get the highest weight. Such examples demonstrate that the attention mechanism in single sequence tasks works like a gating unit, as shown in $\ S 4 . 1$ .
|
| 165 |
+
|
| 166 |
+
For permuted samples, in the case of single sequence, the prediction remains correct in majority although the attention weights were meaningless. For example, in “This movie was terrible . the acting was lame , but it ’s hard to tell since the writing was so bad .”, the prediction remains the same on changing attention weights from underlined to bold tokens. However, this does not hold with the pair sequence task. This shows that attention weights in single sequence tasks do not provide a reason for the prediction, which in the case of pairwise tasks, attention do reflect the reasoning behind model output.
|
| 167 |
+
|
| 168 |
+
# 5 CONCLUSION
|
| 169 |
+
|
| 170 |
+
In this paper, we addressed the seemingly contradictory viewpoint over explainability of attention weights in NLP. On the one hand, some works have demonstrated that attention weights are not interpretable, and altering them does not affect the model output while several others have shown that attention captures several linguistic notions in the model. We extend the analysis of prior works to diverse NLP tasks and demonstrate that attention weights are interpretable and are correlated with feature importance measures. However, this holds only for cases when attention weights are essential for model’s prediction and cannot simply be reduced to a gating unit. Through a battery of experiments, we validate our claims and reinforce them through manual evaluation.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. In Proc. of ICLR, 2014.
|
| 175 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015.
|
| 176 |
+
Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A large annotated corpus for learning natural language inference. In Proc. of EMNLP, 2015.
|
| 177 |
+
S. Chakraborty, R. Tomsett, R. Raghavendra, D. Harborne, M. Alzantot, F. Cerutti, M. Srivastava, A. Preece, S. Julier, R. M. Rao, T. D. Kelley, D. Braines, M. Sensoy, C. J. Willis, and P. Gurram. Interpretability of deep learning models: A survey of results. In Proc. of UbiComp, 2017.
|
| 178 |
+
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of bert’s attention. In Proc. of BlackBoxNLP, 2019.
|
| 179 |
+
J. Cohen. A Coefficient of Agreement for Nominal Scales. Educational and Psychological Measurement, 20(1):37, 1960.
|
| 180 |
+
Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Proc. of ICML, 2017.
|
| 181 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proc. of NAACL, 2019.
|
| 182 |
+
Desmond Elliott, Stella Frank, Khalil Sima’an, and Lucia Specia. Multi30k: Multilingual englishgerman image descriptions. In Proc of the 5th Workshop on Vision and Language, 2016.
|
| 183 |
+
Reza Ghaeini, Xiaoli Z. Fern, and Prasad Tadepalli. Interpreting recurrent and attention-based neural models: a case study on natural language inference. In Proc. of EMNLP, 2018.
|
| 184 |
+
Karl Moritz Hermann, Toma´s Ko ˇ cisk ˇ y, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa ´ Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Proc. of NIPS, 2015.
|
| 185 |
+
Sarthak Jain and Byron C. Wallace. Attention is not Explanation. In Proc. of ACL, 2019.
|
| 186 |
+
J. Richard Landis and Gary G. Koch. The measurement of observer agreement for categorical data. Biometrics, 33(1), 1977.
|
| 187 |
+
Zhouhan Lin, Minwei Feng, C´ıcero Nogueira dos Santos, Mo Yu, Bing Xiang, Bowen Zhou, and Yoshua Bengio. A structured self-attentive sentence embedding. In Proc. of ICLR, 2017.
|
| 188 |
+
Yang Liu and Mirella Lapata. Learning structured text representations. Transactions of the Association for Computational Linguistics, 6:63–75, 2018. ISSN 2307-387X.
|
| 189 |
+
Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attention-based neural machine translation. In Proc. of EMNLP, 2015.
|
| 190 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proc. of ACL, 2011.
|
| 191 |
+
|
| 192 |
+
Diego Marcheggiani and Ivan Titov. Encoding sentences with graph convolutional networks for semantic role labeling. In Proc. of EMNLP, 2017.
|
| 193 |
+
|
| 194 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray ¨ Kavukcuoglu. Conditional image generation with pixelcnn decoders. In Proc. of NIPS, 2016.
|
| 195 |
+
|
| 196 |
+
Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In Proc. of EMNLP, 2014.
|
| 197 |
+
|
| 198 |
+
Tim Rocktaschel, Edward Grefenstette, Karl Moritz Hermann, Tomas Kocisky, and Phil Blunsom. ¨ Reasoning about entailment with neural attention. In Proc. of ICLR, 2016.
|
| 199 |
+
|
| 200 |
+
Sofia Serrano and Noah A. Smith. Is attention interpretable? In Proc. of ACL, 2019.
|
| 201 |
+
|
| 202 |
+
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 Proc. of EMNLP, 2013.
|
| 203 |
+
|
| 204 |
+
Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT rediscovers the classical NLP pipeline. In Proc. of ACL, 2019.
|
| 205 |
+
|
| 206 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proc. of NIPS, 2017.
|
| 207 |
+
|
| 208 |
+
Jesse Vig and Yonatan Belinkov. Analyzing the structure of attention in a transformer language model. In Proc. of BlackBoxNLP, 2019.
|
| 209 |
+
|
| 210 |
+
Yequan Wang, Minlie Huang, Xiaoyan Zhu, and Li Zhao. Attention-based LSTM for aspect-level sentiment classification. In Proc. of EMNLP, 2016.
|
| 211 |
+
|
| 212 |
+
Jason Weston, Antoine Bordes, Sumit Chopra, and Tomas Mikolov. Towards ai-complete question answering: A set of prerequisite toy tasks. In Proc. of ICLR, 2015.
|
| 213 |
+
|
| 214 |
+
Sarah Wiegreffe and Yuval Pinter. Attention is not not explanation. In Proc. of EMNLP, 2019.
|
| 215 |
+
|
| 216 |
+
Adina Williams, Nikita Nangia, and Samuel Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Proc. of NAACL, 2018.
|
| 217 |
+
|
| 218 |
+
Kelvin Xu, Jimmy Lei Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Proc. of ICML, 2015.
|
| 219 |
+
|
| 220 |
+
Zichao Yang, Diyi Yang, Chris Dyer, Xiaodong He, Alex Smola, and Eduard Hovy. Hierarchical attention networks for document classification. In Proc. of NAACL, 2016.
|
md/train/BJe4oxHYPB/BJe4oxHYPB.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WINNING THE LOTTERY WITH CONTINUOUS SPARSIFICATION
|
| 2 |
+
|
| 3 |
+
# Anonymous authors
|
| 4 |
+
|
| 5 |
+
Paper under double-blind review
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
The Lottery Ticket Hypothesis from Frankle & Carbin (2019) conjectures that, for typically-sized neural networks, it is possible to find small sub-networks which train faster and yield superior performance than their original counterparts. The proposed algorithm to search for “winning tickets”, Iterative Magnitude Pruning, consistently finds sub-networks with $9 0 - 9 5 \%$ less parameters which train faster and better than the overparameterized models they were extracted from, creating potential applications to problems such as transfer learning.
|
| 10 |
+
|
| 11 |
+
In this paper, we propose Continuous Sparsification, a new algorithm to search for winning tickets which continuously removes parameters from a network during training, and learns the sub-network’s structure with gradient-based methods instead of relying on pruning strategies. We show empirically that our method is capable of finding tickets that outperforms the ones learned by Iterative Magnitude Pruning, and at the same time providing faster search, when measured in number of training epochs or wall-clock time.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Although deep neural networks have become ubiquitous in fields such as computer vision and natural language processing, extreme overparameterization is typically required to achieve state-ofthe-art results (Xie et al., 2017; Devlin et al., 2018), causing higher training costs and hindering applications where memory or inference time are constrained. Recent theoretical work suggest that overparameterization plays a key role in both the capacity and generalization of a network (Neyshabur et al., 2018), and in training dynamics (Allen-Zhu et al., 2019). However, it remains unclear whether overparameterization is truly necessary to train networks to state-of-the-art performance.
|
| 16 |
+
|
| 17 |
+
At the same time, empirical approaches have been successful in finding less overparameterized neural networks, either by reducing the network after training (Han et al., 2015; 2016) or through more efficient architectures that can be trained from scratch (Iandola et al., 2016). Recently, the combination of these two approaches lead to new methods which discover efficient architectures through optimization instead of design (Liu et al., 2019; Savarese & Maire, 2019). Nonetheless, parameter efficiency is typically maximized by pruning an already trained network.
|
| 18 |
+
|
| 19 |
+
The fact that pruned networks are hard to train from scratch (Han et al., 2015; 2016) suggests that, while overparameterization is not necessary for a model’s capacity, it might be required for successful network training. Recently, this idea has been put into question by Frankle & Carbin (2019), where heavily pruned networks are trained faster than their original counterparts, often yielding superior performance.
|
| 20 |
+
|
| 21 |
+
A key finding is that the same parameter initialization should be used when re-training the pruned network. A winning ticket, defined by a sub-network and a setting of randomly-initialized parameters, is quickly trainable and has already found applications in, for example, transfer learning (Morcos et al., 2019; Mehta, 2019; Soelen & Sheppard, 2019), making the search for winning tickets a problem of independent interest.
|
| 22 |
+
|
| 23 |
+
Currently, the standard algorithm to find winning tickets is Iterative Magnitude Pruning (IMP) (Frankle & Carbin, 2019; Frankle et al., 2019), which consists of a repeating a 2-stage procedure that alternates between parameter optimization and pruning. As a result, IMP relies on a sensible choice for pruning strategy, and is time-consuming: finding a winning ticket with $1 \%$ of the original parameters in a 6-layer CNN requires over 20 rounds of training followed by pruning, totalling over 1000 epochs (Frankle & Carbin, 2019). Choosing a parameter’s magnitude as pruning criterion has also shown to be sub-optimal in some settings (Zhou et al., 2019), leading to the question of whether better winning tickets can be found by different pruning methods. Moreover, at each iteration, IMP resets the parameters of the network back to initialization, hence considerable time is spent on re-training similar networks with different sparsities.
|
| 24 |
+
|
| 25 |
+
With the goal of speeding up the search for winning tickets in deep neural networks, we design a novel method, Continuous Sparsification, which continuously removes weights from a network during training, instead of following a strategy to prune parameters at discrete time intervals. Unlike IMP, our method approaches the search for sparse networks as a $\ell _ { 0 }$ -regularized optimization problem (Louizos et al., 2017), resulting in a method that can be fully described in the optimization framework. To approximate $\ell _ { 0 }$ -regularization, we propose a smooth re-parameterization, allowing for the subnetwork’s structure to be directly learned with gradient-based methods. Unlike previous works, our re-parameterization is deterministic, proving more convenient for the tasks of pruning and ticket search, while also yielding faster training times.
|
| 26 |
+
|
| 27 |
+
Experimentally, our method offers superior performance when pruning VGG to extreme regimes, and is capable of finding winning tickets in Residual Networks trained on CIFAR-10 at a fraction of time taken by Iterative Magnitude Pruning. In particular, Continuous Sparsification successfully finds tickets in under 5 iterations, compared to 20 iterations required by Iterative Magnitude Pruning in the same setting. To further speed up the search for sub-networks, our method abdicates parameter rewinding, a key ingredient of Iterative Magnitude Pruning. By showing superior results without rewinding, our experiments offer insights on how ticket search should be performed.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
# 2.1 LOTTERY TICKET HYPOTHESIS
|
| 32 |
+
|
| 33 |
+
The Lottery Ticket Hypothesis (Frankle & Carbin, 2019) states that for a network $f ( x ; w )$ , $w \in \mathbb { R } ^ { d }$ , and randomly-initialized parameters $w _ { 0 } \sim \mathcal { D }$ , there exists a sparse sub-network, defined by a configuration $m \in \{ 0 , 1 \} ^ { d }$ , $\| m \| _ { 0 } \ll d$ , that, when trained from scratch, achieves higher performance than $f ( x ; w )$ while requiring fewer training iterations. The authors support this conjecture experimentally, showing that such sub-networks indeed exist: in particular, they can be discovered by repeatedly training, pruning, and re-initializing the network, through a procedure named Iterative Magnitude Pruning (IMP; Algorithm 1) (Frankle et al., 2019). More specifically, IMP alternates between: (1) training the weights $w$ of a network, (2) removing a fixed fraction of the weights with the smallest magnitude (pruning), and (3) rewinding: setting the remaining weights back to their original initialization $w _ { 0 }$ .
|
| 34 |
+
|
| 35 |
+
The sub-networks found by IMP, which indeed train faster and outperform their original, dense networks, are called winning tickets, and can generalize across datasets (Mehta, 2019; Soelen & Sheppard, 2019) and training methods (Morcos et al., 2019). In this sense, IMP can be a promising tool in applications that involve knowledge transfer, such as transfer or meta learning.
|
| 36 |
+
|
| 37 |
+
Zhou et al. (2019) perform extensive experiments to re-evaluate and better understand the Lottery Ticket Hypothesis. Relevant to this work is the fact that the authors propose a method to learn the binary mask $m$ in an end-to-end manner through SGD, instead of relying on magnitude-based pruning. The authors show that learning only the binary mask and not the weights is sufficient to achieve competitive performance, confirming that the learned masks are highly dependent on the initialized values $w _ { 0 }$ , and are also capable of encoding substantial information about a problem’s solution.
|
| 38 |
+
|
| 39 |
+
# 2.2 SPARSE NETWORKS
|
| 40 |
+
|
| 41 |
+
The core aspect of searching for a winning ticket is finding a sparse sub-network that attains high performance relative to its dense counterpart. One way to achieve this is through pruning methods (LeCun et al., 1990), which follow a strategy to remove weights from a trained network while minimizing negative impacts on its performance. In Han et al. (2015), a network is iteratively trained and pruned using parameter magnitudes as criterion: this iterative, two-stage algorithm is shown to outperform “one-shot pruning”: training and pruning the network only once.
|
| 42 |
+
|
| 43 |
+
Other methods attempt to approximate $\ell _ { 0 }$ regularization on the weights of a network, yielding onestage procedures that can be fully described in the optimization framework. In order to find a sparse
|
| 44 |
+
|
| 45 |
+
# Algorithm 1 Iterative Magnitude Pruning (Frankle et al., 2019)
|
| 46 |
+
|
| 47 |
+
1: Initialize $w w _ { 0 } \sim \mathcal { D }$ and $m \gets \vec { 1 } ^ { d }$
|
| 48 |
+
2: Minimize $L ( f ( x ; m \odot w ) )$ until $w _ { T }$ is produced
|
| 49 |
+
3: Set $m _ { i } = 0$ for the active weights with smallest magnitudes $\langle \vert w _ { T , i } \vert \le \tau$ and $m _ { i } = 1$ )
|
| 50 |
+
4: If satisfied, output ticket $f ( x ; m \odot w _ { k } )$
|
| 51 |
+
5: Otherwise, set $w w _ { k }$ and go back to step 2
|
| 52 |
+
|
| 53 |
+
# Algorithm 2 Iterative Stochastic Sparsification (inspired by Zhou et al. (2019))
|
| 54 |
+
|
| 55 |
+
1: Initialize $w w _ { 0 } \sim \mathcal { D }$ , $s { \vec { s } } _ { 0 }$
|
| 56 |
+
2: Minimize $\mathbb { E } _ { m \sim \mathrm { B e r } ( \sigma ( s ) ) } \left[ L ( f ( x ; m \odot w ) ) \right] + \lambda \left\| \sigma ( s ) \right\| _ { 1 }$ until $w _ { T }$ and $s _ { T }$ are produced
|
| 57 |
+
3: If satisfied, output ticket $f ( x ; m \odot w _ { k } )$ , $m \sim \operatorname { B e r } ( \sigma ( s _ { T } ) )$
|
| 58 |
+
4: Otherwise, set $w w _ { k }$ , $s _ { i } \gets - \infty$ for $s _ { i , T } < s _ { i , 0 }$ , and go back to step 2
|
| 59 |
+
|
| 60 |
+
setting $m \in \{ 0 , 1 \} ^ { d }$ of a network $f ( x ; m \odot w )$ , Srinivas et al. (2016) and Louizos et al. (2017) use a stochastic re-parameterization $m \sim \mathrm { B e r n o u l l i } ( g ( s ) )$ with $s \in \mathbb { R } ^ { d }$ and $g : \mathbb { R } [ 0 , 1 ]$ applied element-wise. First-order methods, coupled with gradient estimators, are then used to train both $w$ and $s$ to minimize the expected loss. This approach performs continuous parameter removal during training in an automatic fashion: any component $s _ { i }$ of $s$ that assumes a value during training where $g ( s _ { i } ) \bar { = } 0$ effectively removes $w _ { i }$ from the network. Moreover, approximating $\ell _ { 0 }$ regularization has the advantage of not requiring a pruning strategy, which might be arbitrarily complex.
|
| 61 |
+
|
| 62 |
+
# 3 METHOD
|
| 63 |
+
|
| 64 |
+
Designing a method to quickly find winning tickets requires an efficient way to sparsify networks: ideally, sparsification should be done as early as possible in training, and the number of removed parameters should be maximized without harming the model’s performance. In other words, sparsification must be continuously maximized following a trade-off with the performance of the network. This goal is not met by Iterative Magnitude Pruning: sparsification is done at discrete time steps, only after fully training the network, and optimal pruning rates likely depend on the model’s performance and current sparsity: factors which are typically not accounted for – note that these are inherent characteristics of magnitude-based pruning.
|
| 65 |
+
|
| 66 |
+
In light of this, we turn to $\ell _ { 0 }$ -regularization methods for learning sparse networks, which consist of optimizing a clear trade-off between sparsity and performance. As we will see, performing sparsification continuously is not only straightforward, but done automatically by the optimizer.
|
| 67 |
+
|
| 68 |
+
# 3.1 CONTINUOUS SPARSIFICATION BY LEARNING DETERMINISTIC MASKS
|
| 69 |
+
|
| 70 |
+
We first frame the search for sparse networks as a loss minimization problem with $\ell _ { 0 }$ regularization (Louizos et al., 2017; Srinivas et al., 2016):
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname* { m i n } _ { w \in \mathbb { R } ^ { d } } L ( f ( x ; w ) ) + \lambda \cdot \| w \| _ { 0 }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where $\lambda \geq 0$ controls the sparsity of the solution, and, with a slight abuse of notation, $L ( f ( x ; w ) )$ denotes the loss incurred by the network $f ( x ; w )$ (e.g., the cross-entropy loss over a training set). As $\ell _ { 0 }$ regularization is typically intractable, we re-state the above minimization problem as:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m i n } _ { w \in \mathbb { R } ^ { d } } L ( f ( x ; m \odot w ) ) + \lambda \cdot \| m \| _ { 1 }
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
which uses the fact that, for $m \in \{ 0 , 1 \} ^ { d }$ , $\left\| m \right\| _ { 0 } = \left\| m \right\| _ { 1 }$ . The $\ell _ { 1 }$ term can be minimized with subgradient descent, however the $m \in \{ 0 , 1 \} ^ { d }$ constraint makes the above problem combinatorial and poorly suited for local search methods like SGD.
|
| 83 |
+
|
| 84 |
+
# Algorithm 3 Continuous Sparsification
|
| 85 |
+
|
| 86 |
+
1: Initialize $w w _ { 0 } \sim \mathcal { D }$ , $s s _ { 0 }$ , $\beta \beta _ { 0 }$
|
| 87 |
+
2: Minimize $L ( f ( x ; \sigma ( \boldsymbol { \beta } \cdot \boldsymbol { s } ) \odot w ) ) + \lambda \| \sigma ( \boldsymbol { \beta } \boldsymbol { s } ) \| _ { 1 }$ while increasing $\beta$ , producing $w _ { T } , s _ { T }$ , and $\beta _ { T }$
|
| 88 |
+
3: If satisfied, output ticket $f ( x ; b ( s _ { T } ) \odot w _ { k } )$
|
| 89 |
+
4: Otherwise, set $s \gets \operatorname* { m i n } ( \beta _ { T } \cdot s _ { T } , s _ { 0 } )$ , $\beta \gets \beta _ { 0 }$ , (optionally, $w w _ { 0 }$ ), and go back to step 2
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 1: Illustration of our proposed re-parameterization $m = \sigma ( \beta s )$ , where $\begin{array} { r } { \sigma ( z ) = \frac { 1 } { 1 + e ^ { - z } } } \end{array}$ is the sigmoid function and $\beta$ acts as a temperature. As $\beta$ increases, $\sigma ( \beta z )$ approaches $b ( z )$ , which can can be used to frame a $\ell _ { 0 }$ -regularized problem (Equation 4). Note that the gradients of $\overset { \cdot } { \sigma } ( \beta s )$ vanish as $\beta$ increases, suggesting that $\beta$ should be annealed slowly during training.
|
| 93 |
+
|
| 94 |
+
We can avoid the binary constraint $m \in \{ 0 , 1 \} ^ { d }$ by re-parameterizing $m$ as a function of a newlyintroduced variable $s \in \mathbf { \overline { { \mathbb { R } } } } ^ { d }$ . For example, Louizos et al. (2017) propose a stochastic mapping $s \mapsto m$ and use gradient methods to minimize the expected total loss, while using estimators for the gradients of $s$ (since $m$ is still binary). Having a stochastic mask (or, equivalently, a distribution over subnetworks) poses an immediate challenge for the task of finding tickets, as it is not clear which ticket should be chosen once a distribution over $m$ is learned. Moreover, relying on gradient estimators often causes gradients to have high variance, requirwe consider a deterministic parameterization $\bar { m } = \bar { b ( s ) }$ training, where $s \in \mathbb { R } _ { \neq 0 } ^ { d }$ optiand $b : \bar { \mathbb { R } } _ { \neq 0 } \{ 0 , 1 \}$ ly,is applied element-wise:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
b ( z ) = { \left\{ \begin{array} { l l } { 1 , { \mathrm { i f ~ } } z > 0 } \\ { 0 , { \mathrm { i f ~ } } z < 0 } \end{array} \right. }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Applying this re-parameterization to Equation 2 yields:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\operatorname* { m i n } _ { w \in \mathbb { R } ^ { d } \atop s \in \mathbb { R } _ { \neq 0 } ^ { d } } L ( f ( x ; b ( s ) \odot w ) ) + \lambda \cdot \| b ( s ) \| _ { 1 }
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Clearly, the above problem is again intractable, as it is still equivalent to the original $\ell _ { 0 }$ problem in Equation 1. More specifically, the step function $b ( z )$ is non-convex, and having zero gradients make gradient-based optimization ineffective. Instead, we consider the following smooth relaxation of $b ( \cdot )$ :
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
m : = \sigma ( \beta \cdot s )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\beta \in \mathbb { R } _ { > 0 }$ , and $\sigma$ is the sigmoid function $\begin{array} { r } { \sigma ( z ) = \frac { 1 } { 1 + e ^ { - z } } } \end{array}$ , applied element-wise. By controlling $\beta$ , which acts as a temperature parameter, we effectively interpolate between $\sigma ( s )$ , a smooth function well-suited for SGD, and $\begin{array} { r } { \operatorname* { l i m } _ { \beta \to \infty } \sigma ( \beta \cdot s ) = b ( z ) } \end{array}$ , our original goal, which brings computational hardness to the problem. Figure 1 illustrates this behavior. Note that, if $L ( f ( x ; w ) )$ is continuous in $w$ , then:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\operatorname* { m i n } _ { w \in \mathbb { R } _ { \neq 0 } ^ { d } } \operatorname* { l i m } _ { \beta \to \infty } L ( f ( x ; \sigma ( \beta s ) \odot w ) ) + \lambda \cdot \| \sigma ( \beta s ) \| _ { 1 } = \operatorname* { m i n } _ { w \in \mathbb { R } _ { \neq 0 } ^ { d } } L ( f ( x ; b ( s ) \odot w ) ) + \lambda \cdot \| b ( s ) \| _ { 1 }
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
Although gradient methods will become ineffective as $\beta \to \infty$ due to vanishing gradients of $s$ , we can increase $\beta$ while optimizing $s$ and $w$ with gradient descent. That is, our loss at each iteration will be a function of $\beta$ as follows:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
L _ { \beta } ( w , s ) = L ( f ( x ; \sigma ( \beta s ) \odot w ) ) + \lambda \cdot \| \sigma ( \beta \cdot s ) \| _ { 1 }
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
How does the soft mask $m = \sigma ( \beta \cdot s )$ behave as we minimize ${ \cal L } _ { \beta } ( w , s )$ while increasing $\beta ?$ As $\beta \to \infty$ , every negative component of $s$ will be mapped to 0, effectively removing its correspondent weight parameter from the network. While analytically the weights will never truly be zeroed-out, limited numerical precision has the fortunate side-effect of causing actual sparsification to the network during training, as long as $\beta$ is increased to a large enough value.
|
| 125 |
+
|
| 126 |
+
In a nutshell, we learn sparse networks by minimizing $\boldsymbol { L _ { \beta } } ( \boldsymbol { w } , s )$ for $T$ parameter updates with gradient descent while jointly annealing $\beta$ : producing $w _ { T }$ , $s _ { T }$ and $\beta _ { T }$ , which is ideally large enough such that, numerically 1, $\sigma ( \vec { \beta _ { T } } \cdot s _ { T } ) = \bar { b } ( s _ { T } )$ . In case $m$ is truly required to be binary (as in the task of finding tickets), the dependence on numerical imprecision can be avoided by directly outputting $m = b ( s _ { T } )$ at the end of training.
|
| 127 |
+
|
| 128 |
+
Finally, note that minimizing $L _ { \beta }$ while increasing $\beta$ is not generally equivalent to minimizing the original $\ell _ { 0 }$ -regularized problem. Informally, the former aims to solve $\begin{array} { r } { \operatorname* { l i m } _ { \beta \to \infty } \operatorname* { m i n } _ { w , s } L _ { \beta } ( w , s ) } \end{array}$ , while the $\ell _ { 0 }$ problem is $\mathrm { \bar { m i n } } _ { w , s } \operatorname* { l i m } _ { \substack { \beta \to \infty } } L _ { \beta } \mathrm { \bar { ( } } w , s )$ .
|
| 129 |
+
|
| 130 |
+
# 3.2 TICKET SEARCH THROUGH CONTINUOUS SPARSIFICATION
|
| 131 |
+
|
| 132 |
+
The method presented above offers a direct alternative to magnitude-based pruning when performing ticket search, but a few considerations must follow. Most importantly, when searching for winning tickets, there is a strict constraint that the learned mask $m$ be binary: otherwise, one can also learn the magnitude of the weights, defeating the purpose of finding sub-networks that can be trained from scratch. To guarantee that the output mask satisfies this constraint regardless of numerical precision, we always output $b ( s _ { T } )$ instead of $\sigma ( \beta _ { T } \cdot s _ { T } )$ .
|
| 133 |
+
|
| 134 |
+
Additionally, we also incorporate two techniques from successful methods for learning sparse networks and searching for winning tickets. First, motivated by Han et al. (2015), where it is shown that iteratively pruning a network yields improved sparsity compared to pruning it only once, we enable “kept” weights – those whose corresponding component of $s$ is positive after many iterations – to be removed from the network at a later stage. More specifically, when $\beta$ becomes large after $T$ gradient descent updates, the gradients of $s$ vanish and weights will no longer be removed from the network. To avoid this, we set $s \gets \operatorname* { m i n } ( \beta _ { T } \cdot s _ { T } , s _ { 0 } )$ , effectively resetting the soft mask parameters for the remaining weights while at the same time not interfering with weights that have been removed. This is followed by a reset on the temperature, $\beta \beta _ { 0 }$ , to allow training of $s$ once again.
|
| 135 |
+
|
| 136 |
+
Second, we perform parameter rewinding, following Frankle $\&$ Carbin (2019), which is a key component of Iterative Magnitude Pruning. More specifically, after $T$ gradient descent steps, we reset the weight values back to an earlier stage $w w _ { k }$ , where $k \ll T$ . Even though experimental results in Frankle & Carbin (2019) suggest that rewinding is necessary for successful ticket search, we leave rewinding as an optinal component of our algorithm: as we will see empirically, it turns out that ticket search is possible without rewinding weights. Our proposed algorithm to find winning tickets is presented as Algorithm 3, and referred simply as “Continuous Sparsification”.
|
| 137 |
+
|
| 138 |
+
# 4 EXPERIMENTS
|
| 139 |
+
|
| 140 |
+
Our experiments aim at comparing different methods on the task of finding winning tickets in neural networks, hence our evaluation focuses on the generalization performance of each ticket (sub-network) when trained from scratch (or from an iterate in early-training). Additionally, we measure the cost of the search procedure: the number of training epochs to find tickets with varying performance and sparsity.
|
| 141 |
+
|
| 142 |
+
Besides comparing our proposed method to Iterative Magnitude Pruning (Algorithm 1), we also design a baseline method, Iterative Stochastic Sparsification (ISS, Algorithm 2), motivated by the procedure in Zhou et al. (2019) to find a binary mask $m$ with gradient descent in an end-to-end fashion. More specifically, ISS uses a stochastic re-parameterization $m \sim$ Bernoulli $( \sigma ( s ) )$ with $s \in \mathbb { R } ^ { d }$ , and trains $w$ and $s$ jointly with gradient descent and the straight-through estimator (Bengio et al., 2013). When ran for multiple iterations, all components of the mask parameters $s$ which have decreased in value from initialization are set to $- \infty$ , such that the corresponding weight is permanently removed from the network. While this might look arbitrary, we observed empirically that ISS was unable to remove weights quickly without this step unless $\lambda$ was chosen to be large – in which case the model’s performance decrease in exchange for sparsity. The hyperparameters used in this section were chosen based on analysis presented in Appendix (...), where we study how the pruning rate affects IMP, and how $\lambda , s _ { 0 }$ and $\beta _ { T }$ interact in CS.
|
| 143 |
+
|
| 144 |
+
# 4.1 CONVOLUTIONAL NEURAL NETWORKS
|
| 145 |
+
|
| 146 |
+
We train a neural network with 6 convolutional layers on the CIFAR-10 dataset (Krizhevsky, 2009), following Frankle & Carbin (2019). The network consists of 3 blocks of 2 resolution-preserving convolutional layers followed by $2 \times 2$ max-pooling, where convolutions in each block have 64, 128 and 256 channels, a $3 \times 3$ kernel, and are immediately followed by ReLU activations. The blocks are followed by fully-connected layers with 256, 256 and 10 neurons, with ReLUs in between. The network is trained with Adam (Kingma & Ba, 2015) with a learning rate of 0.0003 and a batch size of 60.
|
| 147 |
+
|
| 148 |
+
Learning a Supermask: As a first baseline, we consider the task of learning a “supermask” (Zhou et al., 2019): a binary mask $m$ that, when applied to a network with randomly initialized weights, yields performance competitive to that of training its weights. This task is equivalent to pruning a randomly-initialized network, or learning an architecture that performs well prior to training with a fixed initialization. We compare ISS and CS , where each method is run for a single iteration composed of 100 epochs. When ran for a single iteration, ISS is equivalent to the algorithm proposed in Zhou et al. (2019) to learn a supermask, referred here as simply Stochastic Sparsification. We control the sparsity of the learned masks by varying $s _ { 0 }$ between $- 5$ and 5 for Stochastic Sparsification (which showed to be more effective than varying $\lambda$ ), while for Continuous Sparsification we vary $\lambda$ between $1 0 ^ { - 1 1 }$ and $1 0 ^ { - 7 }$ (which results in stable and consistent training, unlike varying $s _ { 0 }$ ). SS uses SGD with a learning rate of 100 to learn its mask parameters, while CS uses Adam with $\mathrm { \ddot { 3 } } \times 1 0 ^ { - 4 }$ .
|
| 149 |
+
|
| 150 |
+
Results are presented in Figure 2: CS outperforms SS in terms of both training speed and the quality of the learned mask. In particular, CS finds masks with over $7 5 \%$ sparsity that yield over $7 5 \%$ test accuracy, while the performance of masks found by SS decrease when sparsity is over $5 0 \%$ . Moreover, CS makes faster progress in training, showing that optimizing a deterministic mask is indeed faster than learning a distribution over masks through stochastic re-parameterizations.
|
| 151 |
+
|
| 152 |
+
Finding Winning Tickets: We run IMP and ISS for a total of 30 iterations, each consisting of 40 epochs. Parameters are trained with Adam (Kingma & Ba, 2015) with a learning rate of $3 \times 1 0 ^ { - 4 }$ , following Frankle & Carbin (2019). For IMP, we use pruning rates of $1 5 \% / 2 0 \%$ for convolutional/dense layers. We initialize the Bernoulli parameters of ISS with $s _ { 0 } = \vec { 1 }$ , and train them with SGD and a learning rate of 20, along with a $\ell _ { 1 }$ regularization of $\lambda = 1 0 ^ { - 8 }$ . For CS , we anneal the temperature from $\beta _ { 0 } = 1$ to $\beta _ { 0 } = 2 5 0$ following an exponential schedule $( \beta _ { t } = 2 5 0 ^ { \frac { t } { T } } )$ ), training both the weights and the mask with Adam and a learning rate of $3 \times 1 0 ^ { - 4 }$ .
|
| 153 |
+
|
| 154 |
+
To test whether our method is capable of finding winning tickets in a limited amount of time, we limit each run of CS to 4 iterations only, in contrast with IMP and ISS which are run for 30. We perform 6 runs of CS , each with a different value for the mask initialization $s _ { 0 } \colon - 0 . 0 5 , - 0 . 0 3 , - 0 . \bar { 0 2 } , - 0 . 0 1 ,$ $- 0 . 0 0 5 , 0$ , keeping $\lambda = 1 0 ^ { - 1 0 }$ , such that sparsification is not enforced during training, but heavily biased at initialization. In order to evaluate how consistent our method is, we repeat each run with 3 different random seeds so that error bars can be computed.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Learning a binary mask with weights frozen at initialization with Stochastic Sparsification (SS, Algorithm 2 with one iteration) and Continuous Sparsification (CS), on a 6-layer CNN on CIFAR10. Left: Training curves with hyperparameters for which masks learned by SS and CS were both approximately $5 0 \%$ sparse. CS learns the mask significantly faster while attaining similar early-stop performance. Right: Sparsity and test accuracy of masks learned with different settings for SS and CS: our method learns sparser masks while maintaining test performance, while SS is unable to successfully learn masks with over $5 0 \%$ sparsity.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Test accuracy of tickets found by different methods on CIFAR-10. Error bars depict variance across 3 runs. Left: Performance of tickets found on a 6-layer CNN, when trained from scratch. Right: Performance of tickets found on a ResNet 20, when rewinded to the second training epoch. In both experiments, tickets found by CS outperform ones found by IMP. In most cases, CS successfully finds winning tickets in 2 iterations (purple curves).
|
| 161 |
+
|
| 162 |
+
Figure 3 (left) presents the quality of tickets found by each method, measured by their test accuracy when trained from scratch. To illustrate the quality of the tickets that can be found by Continuous Sparsification, we plot the Pareto curve (green) of the tickets founds with the 6 different values for $s _ { 0 }$ . With $s _ { 0 } = - 0 . 0 3$ , in only 2 iterations CS finds a ticket with over $7 7 \%$ sparsity (first marker of purple curve) which outperforms every ticket found by IMP in its 30 iterations. The Pareto curve of CS strictly dominates IMP for tickets with more less than $9 7 \%$ sparsity, where ticket performance is superior or similar to the original dense network.
|
| 163 |
+
|
| 164 |
+
In terms of computational time, the total cost to run CS with the 6 different values for $s _ { 0 }$ is lower than performing a single run of IMP for 30 iterations, even though CS takes $1 5 \%$ extra time per epoch due to the mask parameters. This shows the potential of our model even in the setting where a specific sparsity is desired for the tickets. When run in parallel, CS takes less wall-clock time to find all tickets in the Pareto curve than to run IMP for 5 iterations.
|
| 165 |
+
|
| 166 |
+
4.2 FINDING WINNING TICKETS IN RESIDUAL NETWORKS WITHOUT REWINDING
|
| 167 |
+
|
| 168 |
+
Searching for tickets in realistic models is not as straightforward as finding tickets in a small CNN, and might require new strategies. Frankle et al. (2019) show that IMP fails at finding winning tickets in ResNets (He et al., 2016) unless the learning rate is smaller than the recommended value, leading to worse overall performance and defeating the purpose of ticket search. However, the authors propose a slight modification to IMP that enables search for winning tickets to be successful on complex networks: instead of training from scratch, tickets are initialized with weights from early training.
|
| 169 |
+
|
| 170 |
+
With this in mind, we evaluate how Continuous Sparsification performs in the time-consuming task of finding winning tickets in a ResNet- $2 0 ^ { 2 }$ (He et al., 2016) trained on CIFAR-10: a setting where IMP might take over 10 iterations (850 epochs) to succeed. We follow the setup in Frankle & Carbin (2019) and Frankle et al. (2019): in each iteration, the network is trained with SGD, a learning rate of 0.1, and a momentum of 0.9 for a total of 85 epochs, using a batch size of 128. The learning rate is decayed by a factor of 10 at epochs 56 and 71, and a weight decay of 0.0001 is applied to the weights (for CS , we do not apply weight decay to the mask parameters $s$ ). The two skip-connections that perform $1 \times 1$ convolutions and the output layer are not removable: for IMP, their parameters are not pruned, while for CS their weights do not have a correspondent mask $m$ nor mask parameters $s$ .
|
| 171 |
+
|
| 172 |
+
When training the returned tickets in order to evaluate their performance, we initialize their weights with the iterates from the end of epoch 2 (780 parameter updates), similarly to Frankle et al. (2019). Unlike when searching for winning tickets in the 6-layer CNN, IMP performs global pruning, removing $2 0 \%$ of the remaining parameters with smallest magnitude, ranked globally (across different layers). IMP runs for a total of 30 iterations, while CS is limited to only 5 iterations for each run. The sparsity of the tickets found by CS is controlled by varying the mask initialization $s _ { 0 } \in$ $\{ - 0 . 3 , - 0 . 2 , - 0 . 1 , - 0 . 0 5 , - 0 . 0 3 , 0 , 0 . 0 3 , 0 . 0 5 , 0 . 1 , 0 . 2 , 0 . 3 \}$ (a total of 11 values). To allow for even faster ticket search, we run CS without parameter rewinding: that is, the weights $w$ are transferred from one iteration to another, removing the need to re-train the network as the method progresses through iterations. For both CS and IMP, each run is repeated with 3 different random seeds.
|
| 173 |
+
|
| 174 |
+
The results presented in Figure 3 (right) show that CS is able to successfully find winning tickets with varying sparsity in under 5 iterations. Once again, the Pareto curve strictly dominates IMP, and variance across runs is smaller than IMP’s. Most notably, CS is capable of quickly sparsifying the network in a single iteration (first marker of each purple curve), and typically finds better tickets than IMP after only 2 rounds (compare blue curve and second marker of each purple curve), regardless of sparsity. When run in parallel, 2 iterations suffice for CS to find tickets that outperform the ones found by IMP.
|
| 175 |
+
|
| 176 |
+
We observed that not performing rewinding caused the performance of tickets with high sparsity to quickly degrade after 2 or more iterations of CS. We speculate that, when rewinding is not performed between iterations, the distance between $w _ { k }$ and the parameter iterates produced by gradient descent $w _ { t }$ increase significantly with the number of iterations. This in turn can result in the learned mask $m _ { T }$ to be highly sub-optimal for weight values $w _ { k }$ $k \ll T$ ) which are used to re-train the ticket. This suggests that in order to avoid re-training the network and hence make the search for winning tickets more efficient, rewinding should not be performed between iterations. In this case, the search must complete quickly, before performance degradation occurs due to “overtraining”, requiring optimal ways to perform sparsification without negatively impacting the model’s performance.
|
| 177 |
+
|
| 178 |
+
# 4.3 PRUNING VGG
|
| 179 |
+
|
| 180 |
+
Our experiments show that Continuous Sparsification is capable of finding tickets quickly and consistently, and we attribute its success to its deterministic re-parameterization of the binary mask. Here, we evaluate our method a pruning technique, to better assess whether our proposed re-parameterization is advantageous only in terms of training time, or also in respect to the quality of the learned masks.
|
| 181 |
+
|
| 182 |
+
For this task, we train a VGG (Simonyan & Zisserman, 2015) on the CIFAR-10 dataset, following the protocol in Frankle & Carbin (2019): the network is trained with SGD and an initial learning rate of 0.1, which is decayed by a factor of 10 at epochs 80 and 120. After 160 training epochs, the network is sparsified and then fine-tuned for 40 epochs with a learning rate of 0.001. We evaluate previously described methods when executed for a single iteration (one-shot pruning): Continuous Sparsification, Magnitude Pruning (IMP with 1 iteration) (Han et al., 2015), and Stochastic Sparsification (ISS with 1 iteration), which is similar to methods in Zhou et al. (2019), Srinivas et al. (2016), and Louizos et al. (2017).
|
| 183 |
+
|
| 184 |
+
At the sparsification step, IMP performs global pruning, ISS fixes the binary mask $m$ to be the maximum likelihood one under $\operatorname { B e r } ( \sigma ( s ) )$ (which performed better than sampling from the distribution), and CS changes the parameterization of the mask from $\sigma ( \beta s )$ to $b ( s )$ (or, equivalently, weights $w _ { i }$ where $s _ { i } < 0$ are removed). We use a momentum of 0.9, a weight decay of 0.0001 (not applied to s), and a batch-size of 64. Following Frankle & Carbin (2019), sparsification is not applied to batch normalization nor the final linear layer.
|
| 185 |
+
|
| 186 |
+
To evaluate each method when finding masks with different sparsity levels, we run IMP with global pruning rates $5 0 \%$ , $7 5 \%$ , $8 0 \%$ , $8 5 \%$ , ${ \bar { 9 } } 0 \%$ , $9 \hat { 5 } \%$ , $9 7 . 5 \%$ , $9 8 \%$ , $9 8 . 5 \%$ , $9 9 \%$ , $9 9 . 5 \%$ , $9 9 . 7 5 \%$ , and ISS and CS with initial mask values $- 0 . 3$ , $- 0 . 2 5$ , $- 0 . 2$ , $- 0 . 1 5$ , $- 0 . 1$ , $- 0 . 0 5$ $- 0 . 0 1$ , $- 0 . 0 0 5$ , $- 0 . 0 0 1$ , 0. Results are shown in Figure 4: both magnitude pruning and stochastic $\ell _ { 0 }$ regularization (Stochastic Sparsifi
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: Performance of different methods when performing one-shot pruning on VGG. CS maintains over $9 0 \%$ test accuracy after removing $9 9 . 7 \%$ of the weights, while other methods fail to successfully remove more than $9 8 \%$ of the parameters.
|
| 190 |
+
|
| 191 |
+
cation) fail at removing over $9 8 \%$ of the weights without severely degrading the performance of the model. On the other hand, Continuous Sparsification successfully removes ${ \bar { 9 } } 9 . 7 \%$ of the parameters in the convolutional layers while still yielding over $9 0 \%$ test accuracy. When taken to the extreme, our method is capable of removing $9 9 . 8 5 \%$ of the weights and still yield over $8 3 \%$ accuracy.
|
| 192 |
+
|
| 193 |
+
The dramatic performance difference between stochastic and continuous sparsification shows that our proposed deterministic re-parameterization is key to achieve superior results in both network pruning and ticket search. The fact that it outperforms magnitude pruning, a standard technique in the pruning literature, suggests that further exploration of $\ell _ { 0 }$ -based methods could yield significant advances in pruning techniques.
|
| 194 |
+
|
| 195 |
+
# 5 DISCUSSION
|
| 196 |
+
|
| 197 |
+
With Frankle & Carbin (2019), we now realize that sparse sub-networks can indeed be successfully trained from scratch, putting in question the belief that overparameterization is required for proper optimization of neural networks. Such sub-networks, called winning tickets, can be potentially used to significantly decrease the required resources for training deep networks, as they are shown to transfer between different, but similar, tasks (Mehta, 2019; Soelen & Sheppard, 2019).
|
| 198 |
+
|
| 199 |
+
Currently, the search for winning tickets is a poorly explored problem, where Iterative Magnitude Pruning (Frankle & Carbin, 2019) stands as the only algorithm suited for this task, and it is unclear whether its key ingredients – post-training magnitude pruning and parameter rewinding – are the correct choices for the task. Here, we approach the problem of finding sparse sub-networks as an $\ell _ { 0 }$ -regularized optimization problem, which we approximate through a smooth, parameterized relaxation of the step function. Our proposed algorithm for finding winning tickets, Continuous Sparsification, removes parameters automatically and continuously during training, and can be fully described by the optimization framework. We show empirically that, indeed, post-training pruning might not be a sensible choice for finding winning tickets, raising questions on how the search for tickets differs from standard network compression. With this work, we hope to further motivate the problem of quickly finding tickets in overparameterized networks, as recent work suggests that the task might be highly relevant to transfer learning and mobile applications.
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In ICML, 2019.
|
| 204 |
+
|
| 205 |
+
Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation. arXiv e-prints, art. arXiv:1308.3432, 2013.
|
| 206 |
+
|
| 207 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv e-prints, art. arXiv:1810.04805, 2018.
|
| 208 |
+
|
| 209 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR, 2019.
|
| 210 |
+
|
| 211 |
+
Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M. Roy, and Michael Carbin. Stabilizing the Lottery Ticket Hypothesis. arXiv e-prints, art. arXiv:1903.01611, 2019.
|
| 212 |
+
|
| 213 |
+
Song Han, Jeff Pool, John Tran, and William J. Dally. Learning both weights and connections for efficient neural networks. NIPS’15, 2015.
|
| 214 |
+
|
| 215 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. ICLR, 2016.
|
| 216 |
+
|
| 217 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016.
|
| 218 |
+
|
| 219 |
+
Forrest N. Iandola, Matthew W. Moskewicz, Khalid Ashraf, Song Han, William J. Dally, and Kurt Keutzer. SqueezeNet: AlexNet-level accuracy with $5 0 \mathrm { x }$ fewer parameters and ${ < } 1 \mathbf { M } \mathbf { B }$ model size. arXiv:1602.07360, 2016.
|
| 220 |
+
|
| 221 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. ICLR, 2015.
|
| 222 |
+
|
| 223 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 224 |
+
|
| 225 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In NIPS. 1990.
|
| 226 |
+
|
| 227 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. ICLR, 2019.
|
| 228 |
+
|
| 229 |
+
Christos Louizos, Max Welling, and Diederik P. Kingma. Learning Sparse Neural Networks through $L _ { 0 }$ Regularization. arXiv e-prints, art. arXiv:1712.01312, 2017.
|
| 230 |
+
|
| 231 |
+
Rahul Mehta. Sparse Transfer Learning via Winning Lottery Tickets. arXiv e-prints, art. arXiv:1905.07785, 2019.
|
| 232 |
+
|
| 233 |
+
Ari S. Morcos, Haonan Yu, Michela Paganini, and Yuand ong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. arXiv e-prints, art. arXiv:1906.02773, 2019.
|
| 234 |
+
|
| 235 |
+
Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. Towards Understanding the Role of Over-Parametrization in Generalization of Neural Networks. arXiv e-prints, art. arXiv:1805.12076, 2018.
|
| 236 |
+
|
| 237 |
+
Pedro Savarese and Michael Maire. Learning implicitly recurrent CNNs through parameter sharing. In ICLR, 2019.
|
| 238 |
+
|
| 239 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. ICLR, 2015.
|
| 240 |
+
|
| 241 |
+
Ryan Van Soelen and John W. Sheppard. Using winning lottery tickets in transfer learning for convolutional neural networks. In IJCNN, 2019.
|
| 242 |
+
|
| 243 |
+
Suraj Srinivas, Akshayvarun Subramanya, and R. Venkatesh Babu. Training Sparse Neural Networks. arXiv e-prints, art. arXiv:1611.06694, 2016.
|
| 244 |
+
|
| 245 |
+
Saining Xie, Ross B. Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. CVPR, 2017.
|
| 246 |
+
|
| 247 |
+
Hattie Zhou, Janice Lan, Rosanne Liu, and Jason Yosinski. Deconstructing lottery tickets: Zeros, signs, and the supermask. ArXiv, abs/1905.01067, 2019.
|
| 248 |
+
|
| 249 |
+
# APPENDIX
|
| 250 |
+
|
| 251 |
+
# A HYPERPARAMETER ANALYSIS
|
| 252 |
+
|
| 253 |
+
# A.1 CONTINUOUS SPARSIFICATION
|
| 254 |
+
|
| 255 |
+
In this section, we study how the hyperparameters of Continuous Sparsification affect its performance in terms of sparsity and performance of the found tickets. More specifically, we consider the following hyperparameters:
|
| 256 |
+
|
| 257 |
+
• Final temperature $\beta _ { T }$ : the final value for $\beta$ , which controls how smooth the parameterization $m = \sigma ( \bar { \beta } s )$ is.
|
| 258 |
+
• $\ell _ { 1 }$ penalty $\lambda$ : the strength of the $\ell _ { 1 }$ regularization applied to the soft mask $\sigma ( \beta s )$ , which promotes sparsity.
|
| 259 |
+
• Mask initial value $s _ { 0 }$ : the value used to initialize all components of the soft mask $m = \sigma ( \beta s )$ , where smaller values promote sparsity.
|
| 260 |
+
|
| 261 |
+
Our setup is as follows: to analyze how each of the 3 hyperparameters impact the performance of Continuous Sparsification, we train a ResNet 20 on CIFAR-10 (following the same protocol from Section 4.2), varying one hyperparameter while keeping the other two fixed. To capture how hyperparameters interact with each other, we repeat the described experiment with different settings for the fixed hyperparameters.
|
| 262 |
+
|
| 263 |
+
Since different hyperparameter settings naturally yield vastly distinct sparsity and performance for the found tickets, we report relative changes in accuracy and in sparsity.
|
| 264 |
+
|
| 265 |
+
In Figure 5, we vary $\lambda$ between 0 and $1 0 ^ { - 8 }$ for three different $( s _ { 0 } , \beta _ { T } )$ settings: $\stackrel { \prime } { s } _ { 0 } = - 0 . 2 , \beta _ { T } =$ 100), $( s _ { 0 } = 0 . 0 5 , \mathring { \beta _ { t } } = 2 0 0 )$ , and $( s _ { 0 } = - 0 . 3 , \beta _ { T } = 1 0 0 )$ . As we can see, there is little impact on either the performance or the sparsity of the found ticket, except for the case where $s _ { 0 } = 0 . 0 5$ and $\beta _ { T } = 2 0 0$ , for which $\lambda = 1 0 ^ { - 8 }$ yields slightly increased sparsity.
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 5: Impact on relative test accuracy and sparsity of tickets found in a ResNet 20 trained on CIFAR-10, for different values of $\lambda$ and fixed settings for $\beta _ { T }$ and $s _ { 0 }$ .
|
| 269 |
+
|
| 270 |
+
Next, we consider the fixed settings $( s _ { 0 } = - 0 . 2 , \lambda = 1 0 ^ { - 1 0 } ,$ ), $( s _ { 0 } = 0 . 0 5 , \lambda = 1 0 ^ { - 1 2 } )$ ), $( s _ { 0 } =$ $- 0 . 3 , \lambda = 1 0 ^ { - 8 } ,$ , and proceed to vary the final temperature $\beta _ { T }$ between 50 and 200. Figure 6 shows the results: in all cases, a larger temperature of 200 yielded better accuracy. However, it decreased sparsity compared to smaller temperature values for the settings $( s _ { 0 } = - 0 . 2 , \lambda = 1 0 ^ { - 1 0 }$ ) and $\stackrel { \prime } { s } _ { 0 } = \bar { - } 0 . 3 , \stackrel { . } { \lambda } = 1 \bar { 0 } ^ { - 8 } ,$ ), while at the same time increasing sparsity for $\begin{array} { r } { { ' s _ { 0 } } = 0 . 0 5 , \lambda = 1 0 ^ { - 1 2 } . } \end{array}$ ). While larger temperatures appear beneficial and might suggest that even higher values should be used, note that, the larger $\beta _ { T }$ is, the earlier in training the gradients of $s$ will vanish, at which point training of the mask will stop. Since the performance for temperatures between 100 and 200 does not change significantly, we recommend values around 150 or 200 when either pruning or performing ticket search.
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Figure 6: Impact on relative test accuracy and sparsity of tickets found in a ResNet 20 trained on CIFAR-10, for different values of $\beta _ { T }$ and fixed settings for $\lambda$ and $s _ { 0 }$ .
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 7: Impact on relative test accuracy and sparsity of tickets found in a ResNet 20 trained on CIFAR-10, for different values of $s _ { 0 }$ and fixed settings for $\beta _ { T }$ and $\lambda$ .
|
| 277 |
+
|
| 278 |
+
Lastly, we vary the initial mask value $s _ { 0 }$ between $- 0 . 3$ and $+ 0 . 3$ , with hyperpameter settings $( \beta _ { T } \doteq 1 0 0 , \lambda \doteq 1 0 ^ { - 1 0 } )$ , $( \beta _ { T } = 2 0 0 , \lambda = 1 0 ^ { - 1 2 } )$ ), and $\langle \beta _ { T } = 1 0 0 , \lambda = 1 0 ^ { - 8 } \rangle$ ). Results are given in Figure 7: unlike the exploration on $\lambda$ and $\beta _ { T }$ , we can see that $s _ { 0 }$ has a strong and consistent effect on the sparsity of the found tickets. For this reason, we suggest proper tuning of $s _ { 0 }$ when the goal is to achieve a specific sparsity value. Since the percentage of remaining weights is monotonically increasing with $s _ { 0 }$ , we can perform binary search over values for $s _ { 0 }$ to achieve any desired sparsity level. In terms of performance, lower values for $s _ { 0 }$ naturally lead to performance degradation, since sparsity quickly increases as $s _ { 0 }$ becomes more negative.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 8: Performance of tickets found by Iterative Magnitude Pruning in a ResNet 20 trained on CIFAR, for different pruning rates.
|
| 282 |
+
|
| 283 |
+
# A.2 ITERATIVE MAGNITUDE PRUNING
|
| 284 |
+
|
| 285 |
+
Here, we assess whether the running time of Iterative Magnitude Pruning can be improved by increasing the amount of parameters pruned at each iteration. The goal of this experiment is to evaluate if Continuous Sparsification offers faster ticket search only because it prunes the network more aggressively than IMP, or because it is truly more effective in how parameters are chosen to be removed.
|
| 286 |
+
|
| 287 |
+
Following the same setup as the previous section, we train a ResNet 20 on CIFAR-10. We run IMP for 30 iterations, performing global pruning with different pruning rates at the end of each iteration. Figure 8 shows that the performance of tickets found by IMP decays when the pruning rate is increased to $4 0 \%$ . In particular, the final performance of found tickets is mostly monotonically decreasing with the number of remaining parameters, suggesting that, in order to find tickets which outperform the original network, IMP is not compatible with more aggressive pruning rates.
|
md/train/BJleph4KvS/BJleph4KvS.md
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HAARPOOLING: GRAPH POOLING WITH COMPRESSIVE HAAR BASIS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep Graph Neural Networks (GNNs) are instrumental in graph classification and graph-based regression tasks. In these tasks, graph pooling is a critical ingredient by which GNNs adapt to input graphs of varying size and structure. We propose a new graph pooling operation based on compressive Haar transforms, called HaarPooling. HaarPooling is computed by following a chain of sequential clusterings of the input graph. The input of each pooling layer is transformed by the compressive Haar basis of the corresponding clustering. HaarPooling operates in the frequency domain by the synthesis of nodes in the same cluster and filters out fine detail information by compressive Haar transforms. Such transforms provide an effective characterization of the data and preserve the structure information of the input graph. By the sparsity of the Haar basis, the computation of HaarPooling is of linear complexity. The GNN with HaarPooling and existing graph convolution layers achieves state-of-the-art performance on diverse graph classification problems.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph Neural Networks (GNNs) have demonstrated excellent performance in node classification tasks and are very promising in graph classification and regression (Bronstein et al., 2017; Battaglia et al., 2018; Zhang et al., 2018b; Zhou et al., 2018; Wu et al., 2019). In node classification, the input is a single graph with missing node labels that are to be predicted from the known node labels. In this problem, GNNs with appropriate graph convolutions can be trained based on the single graph that is provided, and achieve state-of-the-art performance (Defferrard et al., 2016; Kipf & Welling, 2017; Ma et al., 2019b). Different from node classification, graph classification is a task where the label of any given graph-structured sample is to be predicted based on a training set of labeled graph-structured samples. This is similar to the image classification task tackled by traditional deep convolutional neural networks. The major difference is that here each input sample may have an arbitrary adjacency structure, instead of the fixed regular grids that are used in images. An example of graph-structured data are the molecules of different sizes shown in Figure 1. This raises two important challenges: 1) How can GNNs exploit the graph structure information of the input data? 2) How can GNNs handle input graphs with varying number of nodes and connectivity structures?
|
| 12 |
+
|
| 13 |
+
Figure 1: Graph-structured data: two molecules with atoms as nodes and bonds as edges. Each molecule has a different number of nodes and molecular structure. In graph classification (and regression), each input datum is an individual graph with features defined on the graph nodes (e.g., indicating the chemical element).
|
| 14 |
+
|
| 15 |
+
These problems have motivated the design of proper graph convolution and graph pooling to allow GNNs to capture the geometric information of each data sample (Zhang et al., 2018a; Ying et al., 2018; Cangea et al., 2018; Gao & Ji, 2019; Knyazev et al., 2019; Ma et al., 2019a; Lee et al., 2019). Graph convolution plays an important role especially in question 1).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 2: Computational flow of a Graph Neural Network consisting of three blocks of GCN graph convolutional and HaarPooling layers, followed by an MLP. In this example, the output feature of the last pooling layer has dimension 4, which is the number of input units of the MLP.
|
| 19 |
+
|
| 20 |
+
The following graph convolution, as proposed by Kipf & Welling (2017), is a widely accepted example:
|
| 21 |
+
|
| 22 |
+
$$
|
| 23 |
+
X ^ { \mathrm { o u t } } = \widehat { A } X ^ { \mathrm { i n } } W .
|
| 24 |
+
$$
|
| 25 |
+
|
| 26 |
+
Here $\widehat { A } = \widetilde { D } ^ { - 1 / 2 } ( A + I ) \widetilde { D } ^ { - 1 / 2 } \in \mathbb { R } ^ { N \times N }$ is a normalized version of the adjacency matrix $A$ of the input graph, where $I$ is the identity matrix and $\widetilde { D }$ is the degree diagonal matrix for $A + I$ . Further, $X ^ { \mathbf { \bar { i } n } } \in \mathbb { R } ^ { \mathbf { \bar { N } } \times d }$ is the array of $d$ e-dimensional features on the $N$ nodes of the graph, and $W \in \mathbb { R } ^ { d \times m }$ is the filter parameter matrix. The graph convolution in equation 1 captures the structural information of the input in terms of $A$ (or $\widehat { A }$ ), and $W$ transforms the feature dimension from $d$ to $m$ . The filter size $d \times m$ does not depend on the graph size, which allows a fixed network architecture to process input graphs of varying size. However, the GCN convolution preserves the number of nodes and hence the output dimension of the network is not unique. Graph pooling provides an effective way to overcome this obstacle. Among several approaches that have been proposed, only EigenPooling (Ma et al., 2019a) incorporates both features and graph structure. However, this is based on eigenpairs of graph Laplacian and suffers from a high computational cost. We provide an overview of this and other graph pooling methods in Section 2.
|
| 27 |
+
|
| 28 |
+
In this paper, we propose a new graph pooling strategy based on a sparse Haar representation of the data, which we call HaarPooling. This is based on the Haar basis (Li et al., 2019), which incorporates graph structure and features, and is computationally efficient. Suppose we have an input $X ^ { \mathrm { i n } } \in \breve { \mathbb R } ^ { N \times d }$ . HaarPooling is then defined as
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
X ^ { \mathrm { o u t } } = \Phi ^ { T } X ^ { \mathrm { i n } } ,
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
where $\Phi \in \mathbb { R } ^ { N \times N _ { 1 } }$ , $N _ { 1 } < N$ . Each column of $\Phi$ is a compressive Haar basis vector. By applying HaarPooling in equation 2, the number of nodes is compressed from $N$ to $N _ { 1 }$ . The Haar basis provides a sparse representation which distills graph structural information. Cascading pooling layers we can obtain an output of a fixed dimension, regardless of the size of the inputs. The sparsity of the Haar basis matrix ensures that the computation of HaarPooling is efficient. Generating the Haar basis and computing the Haar transform has a computational cost $\mathcal { O } ( N )$ (up to a log term of $N$ ) for input graphs with $N$ nodes. Experiments in Section 5 demonstrate that GNNs with HaarPooling achieve state-of-the-art performance on various graph classification tasks.
|
| 35 |
+
|
| 36 |
+
This paper is organized as follows. Section 2 gives an overview of existing work on graph pooling. Section 3 details the components and computational flow for HaarPooling. Section 4 provides the mathematical details on HaarPooling, including the compressive Haar basis, compressive Haar transforms, and efficient implementations. Section 5 reports our experimental results on benchmark graph classification tasks compared with existing graph pooling methods. Section 6 concludes the paper. Proofs and implementation details are deferred to the appendix.
|
| 37 |
+
|
| 38 |
+
Graph pooling is a necessary step when building a GNN model for graph classification, as one needs a unified graph-level rather than node-level representation for graph inputs for which size and topology are changing. The most direct pooling method takes the global mean and sum of node representations obtained by the graph convolutional layer (Duvenaud et al., 2015) as a simple graph-level representation. However, this pooling operation treats all the nodes equally and ignores the global geometry of the graph. ChebNet (Defferrard et al., 2016) uses a graph coarsening procedure to build the pooling module, which requires graph clustering algorithms to obtain subgraphs. One drawback of this topology-based strategy is that it does not incorporate the node features in the pooling. Global pooling methods consider the information of node embeddings to obtain the entire graph representation. As a general framework for graph classification problems, MPNN (Gilmer et al., 2017) uses the Set2Set method (Vinyals et al., 2015) to obtain graph-level representations. Zhang et al. (2018a) proposed a SortPool method that sorts feature representation of nodes before feeding them into traditional 1-D convolutional and dense layers. But these global pooling techniques cannot guarantee hierarchical graph representations that may contain useful information in the graph structure. A prominent recent idea is to build a differentiable and data-dependent pooling layer with learnable operations/parameters, which has brought substantial improvements on graph classification tasks. Ying et al. (2018) proposed a differentiable pooling layer (DiffPool) that learns a cluster assignment matrix over the nodes using the output of a GNN model. One common problem with DiffPool is its huge storage complexity, which results from the computation of the soft clustering assignments. Cangea et al. (2018); Gao & Ji (2019); Knyazev et al. (2019) used a Top-K pooling method that samples a subset of important nodes by employing a trainable projection vector. Lee et al. (2019) introduced Self-Attention Graph Pooling (SAGPool) by replacing the way node scores are computed in Top-K pooling by a GCN module. These hierarchical pooling methods technically still employ mean/max pooling procedures to aggregate the feature representation of super-nodes, which would lead to information loss. Diehl et al. (2019) proposed EdgePool which is a scheme which considers edge contraction and thus takes into account of graph structure in pooling.
|
| 39 |
+
|
| 40 |
+
There are also spectral-based pooling methods that take account of both the graph structure and its node features. Noutahi et al. (2019) proposed the Laplacian Pooling (LaPool) method that dynamically selects centroid nodes and their corresponding follower nodes by an attention mechanism that uses the graph Laplacian. Ma et al. (2019a) introduced EigenPool which uses local graph Fourier transform to extract subgraph information utilizing both node features and structure of the subgraph. Its potential drawback lies in the inherent bottleneck of computing Laplacian-based graph Fourier transform, given the huge cost in the eigendecomposition of the graph Laplacian. This shortcoming partially motivates our present work.
|
| 41 |
+
|
| 42 |
+
# 3 HAARPOOLING
|
| 43 |
+
|
| 44 |
+
In this section we give an overview of the proposed HaarPooling framework. First we define the pooling architecture in terms of a chain, i.e., a sequence of graphs $\left( \mathcal { G } _ { 0 } , \mathcal { G } _ { 1 } , \ldots , \mathcal { G } _ { K } \right)$ , where the nodes of each $\mathcal { G } _ { j + 1 }$ correspond to clusters of nodes of $\mathcal { G } _ { j + 1 }$ , $j = 0 , \ldots , K - 1$ . Each layer in the chain determines which sets of nodes are pooled together. Then we construct the compressive Haar transform, which compresses the dimension of the features.
|
| 45 |
+
|
| 46 |
+
Chain of coarse-grained graphs for pooling Graph pooling amounts to defining a sequence of coarse-grained graphs. In our chain, each graph is an induced graph that arises from grouping (clustering) certain subsets of nodes from the previous graph. We use clustering algorithms to generate the groupings of nodes. There are many good candidates, such as spectral clustering (Shi & Malik, 2000), $k$ -means clustering (Pakhira, 2014), DBSCAN (Ester et al., 1996), OPTICS (Ankerst et al., 1999) and METIS (Karypis & Kumar, 1998). Any of these will work with HaarPooling.
|
| 47 |
+
|
| 48 |
+
Figure 3 shows an example of a chain with 3 levels, for an input graph $\mathcal { G } _ { 0 }$ .
|
| 49 |
+
|
| 50 |
+
Compressive Haar transforms on chain For each layer of the chain, we will have a feature representation. We define these in terms of the Haar basis. Haar basis represents graph-structured data by low and high frequency Haar coefficients in frequency domain. The low frequency coefficients contain the coarse information of the original data while the high frequency coefficients contain the fine details. In the HaarPooing, the data is pooled (or compressed) by discarding fine detail information.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 3: A coarse-grained chain of graphs, where the input has 8 nodes, the second level has 3 nodes, and the top level has single node.
|
| 54 |
+
|
| 55 |
+
The Haar basis can be compressed in each layer. Consider a chain where at level $j$ the two subsequent graphs have $N _ { j + 1 }$ and $N _ { j }$ nodes, $N _ { j + 1 } < N _ { j }$ . For each of these graphs, we can create a Haar basis with $N _ { j + 1 }$ and $N _ { j }$ elements, respectively. The elements of the smaller layer are obtained by compressing a subset of the elements from the other layer. These new vectors form the matrix $\Phi _ { j }$ of size $N _ { j + 1 } \times N _ { j }$ . We call $\Phi _ { j }$ compressive Haar basis matrix for this particular $j$ th layer. This then defines the compressive Haar transform $\Phi _ { j } ^ { T } X ^ { \mathrm { i n } }$ for feature $X ^ { \mathrm { i n } }$ with size $N _ { j } \times d$ .
|
| 56 |
+
|
| 57 |
+
Computational strategy of HaarPooling The HaarPooling is then defined as follows.
|
| 58 |
+
|
| 59 |
+
Definition 1 (HaarPooling). The HaarPooling for a graph neural network with $K$ pooling layers is defined as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
X _ { j } ^ { \mathrm { o u t } } = \Phi _ { j } ^ { T } X _ { j } ^ { \mathrm { i n } } , \quad j = 0 , 1 , \ldots , K - 1 ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $N _ { j } > N _ { j + 1 }$ and $N _ { K } = 1$ , $\Phi _ { j }$ or $\Phi _ { N _ { j } \times N _ { j + 1 } } ^ { ( j ) }$ is the $N _ { j } \times N _ { j + 1 }$ compressive Haar basis matrix for the jth layer, $X _ { j } ^ { \mathrm { i n } } \in \mathbb { R } ^ { N _ { j } \times d _ { j } }$ is the input feature array, and $X _ { j } ^ { \mathrm { o u t } } \in \mathbb { R } ^ { N _ { j + 1 } \times d _ { j } }$ feature array. The corresponding layer is called HaarPooling layer.
|
| 66 |
+
|
| 67 |
+
HaarPooling has following key properties.
|
| 68 |
+
|
| 69 |
+
• The HaarPooling reduces layer by layer the first dimension of input feature. In the last pooling layer, the output feature is compressed as a vector with length $d _ { K - 1 }$ and each original input sample would generate such a vector with the same length. This then makes it possible to deal with input graph-structured data with different size and structure.
|
| 70 |
+
• The HaarPooling uses the sparse Haar representation on chain structure. In each HaarPooling layer, the representation then combines the features of input $X _ { j } ^ { \mathrm { i n } }$ with the geometric information of the graphs of the $j$ th and $( j + 1 )$ th layers of the chain.
|
| 71 |
+
• By the property of Haar basis, the HaarPooling only drops the high frequency (or detailed) information of the input data. The $X _ { j } ^ { \mathrm { o u t } }$ has good approximation to $X _ { j } ^ { \mathrm { i n } }$ . Thus, the major data information (i.e. the low frequency coefficients) is preserved in the pooling, and the loss of the information is small.
|
| 72 |
+
Since the Haar basis matrix is very sparse, HaarPooling can be computed very fast, with near linear computational complexity.
|
| 73 |
+
|
| 74 |
+
Example Figure 4 shows the computational details of the HaarPooling associated with the chain is transformed by the compressvectors of the full Haar basis from Figure 3. There are two HaarPooling layers. In the first layer, the input aar basis matrix in (a), and out $\Phi _ { 8 \times 3 } ^ { ( 0 ) }$ w a nsists ofmatrix $X _ { 1 } ^ { \mathrm { i n } }$ with size rst three column. In the second $8 \times d _ { 1 }$ $\Phi _ { 8 \times 8 } ^ { ( 0 ) }$ $3 \times d _ { 1 }$ $X _ { 1 } ^ { \mathrm { o u t } }$ layer, the input $X _ { 2 } ^ { \mathrm { i n } }$ with size $3 \times d _ { 2 }$ (usually $X _ { 1 } ^ { \mathrm { o u t } }$ followed by convolution) is transformed by the compressive Haar matrix $\Phi _ { 3 \times 1 } ^ { ( 1 ) }$ which is the first column vector of the full Haar basis matrix $\Phi _ { 3 \times 3 } ^ { ( 1 ) }$ in (b). By the construction of the Haar basis in relation to the chain (details in Appendix B), each of the first three column vectors $\phi _ { 1 } ^ { ( 0 ) } , \phi _ { 2 } ^ { ( 0 ) }$ and $\phi _ { 3 } ^ { ( 0 ) }$ of $\Phi _ { 8 \times 3 } ^ { ( 0 ) }$ has only up to three different values. This bound is exactly the number of nodes of $\mathcal { G } _ { 1 }$ . For each column $\phi _ { \ell } ^ { ( 0 ) }$ , all nodes with the same parent take the same value. Similarly, the $3 \times 1$ vector $\phi _ { 1 } ^ { ( 1 ) }$ is constant. This means that the HaarPooling
|
| 75 |
+
|
| 76 |
+
(a) First HaarPooling Layer for $\mathcal { G } _ { 0 } \mathcal { G } _ { 1 }$
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 4: Computational strategy of HaarPooling. We use the chain in Figure 3 and then there are two HaarPooling layers in the network from $\mathcal { G } _ { 0 } \mathcal { G } _ { 1 }$ and $\mathcal { G } _ { 1 } \mathcal { G } _ { 2 }$ respectively. The input of each layer is pooled by the compressive Haar transform for each layer: in the first layer input $X _ { 1 } ^ { \mathrm { i n } } = ( x _ { i , j } ) \in \mathbb { R } ^ { 8 \times d _ { 1 } }$ is transformed by the compressive Haar basis matrix $\Phi _ { 8 \times 3 } ^ { ( 0 ) }$ with size $8 \times 3$ formed by the first three column vectors, and the output is a feature array with size $3 \times d _ { 1 }$ ; in the second layer $X _ { 2 } ^ { \mathrm { i n } } = ( y _ { i , j } ) \in \mathbb { R } ^ { 3 \times d _ { 2 } }$ is transformed by the first column vector $\Phi _ { 3 \times 1 } ^ { ( 1 ) }$ and the output is a feature vector with size $1 \times d _ { 2 }$ . In the plots of Haar basis matrix, the colors indicate the value of the entries of the Haar basis matrix.
|
| 80 |
+
|
| 81 |
+
synthesizes the node feature by adding the same weight to the nodes that are in the same cluster of the coarser layer, and in this way, pools the feature using the graph clustering information.
|
| 82 |
+
|
| 83 |
+
# 4 MATHEMATICS AND COMPUTATION FOR HAARPOOLING
|
| 84 |
+
|
| 85 |
+
Chain of graphs by clustering For a graph $\mathcal { G } = ( V , E , w )$ , where $V , E , w$ are the vertices, edges, and weights on edges, a graph $\mathcal { G } ^ { \mathrm { c g } } : = ( V ^ { \mathrm { c g } } , E ^ { \mathrm { c g } } , w ^ { \mathrm { c g } } )$ is a coarse-grained graph of $\mathcal { G }$ if $| V ^ { \mathrm { c g } } | \leq | V |$ and each node of $\mathcal { G }$ has only one parent node in ${ \mathcal { G } } ^ { \mathrm { c g } }$ associated with it. Each node of $\mathcal G ^ { \mathrm { c g } }$ is called a cluster of $\mathcal { G }$ . For integers $J > 0$ , a coarse-grained chain for $\mathcal { G }$ is a sequence of graphs $\mathcal { G } _ { 0 J } : =$ $( \mathcal { G } _ { 0 } , \mathcal { G } _ { 1 } , \ldots , \mathcal { G } _ { J } )$ with $\mathcal { G } _ { 0 } = \mathcal { G }$ and such that $\mathcal { G } _ { j + 1 }$ is a coarse-grained graph of $\mathcal { G } _ { j } = ( V _ { j } , E _ { j } , w _ { j } )$ for each $j = 0 , 1 , \ldots , J - 1$ , and $\mathcal { G } _ { J }$ has only one node. Here, we call the graph $\dot { \mathcal { G } } _ { J }$ the top level or the coarsest level and $\mathcal { G } _ { 0 }$ the bottom level or the finest level. The chain $\mathcal { G } _ { 0 J }$ hierarchically coarsens graph $\mathcal { G }$ . We use the notation $J + 1$ for the number of layers of the chain to distinguish the number $K$ of layers for pooling. The chain for graph $\mathcal { G }$ can be created by any clustering method. For details about graphs and chains, we refer the reader to the examples by Chung & Graham (1997); Hammond et al. (2011); Chui et al. (2015; 2018); Wang & Zhuang (2018; 2019).
|
| 86 |
+
|
| 87 |
+
# 4.1 COMPRESSIVE HAAR TRANSFORMS
|
| 88 |
+
|
| 89 |
+
Haar basis The construction of Haar basis is rooted in the theory of Haar wavelet basis which was first introduced by Haar (1910). It is a special example of the more general Daubechies wavelets (Daubechies, 1992). Haar basis is later constructed on graph by Belkin et al. (2006), and also Chui et al. (2015); Wang & Zhuang (2018; 2019). The construction of the Haar basis is based on a chain of the graph. If the topology of the graph is well reflected by the clustering of the chain, then the Haar basis contains the crucial geometric information of the graph. For a chain $\mathcal { G } _ { 0 J }$ , on the $j$ th-layer graph $\mathcal { G } _ { j }$ , $j = 0 , \dots , J$ , there is a basis $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 0 } ^ { N _ { j } }$ defined on , where is the size of $\mathcal { G } _ { j }$ and $N _ { j + 1 } < N _ { j }$ $j = 0 , \ldots , J - 1$ . Suppose two consecutive layers $j , j + 1$ . The first $N _ { j + 1 }$ members of $\phi _ { \ell } ^ { ( j ) }$ , $\ell = 1 , \ldots , N _ { j + 1 }$ , are defined on the finer layer $j + 1$ , and can be reduced into the $\phi _ { \ell } ^ { ( j + 1 ) }$ , $\ell = 1 , \dots , N _ { j + 1 }$ , as follows. For first $\ell = 1 , \dots , N _ { j + 1 }$ $\phi _ { \ell } ^ { ( j ) } ( v ) = \phi _ { \ell } ^ { ( j + 1 ) } ( P a _ { \mathcal { G } } ( v ) ) / \sqrt { | P a _ { \mathcal { G } } ( v ) | }$ , i.e. the value of the $\phi _ { \ell } ^ { ( j ) } ( v )$ is equal to the scaled $\phi _ { \ell } ^ { ( j + 1 ) }$ at the parent $P a _ { \cal G } ( v )$ of $v$ and the scaled factor is one on square root of the number of nodes in the cluster which $v$ lies in. It means that $\phi _ { \ell } ^ { ( j ) } ( v )$ for $v$ sharing the parent have the same value. This property is critical to pooling as $\phi _ { \ell } ^ { ( j ) } ( v )$ can then be treated as weights for the graph $\mathcal { G } _ { j }$ on which the input feature defined, and the nodes gain the same weight if they are in the same cluster. On the other hand, the remaining Haar basis vectors $\phi _ { \ell } ^ { ( j ) }$ for $\ell = N _ { j + 1 } { + } 1 , \ldots , N _ { j }$ are constructed to reflect the high-frequency information in the Haar wavelet decomposition. This property is exploited by the compressive Haar basis which then pools the input feature into a lower (first) dimension output feature. The construction and its pseudo-codes for algorithmic implementation of the full Haar basis is detailed in Li et al. (2019); Wang & Zhuang (2019), which we also attach in the appendix. Let {φ(j)\` }Nj\`=1, $j = 0 , \dots , J$ , be the sequence of Haar bases associated with the layers of chain $\mathcal { G } _ { 0 J }$ of a graph $\mathcal { G }$ . For $j = 0 , \dots , J$ , we let the matrix $\widetilde { \Phi } _ { j } = ( \phi _ { 1 } ^ { ( j ) } , \dots , \phi _ { N _ { j } } ^ { ( j ) } ) \in \mathbb { R } ^ { N _ { j } \times N _ { j } }$ and call the matrix $\widetilde { \Phi } _ { j }$ Haar transform matrix for layer $j$ .
|
| 90 |
+
|
| 91 |
+
Orthogonality For each level $j = 0 , \dots , J$ , the sequence $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 1 } ^ { N _ { j } }$ , with $N _ { j } : = | V _ { j } |$ , is an for the sp. For each c, $l _ { 2 } ( \mathcal { G } _ { j } )$ f square-summable sequences on theis the Haar basis system for the chain . $\mathcal { G } _ { j }$ , so that $( \phi _ { \ell } ^ { ( j ) } ) ^ { T } \phi _ { \ell ^ { \prime } } ^ { ( j ) } = \delta _ { \ell , \ell ^ { \prime } }$ $j$ $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 1 } ^ { N _ { j } }$ $\mathcal { G } _ { j J }$
|
| 92 |
+
|
| 93 |
+
Locality Let $\mathcal { G } _ { 0 J }$ be a coarse-grained chain for $\mathcal { G }$ . If each parent of level $\mathcal { G } _ { j }$ , $j = 1 , \dotsc , J$ , contains at least two children, the number of different scalar values of the components of a Haar basis vector $\phi _ { \ell } ^ { ( j ) }$ , $\ell = 1 , \ldots , N _ { j }$ , is bounded by a constant independent of $j$ .
|
| 94 |
+
|
| 95 |
+
In Figure 4, the Haar basis is created based on the coarse-grained chain $\mathcal { G } _ { 0 \to 2 } : = ( \mathcal { G } _ { 0 } , \mathcal { G } _ { 1 } , \mathcal { G } _ { 2 } )$ , where $\mathcal { G } _ { 0 } , \mathcal { G } _ { 1 } , \mathcal { G } _ { 2 }$ are graphs with $8 , 3 , 1$ nodes. The two colorful matrices show two Haar bases for the layers 0 and 1 in the chain $\mathcal { G } _ { 0 2 }$ . There are in total 8 vectors of the Haar basis for $\mathcal { G } _ { 0 }$ each with length 8, and 3 vectors of the Haar basis for $\mathcal { G } _ { 1 }$ each with length 3. Haar basis matrix for each level of the chain has up to 3 different values in each column as indicated by colors in each matrix. For $j = 0 , 1$ , each node of $\mathcal { G } _ { j }$ is a cluster of nodes in $\mathcal { G } _ { j + 1 }$ . Each column of the matrix is a member of the Haar basis on the individual layer of the chain. The first three column vectors of $\widetilde { \Phi } _ { 1 }$ can be reduced as an orthonormal basis of $\mathcal { G } _ { 1 }$ and the first column vector of $\mathcal { G } _ { 1 }$ can be compressed to the constant basis for $\mathcal { G } _ { 2 }$ . This connection ensures that the compressive Haar transform for HaarPooling is feasible and would allow fast algorithms of HaarPooling (see Section 4.2 below).
|
| 96 |
+
|
| 97 |
+
Adjoint and forward Haar transforms We use adjoint Haar transforms for HaarPooling, which as the sparsity of the Haar basis matrix, the transform is fast implementable. The adjoint Haar transform for the signal $f$ on $\mathcal { G } _ { j }$ is defined as
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
( \widetilde { \Phi } _ { j } ) ^ { T } f = \left( \sum _ { v \in V } \phi _ { 1 } ^ { ( j ) } ( v ) f ( v ) , \ldots , \sum _ { v \in V } \phi _ { N _ { j } } ^ { ( j ) } ( v ) f ( v ) \right) \in \mathbb { R } ^ { N _ { j } } ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
and the forward Haar transform for (coefficients) vector $c : = ( c _ { 1 } , \ldots , c _ { N _ { j } } ) \in \mathbb { R } ^ { N _ { j } }$ .
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
( \widetilde { \Phi } _ { j } c ) ( v ) = \sum _ { \ell = 1 } ^ { N _ { j } } \phi _ { \ell } ^ { ( j ) } ( v ) c _ { \ell } , \quad v \in V _ { j } .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
We call the components of $( \widetilde { \Phi } _ { j } ) ^ { T } f$ the Haar (wavelet) coefficients for $f$ . The adjoint Haar transform represents the signal in Haar wavelet domain by computing the Haar coefficients for graph signal. Here the adjoint and forward Haar transforms can be extended to a feature data with size $N _ { j } \times d _ { j }$ by replacing the column vector $f$ by the feature array.
|
| 110 |
+
|
| 111 |
+
Proposition 2. The adjoint and forward Haar Transforms are invertible in that for $j = 0 , \dots , J$ and vector $f$ on graph $\mathcal { G } _ { j }$ ,
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
f = \widetilde { \Phi } _ { j } ( \widetilde { \Phi } _ { j } ) ^ { T } f .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Proposition 2 shows that the forward Haar transform can recover the graph signal $f$ from the adjoint Haar transform $( \widetilde { \Phi } _ { j } ) ^ { T } f$ . This means that adjoint and forward Haar transforms have zero-loss in graph signal transmission.
|
| 118 |
+
|
| 119 |
+
Compressive Haar transforms Now for a graph neural network, suppose we want to use $K$ pooling layers. We associate the chain $\mathscr { G } _ { 0 \to K }$ of an input graph with the pooling by linking the $j$ th layer of pooling with the $j$ th layer of the chain. Then, we can use the Haar basis system on the chain to define the pooling operation. By the property of Haar basis, in the Haar transforms for layer $j$ , $0 \leq$ $j \le K - 1$ , of the $N _ { j }$ Haar coefficients, the first $N _ { j + 1 }$ coefficients are low-frequency coefficients, which reflect the approximation to the original data, and the other $\left( N _ { j } - N _ { j + 1 } \right)$ coefficients are in high frequency, which contain fine details of the Haar wavelet decomposition. To define pooling, we remove the high-frequency coefficients in Haar wavelet representation and obtain the compressive Haar transforms for the feature $X _ { j } ^ { \mathrm { i n } }$ at layers $j = 0 , \ldots , K - 1$ , which then gives the HaarPooling in Definition 1.
|
| 120 |
+
|
| 121 |
+
As shown in the following formula, the compressive Haar transform synthesizes the neighbourhood information of the signal $f$ as compared to the full Haar transform. Thus, HaarPooling takes the average information of the data $f$ over nodes in the same cluster.
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\big \lVert \Phi _ { j } ^ { T } X _ { j } ^ { \mathrm { i n } } \big \rVert ^ { 2 } = \sum _ { p \in \mathcal { G } _ { j + 1 } } \frac { 1 } { | P a ( v ) | } \Big | \sum _ { p = P a ( v ) } X _ { j } ^ { \mathrm { i n } } ( v ) \Big | ^ { 2 } , \quad \Big \lVert \tilde { \Phi } _ { j } ^ { T } X _ { j } ^ { \mathrm { i n } } \Big \rVert ^ { 2 } = \sum _ { p \in \mathcal { G } _ { j + 1 } } \sum _ { p = P a ( v ) } \Big | X _ { j } ^ { \mathrm { i n } } ( v ) \Big | ^ { 2 } ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\widetilde { \Phi } _ { j }$ is the full Haar basis matrix at the $j$ th layer and $| P a g ( v ) |$ means the number of nodes in the cluster which $v$ lies in. Here, in the first equation, $1 / \sqrt { | P a _ { \mathcal { G } } ( v ) | }$ can be taken out of summation as $P a ( v )$ is in fact a set of nodes. We show the derivation of formula in equation 5 in Appendix D.
|
| 128 |
+
|
| 129 |
+
In HaarPooling, the compression or pooling occurs in the Haar wavelet domain. HaarPooling transforms the features on the nodes to the Haar wavelet domain and discards the high-frequency coefficients in the sparse Haar wavelet representation. Figure 4 shows a two-layer HaarPooling strategy. The first layer pools the input $X _ { 0 } ^ { \mathrm { i n } }$ by the compressive Haar basis matrix $\Phi _ { 8 \times 3 } ^ { ( 0 ) }$ to the output $X _ { 0 } ^ { \mathrm { o u t } }$ with lower first dimension. The second layer pools the input $X _ { 1 } ^ { \mathrm { i n } }$ by the $\Phi _ { 3 \times 1 } ^ { ( 1 ) }$ to the output $X _ { 1 } ^ { \mathrm { o u t } }$ which first dimension drops to one.
|
| 130 |
+
|
| 131 |
+
# 4.2 FAST COMPUTATION OF HAARPOOLING
|
| 132 |
+
|
| 133 |
+
For the HaarPooling introduced in Definition 1, we can develop a fast computational strategy by virtue of fast adjoint Haar transforms. Let $\mathscr { G } _ { 0 \to K }$ be a coarse-grained chain of the graph $\mathcal { G } _ { 0 }$ . For convenience, we label the vertices of the level- $j$ graph $\mathcal { G } _ { j }$ by $V _ { j } : = \{ v _ { 1 } ^ { ( j ) } , \ldots , v _ { N _ { j } } ^ { ( j ) } \}$ .
|
| 134 |
+
|
| 135 |
+
Fast algorithm for HaarPooling The HaarPooling in equation 3 can be computed fast by using the hierarchical structure of the chain, as we introduce as follows. For $j = 1 , \ldots , K$ , let $c _ { k } ^ { ( j ) }$ be the number of children of $v _ { k } ^ { ( j ) }$ , i.e. the number of vertices of $\mathcal { G } _ { j - 1 }$ which belongs to the cluster $v _ { k } ^ { ( j ) }$ for $k = 1 , \ldots , N _ { j }$ . For $j = 0$ , we let $c _ { k } ^ { ( 0 ) } \equiv 1$ for $k = 1 , \ldots , N _ { 0 }$ . Now, for $j = 0 , \ldots , K$ and $k = 1 , \dots , N _ { j }$ , define the weight for the node $v _ { k } ^ { ( j ) }$ of layer $j$ by
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
w _ { k } ^ { ( j ) } : = \frac { 1 } { \sqrt { c _ { k } ^ { ( j ) } } } .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Let $W _ { 0 \to K } : = \{ w _ { k } ^ { ( j ) } | j = 0 , \dots , K , k = 1 , \dots , N _ { j } \}$ . Then, for $j = 0 , \ldots , K$ , the weighted chain $( \mathscr { G } _ { j \to K } , W _ { j \to K } )$ becomes a filtration if each parent of the chain $\mathscr { G } _ { j K }$ has at least two children. See e.g. (Chui et al., 2015, Definition 2.3).
|
| 142 |
+
|
| 143 |
+
Let $j = 0 , \ldots , K$ . For the $j$ th HaarPooling layer, let $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 1 } ^ { N _ { j } }$ be the Haar basis for the $j$ th layer, which we also call the Haar basis for the filtration $( \mathscr { G } _ { j \to K } , W _ { j \to K } )$ $k = 1 , \dots , N _ { j }$ we let $X ( v _ { k } ^ { ( j ) } ) = X ( v _ { k } ^ { ( j ) } , \cdot ) \in \mathbb { R } ^ { d _ { j } }$ the feature vector at node $v _ { k } ^ { ( j ) }$ . We define the weighted sum for feature $X \in \mathbb { R } ^ { N _ { j } \times d _ { j } }$ for $d _ { j } \geq 1$ by
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { r } { S ^ { ( j ) } \big ( X , v _ { k } ^ { ( j ) } \big ) : = X ( v _ { k } ^ { ( j ) } ) , \quad v _ { k } ^ { ( j ) } \in \mathcal { G } _ { j } , } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
Input: Input feature $X _ { j } ^ { \mathrm { i n } }$ for the $j$ th pooling layer given $j = 0 , \ldots , K - 1$ in a GNN with total $K$ HaarPooling layers; the chain $\mathscr { G } _ { j K }$ associated with the HaarPooling; numbers $N _ { i }$ of nodes for layers $i = j , \ldots , K$ .
|
| 150 |
+
|
| 151 |
+
Output: $\Phi _ { j } ^ { T } X _ { j } ^ { \mathrm { i n } }$ from Definition 1.
|
| 152 |
+
|
| 153 |
+
Step 1: Evaluate the sums for $i = j , \dots , K$ recursively, using equation 7 and equation 8: $\bar { S } ^ { ( i ) } ( X _ { j } ^ { \mathrm { i n } } , v _ { k } ^ { ( i ) } ) \quad \forall v _ { k } ^ { ( i ) } \in V _ { i }$ .
|
| 154 |
+
|
| 155 |
+
# Step 2:
|
| 156 |
+
|
| 157 |
+
# end for
|
| 158 |
+
|
| 159 |
+
and recursively, for $i = j + 1 , \dots , K$ and $v _ { k } ^ { ( i ) } \in \mathcal G _ { i }$
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\mathcal { S } ^ { ( i ) } \big ( X , v _ { k } ^ { ( i ) } \big ) : = \sum _ { v _ { k ^ { \prime } } ^ { ( i - 1 ) } \in v _ { k } ^ { ( i ) } } w _ { k ^ { \prime } } ^ { ( i - 1 ) } \mathcal { S } ^ { ( i - 1 ) } \big ( X , v _ { k ^ { \prime } } ^ { ( i - 1 ) } \big ) .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
For each vertex $v _ { k } ^ { ( i ) }$ of $\mathcal { G } _ { i }$ , the $S ^ { ( i ) } \big ( X , v _ { k } ^ { ( i ) } \big )$ is the weighted sum of the $\begin{array} { r l } { { S ^ { ( i - 1 ) } \big ( X , v _ { k ^ { \prime } } ^ { ( i - 1 ) } \big ) } } \end{array}$ at the level $i - 1$ for those vertices $v _ { k ^ { \prime } } ^ { ( i - 1 ) }$ of $\mathcal { G } _ { i - 1 }$ whose parent is $v _ { k } ^ { ( i ) }$ .
|
| 166 |
+
|
| 167 |
+
Theorem 3. For $0 \leq j \leq K - 1 _ { \mathrm { { \cdot } } }$ let $\{ \phi _ { \ell } ^ { ( i ) } \} _ { \ell = 1 } ^ { N _ { i } }$ for $i = j + 1 , . . . , K$ be the Haar bases for the $( \mathscr { G } _ { j \to K } , W _ { j \to K } )$ at layer $i$ . Then, the compressive Haar transform for the jth HaarPooling layer can be computed by, for the feature $X \in \mathbb { R } ^ { N _ { j } \times d _ { j } }$ and $\ell = 1 , \ldots , N _ { j }$ ,
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\left( \Phi _ { j } ^ { T } X \right) _ { \ell } = \sum _ { k = 1 } ^ { N _ { i } } \mathcal { S } ^ { ( i ) } \big ( X , v _ { k } ^ { ( i ) } \big ) w _ { k } ^ { ( i ) } \phi _ { \ell } ^ { ( i ) } ( v _ { k } ^ { ( i ) } ) ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
where i is the largest possible number in $\{ j + 1 , \ldots , K \}$ such that $\phi _ { \ell } ^ { ( i ) }$ is the \`th member of the orthonormal basis $\{ { \phi } _ { \ell } ^ { ( i ) } \} _ { \ell = 1 } ^ { N _ { i } } f o r l _ { 2 } ( \mathcal { G } _ { i } ) _ { \ell }$ , $v _ { k } ^ { ( i ) }$ are the vertices of $\mathcal { G } _ { i }$ \`and the weights $w _ { k } ^ { ( i ) }$ are given by
|
| 174 |
+
|
| 175 |
+
We give the algorithmic implementation of Theorem 3 in Algorithm 1, which provides a fast algorithm for HaarPooling at each layer.
|
| 176 |
+
|
| 177 |
+
Computational complexity With increasing graph size, the sparsity of the Haar basis matrix $\widetilde { \Phi } _ { j }$ becomes more pronounced (Li et al., 2019). This sparsity implies fast computation for HaarPooling. The computational complexity of HaarPooling is determined by the adjoint Haar transforms. In the first step of Algorithm 1, the total number of summations for all elements of Step 1 is no more than $\textstyle \sum _ { i = 0 } ^ { j - 1 } { \bar { N } } _ { i + 1 }$ ; In the second step, by the locality of the Haar basis, the total number of multiplication and summation operations is at most $\begin{array} { r } { 2 \sum _ { \ell = 1 } ^ { N _ { j } } C = \mathcal { O } ( N _ { j } ) } \end{array}$ . Here $C$ is the constant which bounds the number of different values of the Haar basis vector. Thus, the computational cost of Algorithm 1 is $\mathcal { O } ( N _ { j } )$ .
|
| 178 |
+
|
| 179 |
+
We run an experiment to evaluate the CPU computational time of HaarPooling by Algorithm 1 against the direct matrix product. We use randomly generated graphs and features with size ranging from 2 to 5000. As shown in Figure 5, the fast HaarPooling has computational cost nearly proportional to the number of nodes $N$ , while the ordinary matrix product incurs a cost close to order $\overset { \cdot } { \mathcal { O } } ( N ^ { 2 } )$ . These results are consistent with the computational complexity analysis given above.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 5: Comparison for fast computation and direct matrix product for HaarPooling for input feature array with up to 5000 nodes. The cost of HaarPooling has near linear computational complexity. The cost of direct matrix product grows at $\mathcal { O } ( N ^ { 2 . 1 } )$ .
|
| 183 |
+
|
| 184 |
+
# 5 EXPERIMENTS
|
| 185 |
+
|
| 186 |
+
Data sets To verify whether the proposed framework can hierarchically learn good graph representations for classification, we evaluate HaarPooling on five widely used benchmark data sets for graph classification (Kersting et al., 2016), including one protein graph data set PROTEINS (Borgwardt et al., 2005; Dobson & Doig, 2003); two mutagen data sets MUTAG (Debnath et al., 1991; Kriege & Mutzel, 2012) and MUTAGEN (Riesen & Bunke, 2008; Kazius et al., 2005) (full name Mutagenicity); and two data sets that consist of chemical compounds screened for activity against non-small cell lung cancer and ovarian cancer cell lines, NCI1 and NCI109 (Wale et al., 2008). We include data sets from different domains, sample and graph sizes to give a comprehensive understanding of how HaarPooling performs with data sets in various scenarios. A summary information of the data sets is given in Table 1, which shows the data sets containing graphs with different sizes and structures: the number of data samples ranges from 188 to 4,337, the average number of nodes is from 17.93 to 39.06 and the average number of edges is from 19.79 to 72.82.
|
| 187 |
+
|
| 188 |
+
Table 1: Summary statistics of the data sets used in our experiments
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Data Set</td><td>MUTAG</td><td>PROTEINS</td><td>NCI1</td><td>NCI109</td><td>MUTAGEN</td></tr><tr><td>max #nodes</td><td>28</td><td>620</td><td>111</td><td>111</td><td>417</td></tr><tr><td>min #nodes</td><td>10</td><td>4</td><td>3</td><td>4</td><td>4</td></tr><tr><td>avg #nodes</td><td>17.93</td><td>39.06</td><td>29.87</td><td>29.68</td><td>30.32</td></tr><tr><td>avg #edges</td><td>19.79</td><td>72.82</td><td>32.30</td><td>32.13</td><td>30.77</td></tr><tr><td>#graphs</td><td>188</td><td>1,113</td><td>4,110</td><td>4,127</td><td>4,337</td></tr><tr><td>#classes</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr></table>
|
| 191 |
+
|
| 192 |
+
Baselines and running environment We compare HaarPool with SortPool (Zhang et al., 2018a), DiffPool (Ying et al., 2018), gPool (Gao & Ji, 2019), SAGPool (Lee et al., 2019), EigenPool (Ma et al., 2019a), CSM (Kriege & Mutzel, 2012) and GIN (Xu et al., 2019) on the above data sets. The experiments use PyTorch Geometric1 (Fey & Lenssen, 2019) and were run in Google Cloud using 4 Nvidia Telsa T4 with 2560 CUDA cores, compute 7.5, 16GB GDDR6 VRAM.
|
| 193 |
+
|
| 194 |
+
Training procedures In experiments, we use a GNN with at most 3 GCN (Kipf & Welling, 2017) convolutional layers plus one HaarPooling layer, followed by three fully connected layers. The hyperparameters of the network are adjusted case by case. We use spectral clustering, which exploits the eigenvalues of the graph Laplacian, to generate a chain with the number of layers given. Spectral clustering has shown good performance in coarsening a variety of data patterns and can handle isolated nodes.
|
| 195 |
+
|
| 196 |
+
We use random shuffling of the data set, which we split into training, validation, and test sets with proportions $8 0 \%$ , $1 0 \%$ and $1 0 \%$ respectively. We use the Adam optimizer (Kingma & Ba, 2015), early stopping criterion, patience. The specific values are provided in the appendix. The early stopping criterion was that the validation loss does not improve for 50 epochs, with a maximum of 150 epochs, as suggested by Shchur et al. (2018).
|
| 197 |
+
|
| 198 |
+
Results The classification test accuracy is reported in Table 6. GNNs with HaarPooling have excellent performance on all data sets. In 4 out of 5 datasets, it achieved top accuracy. This shows that HaarPooling with appropriate graph convolution, can achieve top performance on a variety of graph classification tasks, and in some cases improve state of the art by a few percent points.
|
| 199 |
+
|
| 200 |
+
Table 2: Performance comparison for graph classification tasks (test accuracy in percent, showing the standard deviation over 10 repetitions of the experiment).
|
| 201 |
+
|
| 202 |
+
<table><tr><td>Method</td><td>MUTAG</td><td>PROTEINS</td><td>NCI1</td><td>NCI109</td><td>MUTAGEN</td></tr><tr><td>CSM</td><td>85.4</td><td>1</td><td>1</td><td>1</td><td></td></tr><tr><td>GIN</td><td>89.4</td><td>76.2</td><td>82.7</td><td>1</td><td>1 1</td></tr><tr><td>SortPool</td><td>85.8</td><td>75.5</td><td>74.4</td><td>72.3*</td><td>78.8*</td></tr><tr><td>DiffPool</td><td>1</td><td>76.3</td><td>76.0*</td><td>74.1*</td><td>80.6*</td></tr><tr><td>gPool</td><td>1</td><td>77.7</td><td>1</td><td>1</td><td>1</td></tr><tr><td>SAGPool</td><td>1</td><td>72.1</td><td>74.2</td><td>74.1</td><td>1</td></tr><tr><td>EigenPool</td><td>二</td><td>76.6</td><td>77.0</td><td>74.9</td><td>79.5</td></tr><tr><td>HaarPool</td><td>90.0±3.6</td><td>80.4±1.8</td><td>78.6±0.5</td><td>75.6±1.2</td><td>80.9±1.5</td></tr></table>
|
| 203 |
+
|
| 204 |
+
‘\*’ means that the records are retrieved from EigenPool (Ma et al., 2019a), ‘–’ means that there is no public records for the corresponding method on the data set, and the bold number indicates the best performance in the list.
|
| 205 |
+
|
| 206 |
+
# 6 CONCLUSION
|
| 207 |
+
|
| 208 |
+
We introduced a new graph pooling method called HaarPooling. HaarPooling has a mathematical formalism derived from compressive Haar transforms. Unlike existing graph pooling methods, HaarPooling takes into account both the graph structure and also the features over the nodes of the graph-structured input data, to compute a coarsened representation. As an individual unit, HaarPooling can be applied in conjunction with any type of graph convolution in GNNs. We show in experiments that HaarPooling reaches state of the art in several benchmark graph classification tasks. Moreover, having only linear computational complexity in the size of the inputs, HaarPooling is a very fast pooling method.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Mihael Ankerst, Markus M Breunig, Hans-Peter Kriegel, and Jorg Sander. Optics: ordering points¨ to identify the clustering structure. In ACM Sigmod Record, volume 28, pp. 49–60. ACM, 1999.
|
| 213 |
+
|
| 214 |
+
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.
|
| 215 |
+
|
| 216 |
+
Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of Machine Learning Research, 7(Nov):2399–2434, 2006.
|
| 217 |
+
|
| 218 |
+
Karsten M Borgwardt, Cheng Soon Ong, Stefan Schonauer, SVN Vishwanathan, Alex J Smola, and ¨ Hans-Peter Kriegel. Protein function prediction via graph kernels. Bioinformatics, 21(suppl 1): i47–i56, 2005.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Cat˘ alina Cangea, Petar Veli ˘ ckovi ˇ c, Nikola Jovanovi ´ c, Thomas Kipf, and Pietro Li ´ o. Towards sparse \` hierarchical graph classifiers. In Workshop on Relational Representation Learning, NeurIPS, 2018.
|
| 223 |
+
|
| 224 |
+
C. K. Chui, H.N. Mhaskar, and X. Zhuang. Representation of functions on big data associated with directed graphs. Applied and Computational Harmonic Analysis, 44(1):165 – 188, 2018. ISSN 1063-5203. doi: https://doi.org/10.1016/j.acha.2016.12.005.
|
| 225 |
+
|
| 226 |
+
C.K. Chui, F. Filbir, and H.N. Mhaskar. Representation of functions on big data: graphs and trees. Applied and Computational Harmonic Analysis, 38(3):489 – 509, 2015.
|
| 227 |
+
|
| 228 |
+
Fan RK Chung and Fan Chung Graham. Spectral graph theory. American Mathematical Society, 1997.
|
| 229 |
+
|
| 230 |
+
Ingrid Daubechies. Ten lectures on wavelets. SIAM, 1992.
|
| 231 |
+
|
| 232 |
+
Asim Kumar Debnath, Rosa L. Lopez de Compadre, Gargi Debnath, Alan J. Shusterman, and Corwin Hansch. Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro compounds. correlation with molecular orbital energies and hydrophobicity. Journal of Medicinal Chemistry, 34(2):786–797, 1991. doi: 10.1021/jm00106a046.
|
| 233 |
+
|
| 234 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In NIPS, pp. 3844–3852, 2016.
|
| 235 |
+
|
| 236 |
+
Frederik Diehl, Thomas Brunner, Michael Truong Le, and Alois Knoll. Towards graph pooling by edge contraction. In ICML 2019 Workshop on Learning and Reasoning with Graph-Structured Data, 2019.
|
| 237 |
+
|
| 238 |
+
Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. Journal of Molecular Biology, 330(4):771–783, 2003.
|
| 239 |
+
|
| 240 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In NIPS, pp. 2224–2232, 2015.
|
| 241 |
+
|
| 242 |
+
Martin Ester, Hans-Peter Kriegel, Jorg Sander, Xiaowei Xu, et al. A density-based algorithm for ¨ discovering clusters in large spatial databases with noise. In KDD, volume 96, pp. 226–231, 1996.
|
| 243 |
+
|
| 244 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. In Workshop on Representation Learning on Graphs and Manifolds, ICLR, 2019.
|
| 245 |
+
|
| 246 |
+
Hongyang Gao and Shuiwang Ji. Graph U-Nets. ICML, pp. 2083–2092, 2019.
|
| 247 |
+
|
| 248 |
+
Matan Gavish, Boaz Nadler, and Ronald R Coifman. Multiscale wavelets on trees, graphs and high dimensional data: theory and applications to semi supervised learning. In ICML, pp. 367–374, 2010.
|
| 249 |
+
|
| 250 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In ICML, pp. 1263–1272, 2017.
|
| 251 |
+
|
| 252 |
+
Alfred Haar. Zur theorie der orthogonalen funktionensysteme. Mathematische Annalen, 69(3): 331–371, 1910.
|
| 253 |
+
|
| 254 |
+
David K Hammond, Pierre Vandergheynst, and Remi Gribonval. Wavelets on graphs via spectral ´ graph theory. Applied and Computational Harmonic Analysis, 30(2):129–150, 2011.
|
| 255 |
+
|
| 256 |
+
George Karypis and Vipin Kumar. A fast and high quality multilevel scheme for partitioning irregular graphs. SIAM Journal on Scientific Computing, 20(1):359–392, 1998.
|
| 257 |
+
|
| 258 |
+
Jeroen Kazius, Ross McGuire, and Roberta Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of Medicinal Chemistry, 48(1):312–320, 2005.
|
| 259 |
+
|
| 260 |
+
Kristian Kersting, Nils M. Kriege, Christopher Morris, Petra Mutzel, and Marion Neumann. Benchmark data sets for graph kernels, 2016. URL http://graphkernels.cs.tu-dortmund. de.
|
| 261 |
+
|
| 262 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 263 |
+
|
| 264 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 265 |
+
|
| 266 |
+
Boris Knyazev, Graham W. Taylor, and Mohamed R. Amer. Understanding attention and generalization in graph neural networks. In NeurIPS, 2019.
|
| 267 |
+
|
| 268 |
+
Nils Kriege and Petra Mutzel. Subgraph matching kernels for attributed graphs. In ICML, pp. 291–298, 2012.
|
| 269 |
+
|
| 270 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In ICML, pp. 3734–3743, 2019.
|
| 271 |
+
|
| 272 |
+
Ming Li, Zheng Ma, Yu Guang Wang, and Xiaosheng Zhuang. Fast Haar transforms for graph neural networks. arXiv preprint arXiv:1907.04786, 2019.
|
| 273 |
+
|
| 274 |
+
Yao Ma, Suhang Wang, Charu C. Aggarwal, and Jiliang Tang. Graph convolutional networks with EigenPooling. In KDD, pp. 723–731, 2019a.
|
| 275 |
+
|
| 276 |
+
Zheng Ma, Ming Li, and Yu Guang Wang. PAN: Path integral based convolution for deep graph neural networks. In Workshop on Learning and Reasoning with Graph-Structured Representation. ICML, 2019b.
|
| 277 |
+
|
| 278 |
+
Emmanuel Noutahi, Dominique Beani, Julien Horwood, and Prudencio Tossou. Towards interpretable sparse graph representation learning with Laplacian pooling. arXiv preprint arXiv:1905.11577, 2019.
|
| 279 |
+
|
| 280 |
+
M. K. Pakhira. A linear time-complexity k-means algorithm using cluster shifting. In 2014 International Conference on Computational Intelligence and Communication Networks, pp. 1047–1051, 2014. doi: 10.1109/CICN.2014.220.
|
| 281 |
+
|
| 282 |
+
Kaspar Riesen and Horst Bunke. IAM graph database repository for graph based pattern recognition and machine learning. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pp. 287–297. Springer, 2008.
|
| 283 |
+
|
| 284 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pit- ¨ falls of graph neural network evaluation. In Workshop on Relational Representation Learning, NeurIPS, 2018.
|
| 285 |
+
|
| 286 |
+
Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. Departmental Papers (CIS), pp. 107, 2000.
|
| 287 |
+
|
| 288 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In ICLR, 2015.
|
| 289 |
+
|
| 290 |
+
Nikil Wale, Ian A Watson, and George Karypis. Comparison of descriptor spaces for chemical compound retrieval and classification. Knowledge and Information Systems, 14(3):347–375, 2008.
|
| 291 |
+
|
| 292 |
+
Yu Guang Wang and Xiaosheng Zhuang. Tight framelets and fast framelet filter bank transforms on manifolds. Applied and Computational Harmonic Analysis, 2018. doi: 10.1016/j.acha.2018.02. 001.
|
| 293 |
+
|
| 294 |
+
Yu Guang Wang and Xiaosheng Zhuang. Tight framelets on graphs for multiscale analysis. In Wavelets and Sparsity XVIII, SPIE Proc., pp. 11138–11, 2019.
|
| 295 |
+
|
| 296 |
+
Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S Yu. A comprehensive survey on graph neural networks. arXiv preprint arXiv:1901.00596, 2019.
|
| 297 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 298 |
+
Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In NeurIPS, pp. 4800–4810, 2018.
|
| 299 |
+
Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
|
| 300 |
+
Ziwei Zhang, Peng Cui, and Wenwu Zhu. Deep learning on graphs: A survey. arXiv preprint arXiv:1812.04202, 2018b.
|
| 301 |
+
Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, and Maosong Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
|
| 302 |
+
|
| 303 |
+
# A GRAPH CLASSIFICATION
|
| 304 |
+
|
| 305 |
+
Graph classification This task is to categorize graph-structured data into several classes. The training set consists of $M$ pairs of samples $\mathbf { \bar { \Psi } } ( x _ { i } , \mathcal { G } _ { i } ) , \mathbf { \bar { y } } _ { i } )$ , $i = 1 , \dots , M$ . For the ith sample, $\mathcal { G } _ { i } =$ $( V _ { i } , E _ { i } , W _ { i } )$ is a graph with vertex set $V _ { i }$ of size $| V _ { i } | = N _ { i }$ (also called nodes), and edge set $E _ { i }$ with weights $W _ { i }$ . The feature $x _ { i } \in \mathbb { R } ^ { N _ { i } \times d }$ is an array of $d$ features per vertex, i.e., an $\mathbb { R } ^ { d }$ -valued function over $V _ { i }$ . The label $y _ { i }$ is an integer from a finite set indicating which class the input sample $( x _ { i } , \mathcal { G } _ { i } )$ lies in. The number of nodes $N _ { i }$ and the graph structure $E _ { i } , W _ { i }$ usually vary over the different input samples.
|
| 306 |
+
|
| 307 |
+
Graph neural networks Deep graph neural networks (GNNs) are designed to work with graphstructured inputs of the form $( x _ { i } , \mathcal { G } _ { i } )$ described above. A GNN is typically composed of multiple graph convolution layers, graph pooling layers, and fully connected layers. A (graph) convolutional layer extracts an array of features from the previous array. It changes the dimension $d$ of the feature array but does not change the number of nodes $N _ { i }$ . Since the number of nodes of different inputs is variable, the number of nodes of the corresponding outputs is also variable. This raises new challenges in comparison with traditional image classification tasks, where the local structure connecting pixels is always fixed (even if the number of pixels might be variable).
|
| 308 |
+
|
| 309 |
+
Graph pooling In GNNs, one uses graph pooling to reduce the first dimension $N$ of the feature arrays, and more importantly, to obtain outputs of uniform dimension (commonly followed by fully connected layers). A general architecture uses a cascade of convolutional and pooling layers. Figure 2 illustrates such an architecture with three blocks of graph convolutional and pooling layers, followed by a multi-layer perceptron (MLP) with three fully connected layers. In practice, each block can include several convolutional layers but use only one pooling layer at most. The exact architecture of GNNs with combined convolutional and pooling layers is mainly dependent upon the particular problem and the data set and is designed case by case.
|
| 310 |
+
|
| 311 |
+
# B CONSTRUCTION OF HAAR BASIS
|
| 312 |
+
|
| 313 |
+
Construction of Haar basis. With a chain of the graph, one can generate a Haar basis for $l _ { 2 } ( \mathcal { G } )$ following Chui et al. (2015), see also Gavish et al. (2010). We show the construction of Haar basis on $\mathcal { G }$ , as follows.
|
| 314 |
+
|
| 315 |
+
Step 1. Let $\mathcal { G } ^ { \mathrm { c g } } = ( V ^ { \mathrm { c g } } , E ^ { \mathrm { c g } } , w ^ { \mathrm { c g } } )$ be a coarse-grained graph of $\mathcal { G } = ( V , E , w )$ with $N ^ { \mathrm { c g } } : = | V ^ { \mathrm { c g } } |$ . ∈ degrees of vertices or weights of vertices, as Each vertex $v ^ { \mathrm { c g } } \in V ^ { \mathrm { c g } }$ is a cluster $v ^ { \mathrm { c g } } = \{ v \ \bar { } \in \ V \vert v$ $V ^ { \mathrm { c g } } = \{ v _ { 1 } ^ { \mathrm { c g } } , \ldots , v _ { N ^ { \mathrm { c g } } } ^ { \mathrm { c g } } \}$ has parent $v ^ { \mathrm { c g } } \}$ } G. We define of . Order $N ^ { \mathrm { c g } }$ vectors , e.g., by $\phi _ { \ell } ^ { \mathrm { c g } }$ on ${ \mathcal { G } } ^ { \mathrm { c g } }$ by
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\phi _ { 1 } ^ { \mathrm { c g } } ( v ^ { \mathrm { c g } } ) : = \frac { 1 } { \sqrt { N ^ { \mathrm { c g } } } } , \quad v ^ { \mathrm { c g } } \in V ^ { \mathrm { c g } } ,
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
and for $\ell = 2 , \ldots , N ^ { \mathrm { c g } }$ ,
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\phi _ { \ell } ^ { \mathrm { c g } } : = \sqrt { \frac { N ^ { \mathrm { c g } } - \ell + 1 } { N ^ { \mathrm { c g } } - \ell + 2 } } \left( \chi _ { \ell - 1 } ^ { \mathrm { c g } } - \frac { \sum _ { j = \ell } ^ { N ^ { \mathrm { c g } } } \chi _ { j } ^ { \mathrm { c g } } } { N ^ { \mathrm { c g } } - \ell + 1 } \right) ,
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $\chi _ { j } ^ { \mathrm { c g } }$ is the indicator function for the $j$ th vertex $v _ { j } ^ { \mathrm { c g } } \in V ^ { \mathrm { c g } }$ on $\mathcal { G }$ given by
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\begin{array} { r } { \chi _ { j } ^ { \mathrm { c g } } ( v ^ { \mathrm { c g } } ) : = \left\{ \begin{array} { l l } { 1 , } & { v ^ { \mathrm { c g } } = v _ { j } ^ { \mathrm { c g } } , } \\ { 0 , } & { v ^ { \mathrm { c g } } \in V ^ { \mathrm { c g } } \backslash \{ v _ { j } ^ { \mathrm { c g } } \} . } \end{array} \right. } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Then, one can show that $\{ \phi _ { \ell } ^ { \mathrm { c g } } \} _ { \ell = 1 } ^ { N ^ { \mathrm { c g } } }$ forms an orthonormal basis for $l _ { 2 } ( \mathcal { G } ^ { \mathrm { c g } } )$ .
|
| 334 |
+
|
| 335 |
+
Note that each $v \in V$ belongs to exactly one cluster $v ^ { \mathrm { c g } } \in V ^ { \mathrm { c g } }$ . In view of this, for each $\ell =$ $1 , \ldots , N ^ { \mathrm { c g } }$ , we can extend the vector $\phi _ { \ell } ^ { \mathrm { c g } }$ on ${ \mathcal { G } } ^ { \mathrm { c g } }$ to a vector $\phi _ { \ell , 1 }$ on $\mathcal { G }$ by
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\phi _ { \ell , 1 } ( v ) : = \frac { \phi _ { \ell } ^ { \mathrm { c g } } ( v ^ { \mathrm { c g } } ) } { \sqrt { | v ^ { \mathrm { c g } } | } } , \quad v \in v ^ { \mathrm { c g } } ,
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
here $| v ^ { \mathrm { c g } } | : = k _ { \ell }$ is the size of the cluster $v ^ { \mathrm { c g } }$ , i.e., the number of vertices in $\mathcal { G }$ whose common parent is $v ^ { \mathrm { c g } }$ . We order the cluster $v _ { \ell } ^ { \mathrm { c g } }$ , e.g., by degrees of vertices, as
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
v _ { \ell } ^ { \mathrm { c g } } = \{ v _ { \ell , 1 } , \ldots , v _ { \ell , k _ { \ell } } \} \subseteq V .
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
For $k = 2 , \ldots , k _ { \ell }$ , similar to equation 11, define
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\phi _ { \ell , k } = \sqrt { \frac { k _ { \ell } - k + 1 } { k _ { \ell } - k + 2 } } \left( \chi _ { \ell , k - 1 } - \frac { \sum _ { j = k } ^ { k _ { \ell } } \chi _ { \ell , j } } { k _ { \ell } - k + 1 } \right) .
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
where for $j = 1 , \ldots , k _ { \ell } , \chi _ { \ell , j }$ is given by
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\chi _ { \ell , j } ( v ) : = \{ \boldsymbol { 1 } , \quad v = v _ { \ell , j } , \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
One can show that the resulting $\{ \phi _ { \ell , k } : \ell = 1 , \ldots , N ^ { \mathrm { c g } } , k = 1 , \ldots , k _ { \ell } \}$ is an orthonormal basis for $l _ { 2 } ( \mathcal { G } )$ .
|
| 360 |
+
|
| 361 |
+
Step 2. Let $\mathcal { G } _ { 0 J }$ be a coarse-grained chain for the graph $\mathcal { G }$ . An orthonormal basis $\{ \phi _ { \ell } ^ { ( J ) } \} _ { \ell = 1 } ^ { N _ { J } }$ $j = 0 , \dots , J - 1$ rated using equation 10 and equati, we generate an orthonormal basis $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 1 } ^ { N _ { j } }$ e thefor $l _ { 2 } ( \mathcal { G } _ { j } )$ atedly use Step 1: forfrom the orthonormal basis $\{ { \phi } _ { \ell } ^ { ( j + 1 ) } \} _ { \ell = 1 } ^ { N _ { j + 1 } }$ for the coarse-grained graph $\mathcal { G } _ { j + 1 }$ that was derived in the previous steps. We call the sequence {φ\` := φ(0)\` }N0\`=1 o f vectors at the finest level, the Haar global orthonormal basis or for , s for is ca $\mathcal { G }$ associated with the chain d the associated (orthonor $\mathcal { G } _ { 0 J }$ . The orthonormal basbasis for the Haar basis $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 1 } ^ { N _ { j } }$ $l _ { 2 } ( \mathcal { G } _ { j } )$ $j = 1 , \dots , J$ $\{ \phi _ { \ell } \} _ { \ell = 1 } ^ { N }$
|
| 362 |
+
|
| 363 |
+
Besides the orthogonality, the Haar basis has the locality which is critical to the fast computation of HaarPooling.
|
| 364 |
+
|
| 365 |
+
Comlayer ssive Haar of the chain Suppose we have constructed the (ful. The compressive Haar basis for layer His $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 0 } ^ { N _ { j } }$ for each $\mathcal { G } _ { j }$ $\mathscr { G } _ { 0 \to K }$ $j$ $\{ \phi _ { \ell } ^ { ( j ) } \} _ { \ell = 0 } ^ { N _ { j + 1 } }$
|
| 366 |
+
|
| 367 |
+
# C FAST COMPUTATION FOR HAARPOOLING
|
| 368 |
+
|
| 369 |
+
Let $\mathscr { G } _ { 0 \to K }$ be a coarse-grained chain of the graph $\mathcal { G } _ { 0 }$ . For convenience, we label the vertices of the level- $j$ graph $\mathcal { G } _ { j }$ by $V _ { j } : = \{ v _ { 1 } ^ { ( j ) } , \ldots , v _ { N _ { j } } ^ { ( j ) } \}$ .
|
| 370 |
+
|
| 371 |
+
Fast algorithm for HaarPooling The HaarPooling in equation 3 can be computed fast by using the hierarchical structure of the chain, as we introduce as follows. For $j = 1 , \ldots , K$ , let $c _ { k } ^ { ( j ) }$ be the for number of children of $k = 1 , \ldots , N _ { j }$ . For $v _ { k } ^ { ( j ) }$ $j = 0$ , i.e. the number of vertices of , we let $c _ { k } ^ { ( 0 ) } \equiv 1$ for $k = 1 , \ldots , N _ { 0 }$ $\mathcal { G } _ { j - 1 }$ which belongs to the cluster . Now, for $j = 0 , \ldots , K$ $v _ { k } ^ { ( j ) }$ kand , $k = 1 , \dots , N _ { j }$ , define the weight for the node $v _ { k } ^ { ( j ) }$ of layer $j$ by
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
w _ { k } ^ { ( j ) } : = \frac { 1 } { \sqrt { c _ { k } ^ { ( j ) } } } .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
$W _ { 0 \to K } : = \{ w _ { k } ^ { ( j ) } | j = 0 , \ldots , K , k = 1 , \ldots , N _ { j } \}$ . Then, f the chain $j = 0 , \ldots , K$ , the weighted chainast two children. See $( \mathscr { G } _ { j \to K } , W _ { j \to K } )$ $\mathscr { G } _ { j K }$ e.g. (Chui et al., 2015, Definition 2.3).
|
| 378 |
+
|
| 379 |
+
# D PROOFS
|
| 380 |
+
|
| 381 |
+
Proof for equation $5$ . We only need to prove the first formula. The second is obtained by definition. To simplify notation, we let $\bar { \boldsymbol { f } } = { \boldsymbol { X } } _ { j } ^ { \mathrm { i n } }$ . By construction of Haar basis, for some layer $j$ , the first $N _ { j + 1 }$ basis vectors
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\phi _ { \ell } ^ { ( j ) } ( v ) = \phi _ { \ell } ^ { ( j + 1 ) } ( p ) / \sqrt { | P a _ { \mathcal { G } } ( v ) | } , \quad \mathrm { f o r } p = P a _ { \mathcal { G } } ( v ) .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Then, the Fourier coefficient of $f$ for the \`th basis vector is the inner product
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { l } { \left. f , \phi _ { \ell } ^ { ( j ) } \right. = \displaystyle \sum _ { v \in \mathcal { G } _ { j } } f ( v ) \overline { { \phi _ { \ell } ^ { ( j ) } ( v ) } } } \\ { = \displaystyle \sum _ { p \in \mathcal { G } _ { j + 1 } } \sum _ { p = P a _ { \mathcal { G } } ( v ) } f ( v ) \overline { { \phi _ { \ell } ^ { ( j + 1 ) } ( p ) } } / \sqrt { | P a _ { \mathcal { G } } ( v ) | } } \\ { = \displaystyle \sum _ { p \in \mathcal { G } _ { j + 1 } } \widetilde { f } ( p ) \overline { { \phi _ { \ell } ^ { ( j + 1 ) } ( p ) } } } \\ { = \left. \widetilde { f } , \phi _ { \ell } ^ { ( j + 1 ) } \right. } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
where we have let
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\widetilde { f } ( p ) : = \frac { 1 } { \sqrt { \left| P a _ { \mathcal { G } } ( v ) \right| } } \sum _ { p = P a _ { \mathcal { G } } ( v ) } f ( v ) .
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
This then gives
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\sum _ { \ell = 1 } ^ { N _ { j + 1 } } \left| \left. f , \phi _ { \ell } ^ { ( j ) } \right. \right| ^ { 2 } = \sum _ { \ell = 1 } ^ { N _ { j + 1 } } \left| \left. \widetilde { f } , \phi _ { \ell } ^ { ( j + 1 ) } \right. \right| ^ { 2 } .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Since {φ\`}Nj+1\`=1 forms an orthonormal basis on $\ell _ { 2 } ( \mathcal { G } _ { j + 1 } )$ ,
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\begin{array} { l } { \displaystyle \left\| \Phi _ { j } ^ { T } f \right\| ^ { 2 } = \sum _ { \ell = 1 } ^ { N _ { j + 1 } } \left| \left. \widetilde f , \phi _ { \ell } ^ { ( j + 1 ) } \right. \right| ^ { 2 } = \left\| \widetilde f \right\| ^ { 2 } = \sum _ { p \in \mathcal { G } _ { j + 1 } } \left| \widetilde f ( p ) \right| ^ { 2 } } \\ { \displaystyle \qquad = \sum _ { p \in \mathcal { G } _ { j + 1 } } \left| \frac { 1 } { \sqrt { \left| P a _ { \mathcal { G } } ( v ) \right| } } \sum _ { p = P a _ { \mathcal { G } } ( v ) } f ( v ) \right| ^ { 2 } . } \end{array}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
This proves the left formula in equation 5.
|
| 412 |
+
|
| 413 |
+
Proof of Theorem 3. By the relation between $\phi _ { \ell } ^ { ( i ) }$ and $\phi _ { \ell } ^ { ( j ) }$ , for $i \ = \ j + 1 , \ldots , K$ and $\ell \ =$ $1 , \ldots , N _ { j + 1 }$ ,
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { r l } { \langle \theta ^ { \dagger } \rangle ^ { * } \mathcal { X } _ { i } \rangle _ { i } = } & { \frac { \nu _ { 0 } } { \lambda _ { 0 } } \mathcal { X } _ { i } ^ { ( \nu _ { 0 } ) } \frac { \partial } { \partial \alpha _ { i } } \langle \theta ^ { \dagger } \rangle _ { i \alpha } ^ { * } } \\ & { = \frac { \nu _ { 0 } } { \lambda _ { 0 } } \left( \underbrace { \sum _ { i = 1 } ^ { N } \frac { \partial \left( \theta ^ { \dagger } \right) ^ { * } } { \partial \alpha _ { i } } \sum _ { \alpha = 1 } ^ { N } \lambda _ { 0 } \langle \theta ^ { \dagger } \rangle _ { i \alpha } } _ { \displaystyle \left\{ \begin{array} { l } { 1 , \dots , N } } \\ { \frac { \partial } { \partial \alpha _ { i } } \sum _ { \alpha = 1 } ^ { N } \lambda _ { i } \Big [ \epsilon _ { i } \partial _ { i } ^ { \alpha } \epsilon _ { i } ^ { \alpha } } \end{array} ^ { * } } \right. } \\\right\ & \right]{ = \frac { \nu _ { 0 } } { \lambda _ { 0 } } \left( \underbrace { \sum _ { i = 1 } ^ { N } \frac { \partial \left( \theta ^ { \dagger } \right) ^ { * } } { \partial \alpha _ { i } } \sum _ { \alpha = 1 } ^ { N } \lambda _ { 0 } \left( \frac { \partial \theta ^ { \dagger } } { \partial \alpha _ { i } } \right) ^ { * } } _ { \displaystyle \left\{ \begin{array} { l } { 1 , \dots , N } } \\ { \frac { \partial } { \partial \alpha _ { i } } \sum _ { \alpha = 1 } ^ { N } \lambda _ { i } \Big [ \epsilon _ { i } \partial _ { i } ^ { \alpha } \epsilon _ { i } ^ { \alpha } } \end{array} } \frac { \par\right\tial ^ { 2 } \alpha ^ { 2 } \sigma ^ { 2 } \sigma ^ { 2 } \sigma ^ { 2 } \sigma ^ { 2 } \sigma ^ { 2 } } { \partial \alpha _ { i } ^ { 2 } } \left( \epsilon _ { i } ^ { 2 } \partial _ { i } ^ { \alpha } \epsilon _ { i } ^ { \alpha } \right) } \\ & \right) = \frac { \nu _ { 0 } } { \lambda _ { 0 } ^ { 2 } \sigma ^ { 2 } } \left( \underbrace \sum _ { i = 1 } ^ { N } \frac { \partial \left( \theta ^ { \dagger } \right) ^ { * } } { \partial \alpha _ { i } ^ { 2 } } \partial _ { i } ^ { \alpha } \partial _ { i } ^ { \alpha } \epsilon \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
where $v _ { k ^ { \prime } } ^ { ( j + 1 ) }$ is the parent of $v _ { k } ^ { ( j ) }$ and $v _ { k ^ { \prime \prime } } ^ { ( j + 2 ) }$ is the parent of $v _ { k } ^ { ( j + 1 ) }$ , and we recursively compute the summation to obtain the last equality, thus completing the proof.
|
| 420 |
+
|
| 421 |
+
# E EXPERIMENTAL SETTING
|
| 422 |
+
|
| 423 |
+
The architecture of GNN is identified by the layer type and the number of hidden nodes at each layer. For example, we denote 3GC256-HP-2FC256-FC128 to represent a GNN architecture with 3 GCNConv layers each with 256 hidden nodes plus one HaarPooling layer followed by 2 fully connected layers each with 256 hidden nodes and 1 fully connected layer with 128 hidden nodes. The architecture for each data set is shown by Table 3.
|
| 424 |
+
|
| 425 |
+
The hyperparameters include batch size; learning rate, weight decay rate (these two for optimization); maximum number of epochs; patience for early stopping. The choice of hyperparameters in each data set is shown in Table 4.
|
| 426 |
+
|
| 427 |
+
Table 3: Network architecture
|
| 428 |
+
|
| 429 |
+
<table><tr><td>Data Set</td><td>Layers and #Hidden Nodes</td></tr><tr><td>MUTAG</td><td>GC60-HP-FC60-FC180-FC60</td></tr><tr><td>PROTEINS</td><td>2GC128-HP-2GC128-HP-2GC128-HP-GC128-2FC128-FC64</td></tr><tr><td>NCI1</td><td>2GC256-HP-FC256-FC1024-FC2048</td></tr><tr><td>NCI109</td><td>3GC256-HP-2FC256-FC128</td></tr><tr><td>MUTAGEN</td><td>3GC256-HP-2FC256-FC128</td></tr></table>
|
| 430 |
+
|
| 431 |
+
# F GNN WITH HAARPOOLING ON TRIANGLES
|
| 432 |
+
|
| 433 |
+
We test GNN with HaarPooling on graph data set Triangles (Knyazev et al., 2019). Triangles is a 10 classification problem with 45000 graphs. The average numbers of nodes and edges of graphs are
|
| 434 |
+
|
| 435 |
+
Table 4: Hyperparameter setting
|
| 436 |
+
|
| 437 |
+
<table><tr><td>Data Set</td><td>MUTAG</td><td>PROTEINS</td><td>NCI1</td><td>NCI109</td><td>MUTAGEN</td></tr><tr><td>batch size</td><td>60</td><td>50</td><td>100</td><td>100</td><td>100</td></tr><tr><td>max #epochs</td><td>30</td><td>20</td><td>150</td><td>150</td><td>50</td></tr><tr><td>early stopping</td><td>15</td><td>20</td><td>50</td><td>50</td><td>50</td></tr><tr><td>learning rate</td><td>0.01</td><td>0.001</td><td>0.001</td><td>0.01</td><td>0.01</td></tr><tr><td>weight decay</td><td>0.0005</td><td>0.0005</td><td>0.0005</td><td>0.0001</td><td>0.0005</td></tr></table>
|
| 438 |
+
|
| 439 |
+
20.85 and 32.74 respectively. In the experiments, the network uses GIN convolution (Xu et al., 2019) as graph convolution and with HaarPooling or SAGPooling (Lee et al., 2019). With SAGPooling, the network architecture uses two combined layers of GIN convolution and SAGPooling followed by combined layers of GIN convolution and global max pooling, denoted by GIN-SP-GIN-SP-GIN-MP, where SP means the SAGPooling and MP means global max pooling. With HaarPooling, we test with two architectures: GIN-HP-GIN-HP-GIN-MP and GIN-HP-GIN-GIN-MP, where HP means HaarPooling. The data for training, validation and test are 35000, 5000 and 10000 respectively. The hidden nodes in convoluational layers is 64, batch size is 60 and learning rate is 0.001.
|
| 440 |
+
|
| 441 |
+
Table 5 shows the test accuracy of the three networks. It illustrates that both networks with HaarPooling outperform that with the SAGPooling.
|
| 442 |
+
|
| 443 |
+
Table 5: Training, validation and test accuracies on Triangles
|
| 444 |
+
|
| 445 |
+
<table><tr><td rowspan="2">Architecture</td><td colspan="3">Accuracy (%)</td></tr><tr><td>Training</td><td>Validation</td><td>Test</td></tr><tr><td>GIN-SP-GIN-SP-GIN-MP</td><td>45.6</td><td>45.3</td><td>44.0</td></tr><tr><td>GIN-HP-GIN-HP-GIN-MP</td><td>47.5</td><td>46.3</td><td>46.1</td></tr><tr><td>GIN-HP-GIN-GIN-MP</td><td>47.3</td><td>45.8</td><td>45.5</td></tr></table>
|
| 446 |
+
|
| 447 |
+
# G PROPERTY COMPARISON OF POOLING METHODS
|
| 448 |
+
|
| 449 |
+
Here we provide a comparison of the properties of HaarPooling with existing pooling methods. The properties in comparison includes time complexity and space complexity, and whether involving the clustering, hierarchical pooling (which is then not a global pooling), spectral-based, node feature or graph structure and sparse representation. We compare HaarPooling (denoted by HaarPool in the table) to other methods (SortPool, DiffPool, gPool, SAGPool and EigenPool). The SortPool (i.e. SortPooling) is a global pooling which uses node signature (i.e. Weisfeiler-Lehman color of vertex) sorts all vertices by the values of the channels of the input data. Thus, the time complexity (worst case) of SortPool is $\mathcal { O } ( | V | ^ { 2 } )$ and space complexity is $\mathcal { O } ( | V | )$ . Other pooling methods are all hierarchical pooling. DiffPool and gPool both use the node feature and have time complexity $\mathcal { O } ( | V | ^ { 2 } )$ The DiffPool learns the assignment matrices in end-to-end manner and has space complexity ${ \dot { \mathcal { O } } } ( k | V | ^ { 2 } )$ for pooling ratio $k$ . The $\mathrm { \ g P o o l }$ projects all nodes to a learnable vector to generate scores for nodes, and then sorts the nodes by the projection scores; the space complexity is $\mathsf { \tilde { O } } ( | V | + | E | )$ . SAGPool uses the graph convolution to calculate the attention scores of nodes and then selects top ranked nodes for pooling. The time complexity of SAGPool is $\mathcal { O } ( | E | )$ and the space complexity is $\mathcal { O } ( \left| V \right| + \left| E \right| )$ due to the sparsity of the pooling matrix. EigenPool, which considers both the node feature and graph structure, uses the eigedecomposition of subgraphs (from clustering) of the input graph, and pools the input data by Fourier transforms of the assembled basis matrix. Due to eigendecomposition, the time complexity of EigenPool is $\mathcal { O } ( | V | ^ { 2 } )$ and space complexity is $\mathcal { O } ( | V | ^ { 2 } )$ . HaarPool which uses the sparse representation of data by compressive Haar basis has linear time complexity $\mathcal { O } ( | V | )$ (up to a $\log | V |$ term), and the space complexity is $\mathcal { O } ( | V | ^ { 2 } \epsilon )$ , where $\epsilon$ is the sparsity of the compressive Haar transform matrix and is usually very small. From the table, we can observe the HaarPool is the only pooling method which has time complexity proportional to the number of nodes, and thus has faster implementation.
|
| 450 |
+
|
| 451 |
+
Table 6: Property comparison for pooling methods.
|
| 452 |
+
|
| 453 |
+
<table><tr><td>Method</td><td>Time Complexity</td><td>Space Complexity</td><td>Clustering- based</td><td>based</td><td>Spectral- Hierarchical Use Node Pooling</td><td>Feature</td><td>Use Graph Structure</td><td>Sparse Repre- :sentation</td></tr><tr><td>SortPool</td><td>0(IV12)</td><td>O(IVI)</td><td></td><td></td><td></td><td><</td><td></td><td></td></tr><tr><td>DiffPool</td><td>0(ivi2)</td><td>O(k|V|2)</td><td></td><td></td><td>√</td><td></td><td></td><td></td></tr><tr><td>gPool</td><td>0(ivi2)</td><td>O(IV|+|EI)</td><td></td><td></td><td>√</td><td>√</td><td></td><td></td></tr><tr><td>SAGPool</td><td>O(EI)</td><td>O(ivi+jEI)</td><td></td><td></td><td>√</td><td>√</td><td>√</td><td></td></tr><tr><td>EigenPool</td><td>0(iv12)</td><td>0(IV12)</td><td>√</td><td></td><td>√</td><td>√</td><td>√</td><td></td></tr><tr><td>HaarPool</td><td>0(IVI)</td><td>0(IV1²e)</td><td>√</td><td>√</td><td>√</td><td>√</td><td>√</td><td>√</td></tr></table>
|
| 454 |
+
|
| 455 |
+
$| \overline { { V | } } ^ { \star }$ is the number of vertices of the input graph; $\overline { { \cdot | E | } } ^ { | }$ is the number of edges of the input graph; $\overline { { \cdot \epsilon ^ { * } } }$ in HaarPooling is the sparsity of the compressive Haar transform matrix; $\cdot _ { k } ,$ in the DiffPool is the pooling ratio.
|
md/train/Bkgk624KDB/Bkgk624KDB.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING EFFECTIVE EXPLORATION STRATEGIES FOR CONTEXTUAL BANDITS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In contextual bandits, an algorithm must choose actions given observed contexts, learning from a reward signal that is observed only for the action chosen. This leads to an exploration/exploitation trade-off: the algorithm must balance taking actions it already believes are good with taking new actions to potentially discover better choices. We develop a meta-learning algorithm, MELˆ EE´ , that learns an exploration policy based on simulated, synthetic contextual bandit tasks. MELˆ EE´ uses imitation learning against these simulations to train an exploration policy that can be applied to true contextual bandit tasks at test time. We evaluate on both a natural contextual bandit problem derived from a learning to rank dataset as well as hundreds of simulated contextual bandit problems derived from classification tasks. MELˆ EE´ outperforms seven strong baselines on most of these datasets by leveraging a rich feature representation for learning an exploration strategy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In a contextual bandit problem, an agent attempts to optimize its behavior over a sequence of rounds based on limited feedback (Kaelbling, 1994; Auer, 2003; Langford & Zhang, 2008). In each round, the agent chooses an action based on a context (features) for that round, and observes a reward for that action but no others $( \ S 2 )$ . Contextual bandit problems arise in many real-world settings like online recommendations and personalized medicine. As in reinforcement learning, the agent must learn to balance exploitation (taking actions that, based on past experience, it believes will lead to high instantaneous reward) and exploration (trying actions that it knows less about).
|
| 12 |
+
|
| 13 |
+
In this paper, we present a meta-learning approach to automatically learn a good exploration mechanism from data. To achieve this, we use synthetic supervised learning data sets on which we can simulate contextual bandit tasks in an offline setting. Based on these simulations, our algorithm, MELˆ EE´ (MEta LEarner for Exploration)1, learns a good heuristic exploration strategy that should ideally generalize to future contextual bandit problems. MELˆ EE´ contrasts with more classical approaches to exploration (like $\epsilon$ -greedy or LinUCB; see $\ S 6$ ), in which exploration strategies are constructed by expert algorithm designers. These approaches often achieve provably good exploration strategies in the worst case, but are potentially overly pessimistic and are sometimes computationally intractable.
|
| 14 |
+
|
| 15 |
+
At training time (§ 3.2), MELˆ EE´ simulates many contextual bandit problems from fully labeled synthetic data. Using this data, in each round, MELˆ EE´ is able to counterfactually simulate what would happen under all possible action choices. We can then use this information to compute regret estimates for each action, which can be optimized using the AggreVaTe imitation learning algorithm (Ross & Bagnell, 2014). Our imitation learning strategy mirrors that of the meta-learning approach of Bachman et al. (2017) in the active learning setting. We present a simplified, stylized analysis of the behavior of MELˆ EE´ to ensure that our cost function encourages good behavior $( \ S 4 )$ . Empirically, we use MELˆ EE´ to train an exploration policy on only synthetic datasets and evaluate this policy on both a contextual bandit task based on a natural learning to rank dataset as well as three hundred simulated contextual bandit tasks (§5.2). We compare the trained policy to a number of alternative exploration algorithms, and show the efficacy of our approach (§5.3).
|
| 16 |
+
|
| 17 |
+
# 2 PRELIMINARIES: CONTEXTUAL BANDITS AND POLICY OPTIMIZATION
|
| 18 |
+
|
| 19 |
+
Contextual bandits is a model of interaction in which an agent chooses actions (based on contexts) and receives immediate rewards for that action alone. For example, in a simplified news personalization setting, at each time step $t$ , a user arrives and the system must choose a news article to display to them. Each possible news article corresponds to an action $a$ , and the user corresponds to a context $x _ { t }$ . After the system chooses an article $a _ { t }$ to display, it can observe, for instance, the amount of time that the user spends reading that article, which it can use as a reward $r _ { t } ( a _ { t } )$ .
|
| 20 |
+
|
| 21 |
+
Formally, we largely follow the setup and notation of Agarwal et al. (2014). Let $\mathcal { X }$ be an input space of contexts (users) and $[ K ] = \bar { \{ 1 , \dots , K \} }$ be a finite action space (articles). We consider the statistical setting in which there exists a fixed but unknown distribution $\mathcal { D }$ over pairs $( x , r ) \in$ $\mathcal { X } \times [ 0 , 1 ] ^ { K }$ , where $\pmb { r }$ is a vector of rewards (for convenience, we assume all rewards are bounded in $[ 0 , 1 ] )$ . In this setting, the world operates iteratively over rounds $t = 1 , 2 , \ldots .$ Each round $t$ :
|
| 22 |
+
|
| 23 |
+
1. The world draws $( x _ { t } , r _ { t } ) \sim \mathcal { D }$ and reveals context $x _ { t }$ .
|
| 24 |
+
2. The agent (randomly) chooses action $a _ { t } \in [ K ]$ based on $x _ { t }$ , and observes reward $r _ { t } ( a _ { t } )$ .
|
| 25 |
+
|
| 26 |
+
The goal of an algorithm is to maximize the cumulative sum of rewards over time. Typically the primary quantity considered is the average regret of a sequence of actions $a _ { 1 } , \dots , a _ { T }$ to the behavior of the best possible function in a prespecified class $\mathcal { F }$ :
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
\lambda ( a _ { 1 } , \ldots , a _ { T } ) = \operatorname* { m a x } _ { f \in { \mathcal { F } } } { \frac { 1 } { T } } \sum _ { t = 1 } ^ { T } \left[ r _ { t } ( f ( x _ { t } ) ) - r _ { t } ( a _ { t } ) \right]
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
An agent is call no-regret if its average regret is zero in the limit of large $T$
|
| 33 |
+
|
| 34 |
+
To produce a good agent for interacting with the world, we assume access to a function class $\mathcal { F }$ and to an oracle policy optimizer for that function class. For example, $\mathcal { F }$ may be a set of single layer neural networks mapping user features $x \in \mathcal { X }$ to predicted rewards for actions $a \in [ K ]$ . Formally, the observable record of interaction resulting from round $t$ is the tuple $( x _ { t } , a _ { t } , r _ { t } ( \bar { a } _ { t } ) , p _ { t } ( a _ { t } ) ) \ \in$ $\mathcal { X } { \times } [ K ] { \times } [ 0 , 1 ] { \times } [ 0 , 1 ]$ , where $p _ { t } ( a _ { t } )$ is the probability that the agent chose action $a _ { t }$ , and the full history of interaction is $h _ { t } = \langle ( x _ { i } , a _ { i } , r _ { i } ( a _ { i } ) , p _ { i } ( a _ { i } ) ) \rangle _ { i = 1 } ^ { t }$ . The oracle policy optimizer, POLOPT, takes as input a history of user interactions and outputs an $f \in { \mathcal { F } }$ with low expected regret.
|
| 35 |
+
|
| 36 |
+
A standard example of a policy optimizer is to combine inverse propensity scaling (IPS) with a regression algorithm (Dudik et al., 2011). Here, given a history $h$ , each tuple $( x , a , r , p )$ in that history is mapped to a multiple-output regression example. The input for this regression example is the same $x$ ; the output is a vector of $K$ costs, all of which are zero except the $a ^ { \mathrm { { t h } } }$ component, which takes value $r / p$ . This mapping is done for all tuples in the history, and a supervised learning algorithm on the function class $\mathcal { F }$ is used to produce a low-regret regressor $f$ . This is the function returned by the policy optimizer. IPS, and other estimators that have lower-variance than IPS (such as the doubly-robust estimator), have the property of being unbiased. In experiments, we use the direct method (Dudik et al., 2011) largely for its simplicity, however, MELˆ EE´ is agnostic to the type of the estimator used by the policy optimizer.
|
| 37 |
+
|
| 38 |
+
# 3 APPROACH: LEARNING AND EFFECTIVE EXPLORATION STRATEGY
|
| 39 |
+
|
| 40 |
+
In order to have an effective approach to the contextual bandit problem, one must be able to both optimize a policy based on historic data and make decisions about how to explore. The exploration/exploitation dilemma is fundamentally about long-term payoffs: is it worth trying something potentially suboptimal now in order to learn how to behave better in the future? A particularly simple and effective form of exploration is $\epsilon$ -greedy: given a function $f$ output by POLOPT, act according to $f ( x )$ with probability $( 1 - \epsilon )$ and act uniformly at random with probability . Intuitively, one would hope to improve on such a strategy by taking more (any!) information into account; for instance, basing the probability of exploration on $f$ ’s uncertainty. In this section, we describe MELˆ EE´ , first by describing how it operates at test time when applied to a new contextual bandit problem (§3.1), and then by describing how to train it using synthetic simulated contextual bandit problems $( \ S 3 . 2 )$ .
|
| 41 |
+
|
| 42 |
+
# 3.1 TEST TIME BEHAVIOR OF MELˆ EE´
|
| 43 |
+
|
| 44 |
+
Our goal in this paper is to learn how to explore from experience. The training procedure for MELˆ EE´ will use offline supervised learning problems to learn an exploration policy $\pi$ , which takes two inputs: a function $f \in { \mathcal { F } }$ and a context $x$ , and outputs an action. In our example, $f$ will be the output of the policy optimizer on all historic data, and $x$ will be the current user. This is used to produce an agent which interacts with the world, maintaining an initially empty history buffer $h$ , as:
|
| 45 |
+
|
| 46 |
+
1. The world draws $( x _ { t } , r _ { t } ) \sim \mathcal { D }$ and reveals context $x _ { t }$ .
|
| 47 |
+
2. The agent computes $f _ { t } \gets \mathrm { P O L O P T } ( h )$ and a greedy action $\tilde { a } _ { t } = \pi ( f _ { t } , x _ { t } )$ .
|
| 48 |
+
3. The agent plays $a _ { t } = \tilde { a } _ { t }$ with probability $( 1 - \mu )$ , and $a _ { t }$ uniformly at random otherwise.
|
| 49 |
+
4. The agent observes $r _ { t } ( a _ { t } )$ and appends $( x _ { t } , a _ { t } , r _ { t } ( a _ { t } ) , p _ { t } )$ to the history $h$ , where $\begin{array} { r l } { p _ { t } } & { { } = } \end{array}$
|
| 50 |
+
$\mu / K$ if $a _ { t } \neq \tilde { a } _ { t }$ ; and $p _ { t } = 1 - \mu + \mu / K$ if $a _ { t } = \tilde { a } _ { t }$ .
|
| 51 |
+
|
| 52 |
+
Here, $f _ { t }$ is the function optimized on the historical data, and $\pi$ uses it and $x _ { t }$ to choose an action. Intuitively, $\pi$ might choose to use the prediction $f _ { t } ( x _ { t } )$ most of the time, unless $f _ { t }$ is quite uncertain on this example, in which case $\pi$ might choose to return the second (or third) most likely action according to $f _ { t }$ . The agent then performs a small amount of additional $\mu$ -greedy-style exploration: most of the time it acts according to $\pi$ but occasionally it explores some more. In practice $( \ S 5 )$ , we find that setting $\mu = 0$ is optimal in aggregate, but non-zero $\mu$ is necessary for our theory $( \ S 4 )$ .
|
| 53 |
+
|
| 54 |
+
Importantly, we wish to train $\pi$ using one set of tasks (for which we have fully supervised data on which to run simulations) and apply it to wholly different tasks (for which we only have bandit feedback). To achieve this, we allow $\pi$ to depend representationally on $f _ { t }$ in arbitrary ways: for instance, it might use features that capture $f _ { t }$ ’s uncertainty on the current example (see $\ S 5 . 1$ for details). We additionally allow $\pi$ to depend in a task-independent manner on the history (for instance, which actions have not yet been tried): it can use features of the actions, rewards and probabilities in the history but not depend directly on the contexts $x$ . This is to ensure that $\pi$ only learns to explore and not also to solve the underlying task-dependent classification problem. Because $\pi$ needs to learn to be task independent, we found that if $f _ { t }$ ’s predictions were uncalibrated, it was very difficult for $\pi$ to generalize well to unseen tasks. Therefore, we additionally allow $\pi$ to depend on a very small amount of fully labeled data from the task at hand, which we use to allow $\pi$ to calibrate $f _ { t }$ ’s predictions. In our experiments we use only 30 fully labeled examples, but alternative approaches to calibrating $f _ { t }$ that do not require this data would be preferable.
|
| 55 |
+
|
| 56 |
+
# 3.2 TRAINING MELˆ EE BY ´ IMITATION LEARNING
|
| 57 |
+
|
| 58 |
+
The meta-learning challenge is: how do we learn a good exploration policy $\pi 2$ We assume we have access to fully labeled data on which we can train $\pi$ ; this data must include context/reward pairs, but where the reward for all actions is known. This is a weak assumption: in practice, we use purely synthetic data as this training data; one could alternatively use any fully labeled classification dataset (Beygelzimer & Langford, 2009). Under this assumption about the data, it is natural to think of $\pi$ ’s behavior as a sequential decision making problem in a simulated setting, for which a natural class of learning algorithms to consider are imitation learning algorithms (Daume et al., 2009; Ross ´ et al., 2011; Ross & Bagnell, 2014; Chang et al., 2015).2
|
| 59 |
+
|
| 60 |
+
Informally, at training time, MELˆ EE´ will treat one of these synthetic datasets as if it were a contextual bandit dataset. At each time step $t$ , it will compute $f _ { t }$ by running POLOPT on the historical data, and then ask: for each action, what would the long time reward look like if I were to take this action. Because the training data for MELˆ EE´ is fully labeled, this can be evaluated for each possible action, and a policy $\pi$ can be learned to maximize these rewards. More formally, in imitation learning, we assume training-time access to an expert, $\pi ^ { \star }$ , whose behavior we wish to learn to imitate at test-time. From this, we can define an optimal reference policy $\pi ^ { \star }$ , which effectively “cheats” at training time by looking at the true labels. The learning problem is then to estimate $\pi$ to have as similar behavior to $\pi ^ { \star }$ as possible, but without access to those labels.
|
| 61 |
+
|
| 62 |
+
The imitation learning algorithm we use is AggreVaTe (Ross & Bagnell, 2014) (closely related to DAgger (Ross et al., 2011)), and is instantiated for the contextual bandits meta-learning problem in Alg 1. AggreVaTe learns to choose actions to minimize the cost-to-go of the expert rather than the
|
| 63 |
+
|
| 64 |
+
1: for round $n = 1 , 2 , \dots , N \cdot$ do 2: initialize meta-dataset $D = \{ \}$ , choose $S$ at random from $\{ S _ { m } \}$ , and set history $h _ { 0 } = \left\{ \begin{array} { r l r } \end{array} \right\}$ 3: partition and permute $S$ randomly into train $T r$ and validation Val where $| V a l | = N _ { V a l }$ 4: for round $t = 1 , 2 , \dots , | T r |$ do 5: let $( x _ { t } , r _ { t } ) = T r _ { t }$ 6: 7: for each action optimize $\begin{array} { r } { f _ { t , a } = \mathrm { P o L O P T } ( \mathcal { F } , h _ { t - 1 } \oplus ( x _ { t } , a , r _ { t } ( a ) , 1 - \frac { K - 1 } { K } \mu ) ) } \end{array}$ $a = 1 , \ldots , K$ do on augmented history 8: roll-out: estimate $\hat { c } _ { a }$ , the cost-to-go of $a$ , using $r _ { t } ( a )$ and a roll-out policy $\pi ^ { \mathrm { { o u t } } }$ on $f _ { t , a }$ 9: end for 10: compute $f _ { t } = \mathrm { P o L O P T } ( \mathcal { F } , h _ { t - 1 } )$ 11: aggregate $D \gets D \oplus ( \Phi ( f _ { t } , x _ { t } , h _ { t - 1 } , V a l ) , \langle \hat { c } _ { 1 } , \dots , \hat { c } _ { K } \rangle )$ 12: roll-in: $\begin{array} { r } { a _ { t } \sim \frac { \mu } { K } \mathbf { 1 } _ { K } + ( 1 - \mu ) \pi _ { n - 1 } ( f _ { t } , x _ { t } ) } \end{array}$ with probability $p _ { t }$ , where 1 is the ones-vector 13: append history $h _ { t } \gets h _ { t - 1 } \oplus ( x _ { t } , a _ { t } , r _ { t } ( a _ { t } ) , p _ { t } )$ 14: end for 15: update $\pi _ { n } = \operatorname { L E A R N } ( D )$ 16: end for 17: return $\{ \pi _ { n } \} _ { n = 1 } ^ { N }$
|
| 65 |
+
|
| 66 |
+
zero-one classification loss of mimicking its actions. On the first iteration AggreVaTe collects data by observing the expert perform the task, and in each trajectory, at time $t$ , explores an action $a$ in state $s$ , and observes the cost-to-go $Q$ of the expert after performing this action.
|
| 67 |
+
|
| 68 |
+
Following the AggreVaTe template, MELˆ EE´ operates in an iterative fashion, starting with an arbitrary $\pi$ and improving it through interaction with an expert. Over $N$ rounds, MELˆ EE´ selects random training sets and simulates the test-time behavior on that training set. The core functionality is to generate a number of states $( f _ { t } , x _ { t } )$ on which to train $\pi$ , and to use the supervised data to estimate the value of every action from those states. MELˆ EE´ achieves this by sampling a random supervised training set and setting aside some validation data from it (line 3). It then simulates a contextual bandit problem on this training data; at each time step $t$ , it tries all actions and “pretends” like they were appended to the current history (line 7) on which it trains a new policy and evaluates it’s roll-out value (line 8). This yields, for each $t$ , a new training example for $\pi$ , which is added to $\pi$ ’s training set (line 11); the features for this example are features of the classifier based on true history (line 10) (and possibly statistics of the history itself), with a label that gives, for each action, the corresponding cost-to-go of that action (the $c _ { a } s$ computed in line 8). MELˆ EE´ then must commit to a roll-in action to actually take; it chooses this according to a roll-in policy (line 12). MELˆ EE´ has no explicit “exploitation policy”, exploitation happens when $\pi$ chooses the same action as $f _ { t }$ , while exploration happens when it chooses a different action. In learning to explore, MELˆ EE´ simultaneously learns when to exploit.
|
| 69 |
+
|
| 70 |
+
Roll-in actions. The distribution over states visited by MELˆ EE´ depends on the actions taken, and in general it is good to have that distribution match what is seen at test time. This distribution is determined by a roll-in policy (line 12), controlled in MELˆ EE´ by exploration parameter $\mu \in [ 0 , 1 ]$ . As $\mu \to 1$ , the roll-in policy approaches a uniform random policy; as $\mu \to 0$ , the roll-in policy becomes deterministic. When the roll-in policy does not explore, it acts according to $\pi ( f _ { t } , . )$ .
|
| 71 |
+
|
| 72 |
+
Roll-out values. The ideal value to assign to an action (from the perspective of the imitation learning procedure) is that total reward (or advantage) that would be achieved in the long run if we took this action and then behaved according to our final learned policy. Unfortunately, during training, we do not yet know the final learned policy. Thus, a surrogate roll-out policy $\pi ^ { \mathrm { { o u t } } }$ is used instead. A convenient, and often computationally efficient alternative, is to evaluate the value assuming all future actions were taken by the expert (Langford & Zadrozny, 2005; Daume et al., ´ 2009; Ross & Bagnell, 2014). In our setting, at any time step $t$ , the expert has access to the fully supervised reward vector $\mathbf { } _ { \mathbf { } } ^ { \mathbf { } } \mathbf { \Delta } \mathbf { r } _ { t }$ for the context $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . When estimating the roll-out value for an action $a$ , the expert will return the true reward value for this action $r _ { t } ( a )$ and we use this as our estimate for the roll-out value.
|
| 73 |
+
|
| 74 |
+
# 4 THEORETICAL GUARANTEES
|
| 75 |
+
|
| 76 |
+
We analyze MELˆ EE´ , showing that the no-regret property of AGGREVATE can be leveraged in our meta-learning setting for learning contextual bandit exploration. In particular, we first relate the regret of the learner in line 15 to the overall regret of $\pi$ . This will show that, $i f$ the underlying classifier improves sufficiently quickly, MELˆ EE´ will achieve sublinear regret. We then show that for a specific choice of underlying classifier (BANDITRON), this is achieved. MELˆ EE´ is an instantiation of AGGREVATE (Ross & Bagnell, 2014); as such, it inherits AGGREVATE’s regret guarantees.
|
| 77 |
+
|
| 78 |
+
Theorem 1 $\mathbf { T h m } 2 . 2$ of Ross $\pmb { \& }$ Bagnell (2014), adapted) After $N$ rounds, $i f$ LEARN (line 15) is no-regret algorithm, then as $N \infty$ , with probability 1, it holds that $J ( \bar { \pi } ) ~ \leq ~ J ( \pi ^ { \star } ) +$ $2 T \sqrt { K \hat { \epsilon } _ { c l a s s } ( T ) }$ , where $J ( \cdot )$ is the reward of the exploration policy, $\bar { \pi }$ is the average policy returned, and $\hat { \epsilon } _ { c l a s s } ( T )$ is the average regression regret for each $\pi _ { n }$ accurately predicting $\hat { c } _ { i }$ , where
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\hat { \epsilon } _ { c l a s s } ( T ) = \operatorname* { m i n } _ { \pi \in \Pi } \frac { 1 } { N } \hat { \mathbb { E } } _ { t \sim U ( T ) , s \sim d _ { \pi _ { i } } ^ { t } } \sum _ { i = 1 } ^ { N } \Big [ Q _ { T - t + 1 } ^ { \star } ( s , \pi ) - \operatorname* { m i n } _ { a } Q _ { T - t + 1 } ^ { \star } ( s , a ) \Big ]
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
is the empirical minimum expected cost-sensitive classification regret achieved by policies in the class $\Pi$ on all the data over the $N$ iterations of training when compared to the Bayes optimal regressor, for $U ( T )$ the uniform distribution over $\{ 1 , \ldots , T \}$ , $d _ { \pi } ^ { t }$ the distribution of states at time $t$ induced by executing policy $\pi$ , and $Q ^ { \star }$ the cost-to-go of the imitation learning expert.
|
| 85 |
+
|
| 86 |
+
Thus, achieving low regret at the problem of learning $\pi$ on the training data it observes (“ $D$ ” in MELˆ EE´ ), i.e. $\hat { \epsilon } _ { c l a s s } ( T )$ is small, translates into low regret in the contextual-bandit setting. At first glance this bound looks like it may scale linearly with $T$ . However, the bound in Theorem 1 is dependent on $\hat { \epsilon } _ { c l a s s } ( T )$ . Note however, that $s$ is a combination of the context vector $x _ { t }$ and the classification function $f _ { t }$ . As $T \to \infty$ , one would hope that $f _ { t }$ improves significantly and $\hat { \epsilon } _ { c l a s s } ( T )$ decays quickly. Thus, sublinear regret may still be achievable when $f$ learns sufficiently quickly as a function of $T$ . For instance, if $f$ is optimizing a strongly convex loss function, online gradient descent achieves a regret guarantee of $O \big ( \frac { \log T } { T } \big )$ (Hazan et al., 2016, Theorem 3.3), potentially leading to a regret for MELˆ EE´ of $O ( \sqrt { ( \log T ) / T } )$ .
|
| 87 |
+
|
| 88 |
+
The above statement is informal (it does not take into account the interaction between learning $f$ and $\pi$ ). However, we can show a specific concrete example: we analyze MELˆ EE´ ’s test-time behavior when the underlying learning algorithm is BANDITRON. BANDITRON is a variant of the multiclass Perceptron that operates under bandit feedback. Details of this analysis (and proofs, which directly follow the original BANDITRON analysis) are given in Appendix A; here we state the main result. Let $\gamma _ { t } = \mathrm { P r } \big [ \bar { r } _ { t } ( \pi ( f _ { t } , x _ { t } ) = 1 ) | x _ { t } | \big ] - \mathrm { P r } \big [ r _ { t } ( \bar { f } _ { t } ( x _ { t } ) ) = \hat { 1 } \big | x _ { t } \big ]$ be the edge of $\pi ( f _ { t } , . )$ over $f$ , and $\begin{array} { r } { \Gamma = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathbb { E } \frac { 1 } { 1 + K \gamma _ { t } } } \end{array}$ be an overall measure of the edge. For instance if $\pi$ simply returns $f$ ’s prediction, then all $\gamma _ { t } = 0$ and $\Gamma = 1$ . We can then show the following:
|
| 89 |
+
|
| 90 |
+
Theorem 2 Assume that for the sequence of examples, $( x _ { 1 } , pmb { r } _ { 1 } ) , ( x _ { 2 } , \pmb { r } _ { 2 } ) , \dots , ( x _ { T } , \pmb { r } _ { T } )$ , we have, for all $t _ { : }$ , $| | x _ { t } | | \leq 1$ . Let $W ^ { \star }$ be any matrix, let $L$ be the cumulative hinge-loss of $W ^ { \star }$ , let $\mu$ be a uniform exploration probability, and let $D = 2 \left| \left| W ^ { \star } \right| \right| _ { F } ^ { 2 }$ be the complexity of $W ^ { \star }$ . Assume that $\mathbb { E } \gamma _ { t } \geq 0$ for all $t$ . Then the number of mistakes $M$ made by MELˆ EE´ with BANDITRON as POLOPT satisfies:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathbb { E } M \leq L + K \mu T + 3 \operatorname* { m a x } \left\{ D \Gamma / \mu , \sqrt { D T K \Gamma \mu } \right\} + \sqrt { D L \Gamma / \mu }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where the expectation is taken with respect to the randomness of the algorithm.
|
| 97 |
+
|
| 98 |
+
Note that under the assumption $\mathbb { E } \gamma _ { t } \geq 0$ for all $t$ , we have $\Gamma \leq 1$ . The analysis gives the same mistake bound for BANDITRON but with the factor of $\Gamma$ , hence this result improves upon the BANDITRON analysis only when $\Gamma < 1$ (in the realizable setting, the number of mistakes is analogous to the regret). This result is highly stylized and the assumption that $\mathbb { E } \gamma _ { t } \geq 0$ is overly strong. This assumption ensures that $\pi$ never decreases the probability of a “correct” action. It does, however, help us understand the behavior of MELˆ EE´ , qualitatively: First, the quantity that matters in Theorem 2, $\mathbb { E } _ { t } { \gamma } _ { t }$ is (in the $_ { 0 / 1 }$ loss case) exactly what MELˆ EE´ is optimizing: the expected improvement for choosing an action against $f _ { t }$ ’s recommendation. Second, the benefit of using $\pi$ within BANDITRON is a local benefit: because $\pi$ is trained with expert rollouts, as discussed in $\ S 4$ , the primary improvement in the analysis is to ensure that $\pi$ does a better job predicting (in a single step) than $f _ { t }$ does. An obvious open question is whether it is possible to base the analysis on the regret of $\pi$ (rather than its error) and whether it is possible to extend beyond the BANDITRON.
|
| 99 |
+
|
| 100 |
+
# 5 EXPERIMENTAL SETUP AND RESULTS
|
| 101 |
+
|
| 102 |
+
Using a collection of synthetically generated classification problems, we train an exploration policy $\pi$ using MELˆ EE´ (Alg 1). This exploration policy learns to explore on the basis of calibrated probabilistic predictions from $f$ together with a predefined set of exploration features $( \ S 5 . 1 )$ . Once $\pi$ is learned and fixed, we follow the test-time behavior described in $\ S 3 . 1$ to evaluate $\pi$ on a set of contextual bandit problems. We evaluate MELˆ EE´ on a natural learning to rank task $( \ S 5 . 3 . 1 )$ . To ensure that the performance of MELˆ EE´ generalizes beyond this single learning to rank task, we additionally perform thorough evaluation on 300 “simulated” contextual bandit problems, derived from standard classification tasks (§5.3.2).
|
| 103 |
+
|
| 104 |
+
In all cases, the underlying classifier $f$ is a linear model trained with a policy optimizer that runs stochastic gradient descent (details are in $\ S \mathbf { A } . 2 )$ . We seek to answer two questions experimentally: (1) How does MELˆ EE´ compare empirically to alternative (expert designed) exploration strategies? (2) How important are the additional features used by MELˆ EE´ in comparison to using calibrated probability predictions from $f$ as features?
|
| 105 |
+
|
| 106 |
+
# 5.1 TRAINING DETAILS FOR THE EXPLORATION POLICY
|
| 107 |
+
|
| 108 |
+
Exploration Features. In our experiments, the exploration policy is trained based on features $\Phi$ (Alg 1, line 11). These features are allowed to depend on the current classifier $f _ { t }$ , and on any part of the history except the inputs $x _ { t }$ in order to maintain task independence. We additionally ensure that its features are independent of the dimensionality of the inputs, so that $\pi$ can generalize to datasets of arbitrary dimensions. The specific features we use are listed below; these are largely inspired by Konyushkova et al. (2017) but adapted and augmented to our setting.
|
| 109 |
+
|
| 110 |
+
The features of $f _ { t }$ that we use are: a) predicted probability $p ( a _ { t } | f _ { t } , \pmb { x } _ { t } )$ , we use a softmax over the predicted rewards from $f _ { t }$ to convert them to probabilities; b) entropy of the predicted probability distribution; c) a one-hot encoding for the predicted action $f _ { t } ( \pmb { x } _ { t } )$ . The features of $h _ { t - 1 }$ that we use are: a) current time step $t ; { \bf b } )$ normalized counts for all previous actions predicted so far; c) average observed rewards for each action; d) empirical variance of the observed rewards for each action in the history. In our experiments, we found that it is essential to calibrate the predicted probabilities of the classifier $f _ { t }$ . We use a very small held-out dataset, of size 30, to achieve this. We use Platt’s scaling (Platt, 1999; Lin et al., 2007) method to calibrate the predicted probabilities. Platt’s scaling works by fitting a logistic regression model to the classifier’s predicted scores.
|
| 111 |
+
|
| 112 |
+
Training Datasets. In our experiments, we follow Konyushkova et al. (2017) (and also Peters et al. (2014), in a different setting) and train the exploration policy $\pi$ only on synthetic data. This is possible because the exploration policy $\pi$ never makes use of $x$ explicitly and instead only accesses it via $f _ { t }$ ’s behavior on it. We generate datasets with uniformly distributed class conditional distributions. The datasets are always two-dimensional. Details are in $\ S \mathrm { A } . 1$ .
|
| 113 |
+
|
| 114 |
+
# 5.2 EVALUATION METHODOLOGY
|
| 115 |
+
|
| 116 |
+
For evaluation, we use progressive validation (Blum et al., 1999), which is exactly computing the reward of the algorithm. Specifically, to evaluate the performance of an exploration algorithm $\mathcal { A }$ on a dataset $S$ of size $n$ , we compute the progressive validation return $\begin{array} { r } { G ( \mathcal { A } ) = \frac { 1 } { n } \sum _ { t = 1 } ^ { n } r _ { t } ( a _ { t } ) } \end{array}$ as the average reward up to $n$ , where $a _ { t }$ is the action chosen by the algorithm $\mathcal { A }$ and $r _ { t }$ is the true reward.
|
| 117 |
+
|
| 118 |
+
Because our evaluation is over 300 datasets, we report aggregate results in two forms. The simpler one is Win/Loss Statistics: We compare two exploration methods on a given dataset by counting the number of statistically significant wins and losses. An exploration algorithm $\mathcal { A }$ wins over another algorithm $\boldsymbol { B }$ if the progressive validation return $G ( { \mathcal { A } } )$ is statistically significantly larger than $B$ ’s return $G ( B )$ at the 0.01 level using a paired sample t-test. We also report cumulative distributions of rewards for each algorithm, following Zhang et al. (2019). In particular, for a given relative reward value $( x \in [ 0 , 1 ] )$ , the corresponding CDF value for a given algorithm is the fraction of datasets on which this algorithm achieved reward at least $x$ . We compute relative reward by Min
|
| 119 |
+
|
| 120 |
+
Max normalization: linearly transforming reward $y$ to $\begin{array} { r } { y ^ { \prime } = \frac { y - \mathrm { m i n } } { \mathrm { m a x - m i n } } } \end{array}$ , where min & max are the minimum & maximum rewards among all exploration algorithms.
|
| 121 |
+
|
| 122 |
+
In our experiments, we compare to the following baseline exploration methods, keeping the policy optimization method fixed (details in $\ S \mathbf { A . 4 } )$ ): $\epsilon$ -greedy (Sutton, 1996); $\epsilon$ -decreasing (Sutton & Barto, 1998); EG $\epsilon$ -greedy (Li et al., 2010b); $\tau$ -first. We additionally compare to three state-of-the-art exploration methods: LinUCB (Li et al., 2010a); Cover (Agarwal et al., 2014); and its variant Cover-NU (Bietti et al., 2018). We select the best hyperparameters following Bietti et al. (2018).
|
| 123 |
+
|
| 124 |
+
# 5.3 EXPERIMENTAL RESULTS
|
| 125 |
+
|
| 126 |
+
# 5.3.1 LEARNING TO RANK
|
| 127 |
+
|
| 128 |
+
We evaluate MELˆ EE´ on a natural learning to rank dataset. The dataset we consider is the Microsoft Learning to Rank dataset, variant MSLR-10K from Qin & Liu (2013) 3. The dataset consists of feature vectors extracted from query-url pairs along with relevance judgment labels. The relevance judgments are obtained from a retired labeling set of a commercial web search engine (Microsoft Bing), which take 5 values from 0 (irrelevant) to 4 (perfectly relevant) and we drop the queries not labelled as any of the two extremes. In our experiments, we limit the number of labels to the two extremes: 0 and 4. A query-url pair is represented by a 136-dimensional feature vector. The dataset is highly imbalanced as the number of irrelevant queries is much larger than the number of relevant ones. To address this, we sample the number of irrelevant queries to match that of the relevant ones. To avoid correlations between the observed query-url pairs, we group the queries by the query ID, and sample a single query from each group. We convert relevance scores to losses with 0 indicating a perfectly relevant document, and 1 an irrelevant one.
|
| 129 |
+
|
| 130 |
+
Figure 1 shows the evaluation results on a subset of the MSLR-10K dataset. Since the performance is closely matched between the different exploration algorithms, we repeat the experiment 16 times with randomly shuffled permutations of the MSLR-10K dataset. Figure 1 (left) shows the learning curve of the trained policy $\pi$ as well as the baselines. Here, we see that MELˆ EE´ quickly achieves high reward, after about 100 examples the two strongest baselines catch up. By 200 examples all approaches have asymptoted. We exclude LinUCB from these runs because the required matrix inversions made it too computationally expensive.4 Figure 1 shows statistically-significant win/loss differences for each of the algorithms, across these 16 shuffles. Each row/column entry shows the number of times the row algorithm won against the column, minus the number of losses. MELˆ EE´ is the only algorithm that always wins more than it loses against other algorithms, and outperforms the nearest competition ( $\epsilon$ -decreasing) by 3 points.
|
| 131 |
+
|
| 132 |
+
# 5.3.2 SIMULATED CONTEXTUAL BANDIT TASKS
|
| 133 |
+
|
| 134 |
+
We additionally perform an exhaustive evaluation on simulated contextual bandit tasks to ensure that the performance of MELˆ EE´ generalizes beyond learning to rank. Following Bietti et al. (2018), we use a collection of 300 binary classification datasets from openml.org for evaluation; the precise list and download instructions is in $\ S \mathbf { A } . 3$ . These datasets cover a variety of different domains including text $\&$ image processing, medical, and sensory data. We convert classification datasets into cost-sensitive classification problems by using a $0 / 1$ encoding. Given these fully supervised cost-sensitive multi-class datasets, we simulate the contextual bandit setting by only revealing the reward for the selected actions.
|
| 135 |
+
|
| 136 |
+
In Figure 2 (left), we show a representative learning curve. Here, we see that as more data becomes available, all the approaches improve (except $\tau$ -first, which has ceased to learn after $2 \%$ of the data). MELˆ EE´ , in particular, is able to very quickly achieve near-optimal performance (in around 40 examples) in comparison to the best baseline which takes at least 200. In Figure 2 (right), we show the CDFs for the different algorithms. To help read this, at $x = 1 . 0$ , MELˆ EE´ has a relative reward at least 1.0 on more than $40 \%$ of datasets, while $\epsilon$ -decreasing and $\epsilon$ -greedy achieve this on about $30 \%$ of datasets. We find that the two strongest baselines are $\epsilon$ -decreasing and $\epsilon$ -greedy (better when reward differences are small, toward the left of the graph). The two curves for $\epsilon$ -decreasing and $\epsilon$ - greedy coincide. This happens because the exploration probability $\epsilon _ { 0 }$ for $\epsilon$ -decreasing decays rapidly approaching zero with a rate of $\textstyle { \frac { 1 } { t } }$ , where $t$ is the index of the current round. MELˆ EE´ outperforms the baselines in the “large reward” regimes (right of graph) but under-performs $\epsilon$ -decreasing and $\epsilon$ -greedy in low reward regimes (left of graph).
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 1: Results for the Learning to Rank task. (Left) Learning curve on the MSLR-10K dataset: $\mathbf { X }$ -axis shows the number of queries observed, and y-axis shows the progressive reward. (Right) Win/Loss counts for all pairs of algorithms over 16 random shuffles for the MSLR-10K dataset.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Behavior of MELˆ EE´ in comparison to baseline and state-of-the-art exploration algorithms.
|
| 143 |
+
|
| 144 |
+
In Figure 3, we show statistically-significant win/loss differences for each of the algorithms. Here, each (row, column) entry shows the number of times the row algorithm won against the column, minus the number of losses. MELˆ EE´ is the only algorithm that always wins more than it loses against other algorithms, and outperforms the nearest competition ( $\epsilon$ -decreasing) by 23 points.
|
| 145 |
+
|
| 146 |
+
To understand more directly how MELˆ EE´ compares to $\epsilon$ -decreasing, in the left plot of Figure 4, we show a scatter plot of rewards achieved by MELˆ EE´ $\mathbf { \dot { X } }$ -axis) and $\epsilon$ -decreasing (y-axis) on each of the 300 datasets, with statistically significant differences highlighted in red and insignificant differences in blue. Points below the diagonal line correspond to better performance by MELˆ EE´ (147 datasets)
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 3: Win/Loss counts for all pairs of algorithms (columns match the rows).
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 4: Scatterplots comparing MELˆ EE´ to the best baseline and to a variant with fewer features.
|
| 153 |
+
|
| 154 |
+
and points above to $\epsilon$ -decreasing (124 datasets). The remaining 29 had no statistically significant difference.
|
| 155 |
+
|
| 156 |
+
Finally, we consider the effect that the additional features have on MELˆ EE´ ’s performance. In particular, we consider a version of MELˆ EE´ with all features (this is the version used in all other experiments) with an ablated version that only has access to the (calibrated) probabilities of each action from the underlying classifier $f$ . The comparison is shown as a scatter plot in Figure 4 (right). Here, we can see that the full feature set does provide lift over just the calibrated probabilities, with a win-minus-loss improvement of 24 by adding additional features from which to learn to explore.
|
| 157 |
+
|
| 158 |
+
# 6 RELATED WORK AND DISCUSSION
|
| 159 |
+
|
| 160 |
+
The field of meta-learning is based on the idea of replacing hand-engineered learning heuristics with heuristics learned from data. One of the most relevant settings for meta-learning to ours is active learning, in which one aims to learn a decision function to decide which examples, from a pool of unlabeled examples, should be labeled. Past approaches to meta-learning for active learning include reinforcement learning-based strategies (Woodward & Finn, 2017; Fang et al., 2017), imitation learning-based strategies (Bachman et al., 2017), and batch supervised learning-based strategies (Konyushkova et al., 2017). Similar approaches have been used to learn heuristics for optimization (Li & Malik, 2016; Andrychowicz et al., 2016), multiarm (non-contextual) bandits Maes et al. (2012), and neural architecture search (Zoph & Le, 2016), recently mostly based on (deep) reinforcement learning. While meta-learning for contextual bandits is most similar to meta-learning for active learning, there is a fundamental difference that makes it significantly more challenging: in active learning, the goal is to select as few examples as you can to learn, so by definition the horizon is short; in contextual bandits, learning to explore is fundamentally a long-horizon problem, because what matters is not immediate reward but long term learning.
|
| 161 |
+
|
| 162 |
+
In reinforcement learning, Gupta et al. (2018) investigated the task of meta-learning an exploration strategy for a distribution of related tasks by learning a latent exploration space. Similarly, Xu et al. (2018) proposed a teacher-student approach for learning to do exploration in off-policy reinforcement learning. While these approaches are effective if the distribution of tasks is very similar and the state space is shared among different tasks, they fail to generalize when the tasks are different. Our approach targets an easier problem than exploration in full reinforcement learning environments, and can generalize well across a wide range of different tasks with completely unrelated features spaces.
|
| 163 |
+
|
| 164 |
+
There has also been a substantial amount of work on constructing “good” exploration policies, in problems of varying complexity: traditional bandit settings (Karnin & Anava, 2016), contextual bandits (Fraud et al., 2016) and reinforcement learning (Osband et al., 2016). In both bandit settings, most of this work has focused on the learning theory aspect of exploration: what exploration distributions guarantee that learning will succeed (with high probability)? MELˆ EE´ , lacks such guarantees: in particular, if the data distribution of the observed contexts $( \phi ( f _ { t } ) )$ in some test problem differs substantially from that on which MELˆ EE´ was trained, we can say nothing about the quality of the learned exploration. Nevertheless, despite fairly substantial distribution mismatch (synthetic real-world), MELˆ EE´ works well in practice, and our stylized theory $( \ S 4 )$ suggests that there may be an interesting avenue for developing strong theoretical results for contextual bandit learning with learned exploration policies, and perhaps other meta-learning problems.
|
| 165 |
+
|
| 166 |
+
In conclusion, we presented MELˆ EE´ , a meta-learning algorithm for learning exploration policies in the contextual bandit setting. MELˆ EE´ enjoys no-regret guarantees, and empirically it outperforms alternative exploration algorithm in most settings. One limitation of MELˆ EE´ is the computational resources required during the offline training phase on the synthetic datasets. In the future, we will work on improving the computational efficiency for MELˆ EE´ in the offline training phase and scale the experimental analysis to problems with larger number of classes.
|
| 167 |
+
|
| 168 |
+
# REFERENCES
|
| 169 |
+
|
| 170 |
+
Alekh Agarwal, Daniel Hsu, Satyen Kale, John Langford, Lihong Li, and Robert E. Schapire. Taming the monster: A fast and simple algorithm for contextual bandits. In In Proceedings of the 31st International Conference on Machine Learning (ICML-14, pp. 1638–1646, 2014.
|
| 171 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, and Nando de Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pp. 3981–3989, 2016.
|
| 172 |
+
Peter Auer. Using confidence bounds for exploitation-exploration trade-offs. The Journal of Machine Learning Research, 3:397–422, 2003.
|
| 173 |
+
Philip Bachman, Alessandro Sordoni, and Adam Trischler. Learning algorithms for active learning. In ICML, 2017.
|
| 174 |
+
Alina Beygelzimer and John Langford. The offset tree for learning with partial labels. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 129–138. ACM, 2009.
|
| 175 |
+
Alberto Bietti, Alekh Agarwal, and John Langford. A Contextual Bandit Bake-off. working paper or preprint, May 2018.
|
| 176 |
+
Avrim Blum, Adam Kalai, and John Langford. Beating the hold-out: Bounds for k-fold and progressive cross-validation. In Proceedings of the twelfth annual conference on Computational learning theory, pp. 203–208. ACM, 1999.
|
| 177 |
+
Leo Breiman. Random forests. Mach. Learn., 45(1):5–32, October 2001. ISSN 0885-6125. doi: 10.1023/A:1010933404324.
|
| 178 |
+
|
| 179 |
+
Kai-Wei Chang, Akshay Krishnamurthy, Alekh Agarwal, Hal Daume, III, and John Langford. ´ Learning to search better than your teacher. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML, pp. 2058–2066. JMLR.org, 2015.
|
| 180 |
+
|
| 181 |
+
Hal Daume, III, John Langford, and Daniel Marcu. Search-based structured prediction. ´ Machine Learning, 75(3):297–325, Jun 2009. ISSN 1573-0565. doi: 10.1007/s10994-009-5106-x.
|
| 182 |
+
|
| 183 |
+
Miroslav Dudik, Daniel Hsu, Satyen Kale, Nikos Karampatziakis, John Langford, Lev Reyzin, and Tong Zhang. Efficient optimal learning for contextual bandits. arXiv preprint arXiv:1106.2369, 2011.
|
| 184 |
+
|
| 185 |
+
Meng Fang, Yuan Li, and Trevor Cohn. Learning how to active learn: A deep reinforcement learning approach. In EMNLP, 2017.
|
| 186 |
+
|
| 187 |
+
Raphal Fraud, Robin Allesiardo, Tanguy Urvoy, and Fabrice Clrot. Random forest for the contextual bandit problem. In Arthur Gretton and Christian C. Robert (eds.), Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, volume 51 of Proceedings of Machine Learning Research, pp. 93–101, Cadiz, Spain, 09–11 May 2016. PMLR.
|
| 188 |
+
|
| 189 |
+
Abhishek Gupta, Russell Mendonca, YuXuan Liu, Pieter Abbeel, and Sergey Levine. Metareinforcement learning of structured exploration strategies. arXiv preprint arXiv:1802.07245, 2018.
|
| 190 |
+
|
| 191 |
+
Elad Hazan et al. Introduction to online convex optimization. Foundations and Trends $\textsuperscript { \textregistered }$ in Optimization, 2(3-4):157–325, 2016.
|
| 192 |
+
|
| 193 |
+
Leslie Pack Kaelbling. Associative reinforcement learning: Functions ink-dnf. Machine Learning, 15(3):279–298, 1994.
|
| 194 |
+
|
| 195 |
+
Sham M. Kakade, Shai Shalev-Shwart, and Ambuj Tewari. Efficient bandit algorithms for online multiclass prediction. In ICML, 2008.
|
| 196 |
+
|
| 197 |
+
Zohar S Karnin and Oren Anava. Multi-armed bandits: Competing with optimal sequences. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 199–207. Curran Associates, Inc., 2016.
|
| 198 |
+
|
| 199 |
+
Ksenia Konyushkova, Raphael Sznitman, and Pascal Fua. Learning active learning from data. In Advances in Neural Information Processing Systems, 2017.
|
| 200 |
+
|
| 201 |
+
John Langford and Bianca Zadrozny. Relating reinforcement learning performance to classification performance. In Proceedings of the 22nd international conference on Machine learning, pp. 473–480. ACM, 2005.
|
| 202 |
+
|
| 203 |
+
John Langford and Tong Zhang. The epoch-greedy algorithm for multi-armed bandits with side information. In Advances in Neural Information Processing Systems 20, pp. 817–824. Curran Associates, Inc., 2008.
|
| 204 |
+
|
| 205 |
+
Ke Li and Jitendra Malik. Learning to optimize. arXiv preprint arXiv:1606.01885, 2016.
|
| 206 |
+
|
| 207 |
+
Lihong Li, Wei Chu, John Langford, and Robert E. Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th International Conference on World Wide Web, WWW ’10, pp. 661–670, New York, NY, USA, 2010a. ACM. ISBN 978-1- 60558-799-8. doi: 10.1145/1772690.1772758.
|
| 208 |
+
|
| 209 |
+
Wei Li, Xuerui Wang, Ruofei Zhang, Ying Cui, Jianchang Mao, and Rong Jin. Exploitation and exploration in a performance based contextual advertising system. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’10, pp. 27–36, New York, NY, USA, 2010b. ACM.
|
| 210 |
+
|
| 211 |
+
Hsuan-Tien Lin, Chih-Jen Lin, and Ruby C. Weng. A note on platt’s probabilistic outputs for support vector machines. Machine Learning, 68(3):267–276, Oct 2007. ISSN 1573-0565. doi: 10.1007/s10994-007-5018-6.
|
| 212 |
+
|
| 213 |
+
Francis Maes, Louis Wehenkel, and Damien Ernst. Meta-learning of exploration/exploitation strategies: The multi-armed bandit case. In International Conference on Agents and Artificial Intelligence, pp. 100–115. Springer, 2012.
|
| 214 |
+
|
| 215 |
+
Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4026–4034. Curran Associates, Inc., 2016.
|
| 216 |
+
|
| 217 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 218 |
+
|
| 219 |
+
Jonas Peters, Joris M Mooij, Dominik Janzing, and Bernhard Scholkopf. Causal discovery with ¨ continuous additive noise models. The Journal of Machine Learning Research, 15(1):2009–2053, 2014.
|
| 220 |
+
|
| 221 |
+
John C. Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In ADVANCES IN LARGE MARGIN CLASSIFIERS, pp. 61–74. MIT Press, 1999.
|
| 222 |
+
|
| 223 |
+
Tao Qin and Tie-Yan Liu. Introducing LETOR 4.0 datasets. CoRR, abs/1306.2597, 2013. URL http://arxiv.org/abs/1306.2597.
|
| 224 |
+
|
| 225 |
+
Stephane Ross and J Andrew Bagnell. Reinforcement and imitation learning via interactive no-regret ´ learning. arXiv preprint arXiv:1406.5979, 2014.
|
| 226 |
+
|
| 227 |
+
Stephane Ross, Geoffrey Gordon, and J Andrew Bagnell. A reduction of imitation learning and ´ structured prediction to no-regret online learning. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 627–635, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR.
|
| 228 |
+
|
| 229 |
+
Richard S Sutton. Generalization in reinforcement learning: Successful examples using sparse coarse coding. In Advances in neural information processing systems, pp. 1038–1044, 1996.
|
| 230 |
+
|
| 231 |
+
Richard S. Sutton and Andrew G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. ISBN 0262193981.
|
| 232 |
+
|
| 233 |
+
Mark Woodward and Chelsea Finn. Active one-shot learning. arXiv preprint arXiv:1702.06559, 2017.
|
| 234 |
+
|
| 235 |
+
Tianbing Xu, Qiang Liu, Liang Zhao, Wei Xu, and Jian Peng. Learning to explore with meta-policy gradient. arXiv preprint arXiv:1803.05044, 2018.
|
| 236 |
+
|
| 237 |
+
Chicheng Zhang, Alekh Agarwal, Hal Daume, III, John Langford, and Sahand N Negahban. Warm- ´ starting contextual bandits: Robustly combining supervised and bandit feedback. In ICML, 2019.
|
| 238 |
+
|
| 239 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 240 |
+
|
| 241 |
+
# Supplementary Material For: Learning Effective Exploration Strategies for Contextual Bandits
|
| 242 |
+
|
| 243 |
+
A STYLIZED TEST-TIME ANALYSIS FOR BANDITRON: DETAILS
|
| 244 |
+
|
| 245 |
+
The BANDITRONMELˆ EE´ algorithm is specified in $\mathrm { A l g } 2$ . The is exactly the same as the typical test time behavior, except it uses a BANDITRON-type strategy for learning the underlying classifier $f$ in the place of POLOPT. POLICYELIMINATIONMETA takes as arguments: $\pi$ (the learned exploration policy) and $\mu \in ( 0 , 1 / ( 2 K ) )$ an added uniform exploration parameter. The BANDITRON learns a linear multi-class classifier parameterized by a weight matrix of size $K { \times } D$ , where $D$ is the input dimensionality. The BANDITRON assumes a pure multi-class setting in which the reward for one (“correct”) action is 1 and the reward for all other actions is zero.
|
| 246 |
+
|
| 247 |
+
At each round $t$ , a prediction $\hat { a } _ { t }$ is made according to $f _ { t }$ (summarized by $W ^ { t }$ ). We then define an exploration distribution that “most of the time” acts according to $\pi ( f _ { t } , . )$ , but smooths each action with $\mu$ probability. The chosen action $a _ { t }$ is sampled from this distribution and a binary reward is observed. The weights of the BANDITRON are updated according to the BANDITRON update rule using $\tilde { U } ^ { t }$ .
|
| 248 |
+
|
| 249 |
+
# Algorithm 2 BANDITRONMELˆ EE´ $( g , \mu )$
|
| 250 |
+
|
| 251 |
+
1: initialize $W ^ { 1 } = \mathbf { 0 } \in \mathbb { R } ^ { K \times D }$
|
| 252 |
+
2: for rounds $t = 1 \dots T$ : do
|
| 253 |
+
3: observe $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { D }$
|
| 254 |
+
4: compute $\begin{array} { r } { \hat { a } _ { t } = f _ { t } ( x _ { t } ) = \mathrm { a r g m a x } _ { k \in K } \left( W ^ { t } x _ { t } \right) _ { k } } \end{array}$
|
| 255 |
+
5: define $Q ^ { \mu } ( a ) = \mu + ( 1 - K \mu ) { \bf 1 } [ a = \pi ( W ^ { t } , x _ { t } ) ]$
|
| 256 |
+
6: sample $a _ { t } \sim Q ^ { \mu }$
|
| 257 |
+
7: observe reward $r _ { t } ( a _ { t } ) \in \{ 0 , 1 \}$
|
| 258 |
+
8: d $\tilde { U } ^ { t } \in \mathbb { R } ^ { K \times D }$
|
| 259 |
+
$\begin{array} { r } { \tilde { U } _ { a , \cdot } ^ { t } = x _ { t } \left( \frac { \mathbf { 1 } [ r _ { t } ( a _ { t } ) = 1 ] \mathbf { 1 } [ a _ { t } = a ] } { Q ^ { \mu } ( a ) } - \mathbf { 1 } [ \hat { a } _ { t } = a ] \right) } \end{array}$
|
| 260 |
+
9: update $W ^ { t + 1 } = W ^ { t } + \tilde { U } ^ { t }$
|
| 261 |
+
|
| 262 |
+
The only difference between BANDITRONMELˆ EE´ and the original BANDITRON is the introduction of $\pi$ in the sampling distribution. The original algorithm achieves the following mistake bound shown below, which depends on the notion of multi-class hinge-loss. In particular, the hinge-loss of $W$ on $( x , r )$ is $\ell ( W , ( x , \pmb { r } ) ) = \mathrm { m a x } _ { a \neq a ^ { \star } }$ max $\left\{ 0 , 1 - ( W x ) _ { a ^ { \star } } + ( W x ) _ { a } ^ { \top } \right\}$ , where $a ^ { \star }$ is the $a$ for which $r ( a ) = 1$ . The overall hinge-loss $L$ is the sum of $\ell$ over the sequence of examples.
|
| 263 |
+
|
| 264 |
+
Theorem 3 (Thm. 1 and Corr. 2 of Kakade et al. (2008)) Assume that for the sequence of examples, $( x _ { 1 } , r _ { 1 } ) , ( x _ { 2 } , r _ { 2 } ) , \ldots , ( x _ { T } , \pmb { r } _ { T } )$ , we have, for all $t _ { : }$ , $| | x _ { t } | | \leq 1$ . Let $W ^ { \star }$ be any matrix, let $L$ be the cumulative hinge-loss of $W ^ { \star }$ , and let $D = 2 \left| \left| W ^ { \star } \right| \right| _ { F } ^ { 2 }$ be the complexity of $W ^ { \star }$ . The number of mistakes $M$ made by the BANDITRON satisfies
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
{ \mathbb { E } } M \leq L + K \mu T + 3 \operatorname* { m a x } \left\{ { \frac { D } { \mu } } , { \sqrt { D T K \mu } } \right\} + { \sqrt { D L / \mu } }
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
where the expectation is taken with respect to the randomness of the algorithm. Furthermore, in a low noise setting (there exists $W ^ { \star }$ with fixed complexity √ $d$ and loss $\bar { L ( \mathbf { \Omega } \leq \cal { O } ( \sqrt { \cal { D } K T } ) ) }$ , then by setting $\mu = \sqrt { D / ( T K ) }$ , we obtain $\mathbb { E } M \le O ( \sqrt { K D T } )$ .
|
| 271 |
+
|
| 272 |
+
We can prove an analogous result for BANDITRONMELˆ EE´ . The key quantity that will control how much $\pi$ improves the execution of BANDITRONMELˆ EE´ is how much $\pi$ improves on $f _ { t }$ when $f _ { t }$ is $\pi ( f _ { t } , . )$ In p over $f$ ticul, and $\begin{array} { r } { \Gamma = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathbb { E } \frac { 1 } { 1 + K \gamma _ { t } } } \end{array}$ $\gamma _ { t } = \operatorname* { P r } [ r _ { t } ( \pi ( f _ { t } , x _ { t } ) = 1 ) | x _ { t } ] - \operatorname* { P r } [ r _ { t } ( f _ { t } ( x _ { t } ) ) = 1 | x _ { t } ]$ $\pi$ e the edge ofdoes nothing, then all $\gamma _ { t } = 0$ $\Gamma = 1 .$ .) Given this quantity, we can prove the following Theorem 2.
|
| 273 |
+
|
| 274 |
+
Proof: [sketch] The proof is a small modification of the original proof of Theorem 3. The only change is that in the original proof, the following bound is used: $\mathbb { E } _ { t } | | \bar { \tilde { U } } ^ { t } | | ^ { 2 } / | | x _ { t } | | ^ { 2 } = 1 + 1 / \mu \le 2 / \mu$
|
| 275 |
+
|
| 276 |
+
We use, instead: Et||U˜ t||2/||xt||2 ≤ 1 + Et 1µ+γt 2Et 11+γtµ . The rest of the proof goes through identically.
|
| 277 |
+
|
| 278 |
+
# A.1 DETAILS OF SYNTHETIC DATASETS
|
| 279 |
+
|
| 280 |
+
We generate datasets with uniformly distributed class conditional distributions. We generate 2D datasets by first sampling a random variable representing the Bayes classification error. The Bayes error is sampled uniformly from the interval 0.0 to 0.5. Next, we generate a balanced dataset where the data for each class lies within a unit rectangle and sampled uniformly. We overlap the sampling rectangular regions to generate a dataset with the desired Bayes error selected in the first step.
|
| 281 |
+
|
| 282 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 283 |
+
|
| 284 |
+
Our implementation is based on scikit-learn (Pedregosa et al., 2011). We fix the training time exploration parameter $\mu$ to 0.1. We train the exploration policy $\pi$ on 82 synthetic datasets each of size 3000 with uniform class conditional distributions, a total of $2 4 6 k$ samples (§A.1). We train $\pi$ using a linear classifier Breiman (2001) and set the hyper-parameters for the learning rate, and data scaling methods using three-fold cross-validation on the whole meta-training dataset. For the classifier class $\mathcal { F }$ , we use a linear model trained with stochastic gradient descent. We standardize all features to zero mean and unit variance, or scale the features to lie between zero and one. To select between the two scaling methods, and tune the classifier’s learning rate, we use three-fold cross-validation on a small fully supervised training set of size 30 samples. The same set is used to calibrate the predicted probabilities of $f _ { t }$ .
|
| 285 |
+
|
| 286 |
+
# A.3 LIST OF DATASETS
|
| 287 |
+
|
| 288 |
+
The datasets we used can be accessed at https://www.openml.org/d/<id>. The list of (id, size) pairs below shows the (id for the datasets we used and the dataset size in number of examples:
|
| 289 |
+
|
| 290 |
+
(46,100) (716, 100) (726, 100) (754, 100) (762, 100) (768, 100) (775, 100) (783, 100) (789, 100) (808, 100) (812, 100) (828, 100) (829, 100) (850, 100) (865, 100) (868, 100) (875, 100) (876, 100) (878, 100) (916, 100) (922, 100) (932, 100) (1473, 100) (965, 101) (1064, 101) (956, 106) (1061, 107) (771, 108) (736, 111) (448, 120) (782, 120) (1455, 120) (1059, 121) (1441, 123) (714, 125) (867, 130) (924, 130) (1075, 130) (1141, 130) (885, 131) (444, 132) (921, 132) (974, 132) (719, 137) (1013, 138) (1151, 138) (784, 140) (1045, 145) (1066, 145) (1125, 146) (902, 147) (1006, 148) (969, 150) (955, 151) (1026, 155) (745, 159) (756, 159) (1085, 159) (1054, 161) (748, 163) (747, 167) (973, 178) (463, 180) (801, 185) (1164, 185) (788, 186) (1154, 187) (941, 189) (1131, 193) (753, 194) (1012, 194) (1155, 195) (1488, 195) (446, 200) (721, 200) (1124, 201) (1132, 203) (40, 208) (733, 209) (796, 209) (996, 214) (1005, 214) (895, 222) (1412, 226) (820, 235) (851, 240) (464, 250) (730, 250) (732, 250) (744, 250) (746, 250) (763, 250) (769, 250) (773, 250) (776, 250) (793, 250) (794, 250) (830, 250) (832, 250) (834, 250) (863, 250) (873, 250) (877, 250) (911, 250) (918, 250) (933, 250) (935, 250) (1136, 250) (778, 252) (1442, 253) (1449, 253) (1159, 259) (450, 264) (811, 264) (336, 267) (1152, 267) (53, 270) (1073, 274) (1156, 275) (880, 284) (1121, 294) (43, 306) (818, 310) (915, 315) (1157, 321) (1162, 322) (925, 323) (1140, 324) (1144, 329) (1011, 336) (1147, 337) (1133, 347) (337, 349) (59, 351) (1135, 355) (1143, 363) (1048, 369) (860, 380) (1129, 384) (1163, 386) (900, 400) (906, 400) (907, 400) (908, 400) (909, 400) (1025, 400) (1071, 403) (1123, 405) (1160, 410) (1126, 412) (1122, 413) (1127, 421) (764, 450) (1065, 458) (1149, 458) (1498, 462) (724, 468) (814, 468) (1148, 468) (1150, 470) (765, 475) (767, 475) (1153, 484) (742, 500) (749, 500) (750, 500) (766, 500) (779, 500) (792, 500) (805, 500) (824, 500) (838, 500) (855, 500) (869, 500) (870, 500) (879, 500) (884, 500) (886, 500) (888, 500) (896, 500) (920, 500) (926, 500) (936, 500) (937, 500) (943, 500) (987, 500) (1470, 500) (825, 506) (853, 506) (872, 506) (717, 508) (1063, 522) (954, 531) (1467, 540) (1165, 542) (1137, 546) (335, 554) (333, 556) (947, 559) (949, 559) (950, 559) (951, 559) (826, 576) (1004, 600) (334, 601) (1158, 604) (770, 625) (997, 625) (1145, 630) (1443, 661) (774, 662) (795, 662) (827, 662) (931, 662) (292, 690) (1451, 705) (1464, 748) (37, 768) (1014, 797) (970, 841) (994, 846) (841, 950) (50, 958) (1016, 990) (31, 1000) (715, 1000) (718, 1000) (723, 1000) (740, 1000) (743, 1000) (751, 1000) (797, 1000) (799, 1000) (806, 1000) (813, 1000) (837, 1000) (845, 1000) (849, 1000) (866, 1000) (903, 1000) (904, 1000) (910, 1000) (912, 1000) (913, 1000) (917, 1000) (741, 1024) (1444, 1043) (1453, 1077)
|
| 291 |
+
|
| 292 |
+
(1068, 1109) (934, 1156) (1049, 1458) (1454, 1458) (983, 1473) (1128, 1545) (1130, 1545) (1138, 1545) (1139, 1545) (1142, 1545) (1146, 1545) (1161, 1545) (1166, 1545) (1050, 1563) (991, 1728) (962, 2000) (971, 2000) (978, 2000) (995, 2000) (1020, 2000) (1022, 2000) (914, 2001) (1067, 2109) (772, 2178) (948, 2178) (958, 2310) (312, 2407) (1487, 2534) (737, 3107) (953, 3190) (3, 3196) (1038, 3468) (871, 3848) (728, 4052) (720, 4177) (1043, 4562) (44, 4601) (979, 5000) (1460, 5300) (1489, 5404) (1021, 5473) (1069, 5589) (980, 5620) (847, 6574) (1116, 6598) (803, 7129) (1496, 7400) (725, 8192) (735, 8192) (752, 8192) (761, 8192) (807, 8192)
|
| 293 |
+
|
| 294 |
+
# A.4 BASELINE EXPLORATION ALGORITHMS
|
| 295 |
+
|
| 296 |
+
Our experiments aim to determine how MELˆ EE´ compares to other standard exploration strategies. In particular, we compare to:
|
| 297 |
+
|
| 298 |
+
$\epsilon$ -greedy: With probability $\epsilon$ , explore uniformly at random; with probability $1 - \epsilon$ act greedily according to $f _ { t }$ (Sutton, 1996). Experimentally, we found $\epsilon = 0$ optimal on average, consistent with the results of Bietti et al. (2018).
|
| 299 |
+
|
| 300 |
+
$\epsilon$ -decreasing: selects a random action with probabilities $\epsilon _ { i }$ , where $\epsilon _ { i } = \epsilon _ { 0 } / t , \epsilon _ { 0 } \in ] 0 , 1 ]$ and $t$ is the index of the current round. In our experiments we set $\epsilon _ { 0 } = 0 . 1$ . (Sutton & Barto, 1998)
|
| 301 |
+
|
| 302 |
+
Exponentiated Gradient $\epsilon$ -greedy: maintains a set of candidate values for $\epsilon$ -greedy exploration. At each iteration, it runs a sampling procedure to select a new $\epsilon$ from a finite set of candidates. The probabilities associated with the candidates are initialized uniformly and updated with the Exponentiated Gradient (EG) algorithm. Following Li et al. (2010b), we use the candidate set $\{ \epsilon _ { i } = 0 . 0 5 { \times } i + 0 . 0 1 , i = 1 , \cdot \cdot \cdot , 1 0 \}$ for $\epsilon$ .
|
| 303 |
+
|
| 304 |
+
LinUCB: Maintains confidence bounds for reward payoffs and selects actions with the highest confidence bound. It is impractical to run “as is” due to high-dimensional matrix inversions. We use diagonal approximation to the covariance when the dimensions exceeds 150. (Li et al., 2010a) $\tau$ -first: Explore uniformly on the first $\tau$ fraction of the data; after that, act greedily.
|
| 305 |
+
|
| 306 |
+
Cover: Maintains a uniform distribution over a fixed number of policies. The policies are used to approximate a covering distribution over policies that are good for both exploration and exploitation (Agarwal et al., 2014).
|
| 307 |
+
|
| 308 |
+
Cover Non-Uniform: similar to Cover, but reduces the level of exploration of Cover to be more competitive with the Greedy method. Cover-Nu doesn’t add extra exploration beyond the actions chose by the covering policies (Bietti et al., 2018).
|
| 309 |
+
|
| 310 |
+
In all cases, we select the best hyperparameters for each exploration algorithm following Bietti et al. (2018). These hyperparameters are: the choice of $\epsilon$ in $\epsilon$ -greedy, $\tau$ in $\tau$ -first, the number of bags, and the tolerance $\psi$ for Cover and Cover-NU. We set $\epsilon = 0 . 0$ , $\tau = 0 . 0 2$ , bag size $= 1 6$ , and $\psi = 0 . 1$ .
|
md/train/Bkl5kxrKDr/Bkl5kxrKDr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BklWt24tvH/BklWt24tvH.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING STRUCTURED COMMUNICATION FOR MULTI-AGENT REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Learning to cooperate is crucial for many practical large-scale multi-agent applications. In this work, we consider an important collaborative task, in which agents learn to efficiently communicate with each other under a multi-agent reinforcement learning (MARL) setting. Despite the fact that there has been a number of existing works along this line, achieving global cooperation at scale is still challenging. In particular, most of the existing algorithms suffer from issues such as scalability and high communication complexity, in the sense that when the agent population is large, it can be difficult to extract effective information for highperformance MARL. In contrast, the proposed algorithmic framework, termed Learning Structured Communication (LSC), is not only scalable but also learns efficiently. The key idea is to allow the agents to dynamically learn a hierarchical communication structure, while under such a structure the graph neural network (GNN) is used to efficiently extract useful information to be exchanged between the neighboring agents. A number of new techniques are proposed to tightly integrate the communication structure learning, GNN optimization and MARL tasks. Extensive experiments are performed to demonstrate that, the proposed LSC framework enjoys high communication efficiency, scalability, and global cooperation capability.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement learning (RL) has achieved remarkable success in solving single-agent sequential decision problems under interactive and complicated environments, such as games (Mnih et al., 2015; Silver et al., 2016) and robotics (Lillicrap et al., 2016). In many real world applications such as intelligent transportation systems (Adler & Blue, 2002) and unmanned systems(Semsar-Kazerooni & Khorasani, 2009), not only one, but usually a large number of agents are involved in the learning tasks. Such a setting naturally leads to the popular multi-agent reinforcement learning (MARL) problems, where the key research challenges include how to design scalable and efficient learning schemes under an unstationary environment (caused by partial observation and/or the dynamics of other agents’ policies), with large and/or dynamic problem dimension, and complicated and uncertain relationship between agents.
|
| 12 |
+
|
| 13 |
+
Learning to communicate among agents has been regarded as an effective manner to strengthen the inter-agent collaboration and ultimately improve the quality of policies learned by MARL. Various communication-based MARL algorithms have been devised recently, e.g., DIAL (Foerster et al., 2016), CommNet (Sukhbaatar et al., 2016), ATOC (Jiang & Lu, 2018), IC3Net (Singh et al., 2019) and TarMAC (Das et al., 2019). These schemes aim to improve the inter-agent collaboration by learning communication strategy to exchange information between agents. However, there are still two bottlenecks unresolved, especially when faced a large number of agents.
|
| 14 |
+
|
| 15 |
+
One bottleneck lies in that achieving effective communication and global collaboration is difficult with limited resources, such as narrow communication bandwidth and energy. In particular, DIAL and TarMAC require each agent to communicate with all the other agents, i.e., a fully-connected communication network (Figure 1(a)), which is not feasible for large scale scenarios with geographically apart agents. CommNet and IC3 assume a star network (Figure 1(b)) with a central node coordinating the global collaboration of agents, which again does not allow large scale scenarios with long range communications. ATOC introduces an interesting attention scheme to build a tree communication network (Figure 1(c)). While the tree network can be scaled, global collaboration has to be realized through inefficient multi-hop and sequential communications. In a word, improper communication topologies will limit the cooperation ability in large scale scenarios.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Topology of different communication structures and LSC falls into the hierarchical one.
|
| 19 |
+
|
| 20 |
+
Another bottleneck is the difficulty of extracting essential information to exchange between agents for achieving high-performance MARL, especially when the number of agents grows. Most of the existing works simply concatenate, take the mean or use the LSTM to extract information to be exchanged. First two lack in considering the inter-relationship between agents, and LSTM assumes that there is a fixed sequence of message passing between agents, that is, the relationship between agents is predefined. Recently, TarMAC utilized an attention scheme to aggregate messages by considering the relationship from each agent to all others. However, the improper communication topology still hinders the information extraction. The communication structure needs to be jointly designed with the information extraction scheme to achieve further improved learning performance.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2: Procedure for dynamically establishing structured communication network. Left: Each agent determines its communication importance weight based on partial local observation. For instance, the agent “G” finds the target (red square), then it will be possible to get a higher weight “4” and become the central. Right: The importance weight generation step and network construction step will be repeated iteratively. After communication and action procedures, agents will generate their new communication importance weights, and determine to keep or change their roles respectively. Further, the structured communication network will be re-established.
|
| 24 |
+
|
| 25 |
+
To address the above two issues, we propose a novel structured communication-based algorithm, called learning structured communication (LSC). Our LSC combines a structured communication network module and a communication-based policy module, which aims to establish a scalable hierarchically structured network and information exchange scheme for large scale MARL. In particular, a hierarchically structured communication network (Figure 1(d)) is dynamically learned based on local partial observations of agents. In the hierarchically structured network, all agents are grouped into clusters, where global collaboration can be achieved via intra-group and inter-group communications. In contrast to the other three types in Figure 1, the proposed hierarchical communication network is more flexible and scalable, with fewer resources needed to achieve long-range and global collaboration.
|
| 26 |
+
|
| 27 |
+
The procedure to establish such a hierarchically structured communication network is shown in Figure 2. To better utilize the relationship between agents given the hierarchically structured communication network and obtain more effective information extraction, graph neural network (GNN) (Scarselli et al., 2008) is employed. In GNN, each communication step involves information embedding and aggregation. Benefiting from the unordered aggregation power and the dynamic graph adaptability of GNN, the proposed LSC algorithm can extract valuable information effectively. The GNN-based information extraction procedure is depicted in Figure 3.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 3: GNN-based communication extraction procedure. Each node denotes an agent. The edge embedding can be considered as the communication message. The network learning procedure properly fits the communication procedure, and effectively learn valuable messages involving the global network structure and agents relationship. Left: Low-level normal agents transfer their local valuable embeddings to the associated central agents. Middle: High-level central agents communicate with each other to gain a sense of global perception. Right: All central agents broadcast embedding information to their normal agents to form global cooperation.
|
| 31 |
+
|
| 32 |
+
This paper is devoted to the learning of communication structure among agents. To our knowledge, this is the first work of hierarchical structured learning to communication for MARL. It allows to learn communication structure adaptively instead of using predefined forms. Specifically:
|
| 33 |
+
|
| 34 |
+
i) To improve scalability for a large number of agents, a hierarchical structure is devised that divides the agents into higher-level central agents and sub-level normal ones. As such, the communication network is sparsified. While it still allows for more effective global cooperation via message passing among the central agents, compared with the star/tree structures.
|
| 35 |
+
|
| 36 |
+
ii) For effective communication and global cooperation, the message representation learning is deeply integrated into the information aggregating and permeating through the network, via graph neural network (GNN), which is a natural combination with the hierarchical communication structure.
|
| 37 |
+
|
| 38 |
+
iii) Extensive experiments on both MAgent and StarCraft2 show our approach achieves state-of-theart scalability and effectiveness on large-scale MARL problems.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK AND PRELIMINARIES
|
| 41 |
+
|
| 42 |
+
Many multi-agent reinforcement learning algorithms without communication in the inference procedure have experienced fast development. Recent works like MADDPG (Lowe et al., 2017), QMIX (Rashid et al., 2018), COMA (Foerster et al., 2018) and MAAC (Iqbal & Sha, 2019) adopt a centralized training and decentralized implementing framework. All agents’ local observations and actions are considered to improve the learning stability. These algorithms are generally not suitable for large-scale case due to explosive growing number of agents.
|
| 43 |
+
|
| 44 |
+
Communication-based MARL algorithms have been showed effective for large-scale agent cooperation. Earlier works assume that all agents need to communicate with each other. DIAL (Foerster et al., 2016) learns to communication through back-propagating all other agents’ gradients to the message generator network. Similarly, CommNet (Sukhbaatar et al., 2016) sends all agents’ hidden states to the shared communication channel and further learns the message based on the average of all other hidden states. MFRL (Yang et al., 2018) approximates the influence of other agents by averaging the actions of surrounding neighbor agents, which could mitigate the dimensional disaster for large-scale cases. However, this can be considered as a predefined communication pattern, which is unable to adapt to complex large-scale scenarios. Communication between all agents will lead to high communication complexity and difficulty of useful information extraction. DGN (Jiang et al., 2018) employs graph convolution network (GCN) to extract relationships between agents which could result in better collaboration. However, it considers all agents equivalently and assumes the communication of each agent has to involve all neighbor agents which limits to adapt to more practical bandwidth-limited environments. IC3Net (Singh et al., 2019) uses a communication gate to decide whether to communicate with the center, but adopt the same star structure like CommNet which requires high bandwidth and can hard to extract valuable information with only one center. ATOC (Jiang & Lu, 2018) and TarMAC (Das et al., 2019) introduce the attention mechanism to determine when to communicate and whom to communicate with, respectively. TarMAC focuses more on message aggregation rather than the communication structure. SchedNet (Kim et al., 2019) aims to learn a weight-based scheduler to determine the communication sequence and priority. From the perspective of employing GNN into MARL, MAGNet (Malysheva et al., 2018) that utilizes a relevance graph representation of the environment and a message passing mechanism to help agents learning. However, it requires heuristic rules to establish the graph which is hard to achieve in complex environments. RFM (Tacchetti et al., 2019) use graph to represent the relationship between different entities, aiming to provide interpretable representations.
|
| 45 |
+
|
| 46 |
+
Before the main method, we introduce some preliminaries to facilitate the presentation.
|
| 47 |
+
|
| 48 |
+
Partial Observable Stochastic Games. In stochastic games, agents learn policies by maximizing their cumulative rewards through interacting with the environment and other agents. The partial observable stochastic games (POSG) can be characterized as a tuple $\langle \mathcal { T } , \mathcal { S } , \mathfrak { b } ^ { 0 } , \mathcal { A } , \mathcal { O } , \mathcal { P } , \mathcal { P } _ { e } , \mathcal { \bar { R } } \rangle$ where $\mathcal { T }$ denotes the set of agents indexed from 1 to $n ; S$ denotes the finite set of states; $b ^ { 0 }$ represents the initial state distribution and $\mathcal { A }$ denotes the set of joint actions. $A _ { i }$ is the action space of agent $i$ , $\mathbf { a } = \langle a _ { 1 } , \cdot , a _ { n } \rangle$ denotes a joint action; $\mathcal { O }$ denotes the joint observations and $O _ { i }$ is the observation space for agent $i$ , $\mathbf { o } = \langle o _ { 1 } , \cdot , o _ { n } \rangle$ denotes a joint observation; $\mathcal { P }$ denotes the Markovian transition distribution with $P \left( \tilde { s } , \mathbf { o } | s , \mathbf { a } \right)$ as the probability of state $s$ transit to $\tilde { s }$ and result o after taking action a. $\mathcal { P } _ { e } ( o | s )$ is the Markovian observation emission probability function. $\mathcal { R } : \mathcal { S } \times \mathcal { A } \mathbb { R } ^ { n }$ means the reward function for agents. The overall task of the MARL problem can be solved by properly objective function modeling, which also indicates the relationship among agents, e.g., cooperation, competition or mixed.
|
| 49 |
+
|
| 50 |
+
Graph Neural Network. Graph neural network (GNN) (Scarselli et al., 2008) is a deep embedding framework to handle graph-based data on a graph $\mathcal { G } = ( \nu , \mathcal { E } )$ . $\mathbf { v } _ { i }$ denotes the node feature vector for node $v _ { i } \in \mathcal V$ (for $N _ { v }$ nodes), $\mathbf { e } _ { k }$ denotes the edge feature vector for edge $e _ { k } \in \mathcal { E }$ (for $N _ { e }$ edges) with $r _ { k } , s _ { k }$ be the receiver and sender of edge $e _ { k }$ respectively. The vector u denotes the global feature. The graph network framework in (Battaglia et al., 2018) is employed, which divides computation on graph data to several blocks to gain flexible processing ability. Each block introduces the aggregation and embedding functions to handle graph data. There are many variants of GNN, like messagepassing neural network (Gilmer et al., 2017) and non local neural networks (Wang et al., 2018). By treating every agent as a node and each communication message exchanging as the edge in a graph, the observations and messages as the attributes of nodes and edges, respectively. The whole communication process can be formulated to a graph neural network. The relationships among agents can be effectively extracted to enable efficient communication message learning.
|
| 51 |
+
|
| 52 |
+
Independent Deep Q-Learning. Deep $Q$ -Network (DQN) (Mnih et al., 2015) is popular in deep reinforcement learning, which is one of the few RL algorithms applicable for large-scale MARL. In each step, each agent observes state $s$ and takes an action $a$ based on policy $\pi$ . It receives reward $r$ and next state $\tilde { s }$ from environment. To maximize the cumulative reward $\boldsymbol { R } = \textstyle \sum _ { t } \boldsymbol { r } _ { t }$ , DQN learns the action-value function $Q ^ { \pi } ( s , a ) = \mathbb { E } _ { s \sim \mathcal { P } , a \sim \pi ( s ) }$ $[ R _ { t } | s _ { t } = s , a _ { t } = a ]$ by minimizing $\mathcal { L } ( \boldsymbol { \theta } ) = \mathbb { E } _ { s , a , r , \tilde { s } } \left[ \tilde { y } - Q ( s , a ; \boldsymbol { \theta } ) \right]$ , where $\tilde { y } = r + \gamma \operatorname* { m a x } _ { \tilde { a } } Q \left( \tilde { s } , \tilde { a } ; \theta \right)$ . The agent follows $\epsilon$ -greedy policy, that is, selects the action that maximizes the $Q$ -value with probability $_ { 1 - \epsilon }$ or randomly. The Independent Deep $Q$ -Learning (IDQN) (Tampuu et al., 2017) is an extension of DQN by ignoring the influence of other agents for multi-agent case. Every agent learns a $Q$ -function $Q ^ { a } ( u ^ { a } | s ; \theta ^ { a } )$ based on its own observation and received reward.
|
| 53 |
+
|
| 54 |
+
Our algorithm employs DQN as the basic RL algorithm based on the following two considerations: 1) our algorithm is dedicated to discuss the learning communication mechanism in largescaleMARL scenarios, as a result we can choose a concise and effective basic RL algorithm like thewell-known DQN; 2) data collection in large-scale MARL environments is extremely inefficiently,while DQN has excellent data efficiency as an offline RL algorithm.
|
| 55 |
+
|
| 56 |
+
# 3 LSC: LEARNING STRUCTURED COMMUNICATION
|
| 57 |
+
|
| 58 |
+
Our communication architecture has two key modules: structured communication network module and communication-based policy module, shown in Figure 4. The first module aims to establish the dynamic hierarchical structured communication network in a distributed fashion, while the second module contains the GNN-based communication extraction and $Q$ -network components. Without loss of generality, we use DQN as the basic reinforcement algorithm, however our approach can incorporate any value-based or actor-critic methods. The details of LSC is depicted in Algorithm 1
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 4: Algorithm framework of LSC with Structured Communication Network Module and Communication-based Policy Module, where $s _ { i }$ , $o _ { i }$ , $a _ { i }$ and $w _ { i }$ denote state (global perception), observation, action and importance weight of agent $i$ . The former module uses partial observation to establish the communication structure. The latter employs GNN-based communication and $Q$ - Network to extract communication content and produces collaboration policies respectively based on established communication structure.
|
| 62 |
+
|
| 63 |
+
1: Initialization: weight generator parameters $\theta ^ { w }$ , $Q$ -net parameters $\theta ^ { Q }$ , GNN parameters $\theta ^ { g n n }$ ,
|
| 64 |
+
target $Q$ -net parameters $\theta ^ { \tilde { Q } }$ , replay buffer $\mathcal { R } = \emptyset$ , group radius $d$ , the number of agents $n$ ;
|
| 65 |
+
2: for Episode $= 1 , \cdots , M$ do
|
| 66 |
+
3: Reset $t = 0$ , global state $s ^ { t }$ and observation $o _ { i } ^ { t }$ for each agent $i$ , Normal agents set $\mathcal { V } _ { n } ^ { t } =$
|
| 67 |
+
{all agents} and $\bar { \mathcal { V } } _ { c } ^ { t } = \mathcal { O }$ ;
|
| 68 |
+
4: for $t = 1 , \cdots , T$ and $s _ { t } \neq$ terminal do
|
| 69 |
+
5: for each agent $i$ do
|
| 70 |
+
6: With probability $\epsilon$ pick a random action $\boldsymbol { w } _ { i } ^ { t }$ else $w _ { i } ^ { t } = \arg \operatorname* { m a x } _ { \{ w _ { i } \} } Q _ { \theta ^ { w } } ( o _ { i } ^ { t } )$ ;
|
| 71 |
+
7: Get current position $\mathrm { P O S s } _ { i } ^ { t }$ of each agent $i$ ;
|
| 72 |
+
8: $( \boldsymbol { \gamma } _ { n } ^ { t } , \boldsymbol { \gamma } _ { c } ^ { t } , \boldsymbol { \mathcal { E } } ) = \mathrm { C B R P } ( ( \boldsymbol { \gamma } _ { n } ^ { t - 1 } , \boldsymbol { \gamma } _ { c } ^ { t - 1 } ) , \{ \boldsymbol { w } _ { 1 } ^ { t } , \cdots , \boldsymbol { w } _ { n } ^ { t } \} , \{ \mathrm { P O S s } _ { 1 } ^ { t } , \cdots , \mathrm { P O S s } _ { n } ^ { t } \} , d ) ;$
|
| 73 |
+
9: $\left\{ q _ { 1 } ^ { t } , \cdot \cdot \cdot , q _ { n } ^ { t } \right\} = \mathrm { H C O M M } ( \mathcal { V } _ { n } ^ { t } , \mathcal { V } _ { c } ^ { t } , \mathcal { E } )$ ;
|
| 74 |
+
10: for each agent $i$ do
|
| 75 |
+
11: With probability $\epsilon$ pick a random action $a _ { i } ^ { t }$ else choose the action that has the largest
|
| 76 |
+
12: value in the vector $\mathbf { \bar { \rho } } _ { q _ { i } ^ { t } }$ ;
|
| 77 |
+
13: Execute global actions and get global reward $r ^ { t }$ , next state $s ^ { t + 1 }$ , next observation $o ^ { t + 1 }$ ;
|
| 78 |
+
14: Get updated position $\mathrm { P O S s } _ { i } ^ { t + 1 }$ for each agent $i$ ;
|
| 79 |
+
15: Store $\begin{array} { r } { ( s ^ { t } , o ^ { t } , \{ \mathrm { P O S s } _ { 1 } ^ { t } , \cdot \cdot \cdot , \mathrm { P O S s } _ { n } ^ { t } \} , a ^ { t } , r ^ { t } , o ^ { t + 1 } , \{ \mathrm { P O S s } _ { 1 } ^ { t + 1 } , \cdot \cdot \cdot , \mathrm { P O S s } _ { n } ^ { t + 1 } \} , s ^ { t + 1 } ) \cup \{ \mathrm { P O S s } _ { 1 } ^ { t } , \cdot \cdot \cdot , \mathrm { P O S s } _ { n } ^ { t } \} , s ^ { t + 1 } ) \mathrm { ~ ; ~ } } \end{array}$ to $\mathcal { R }$ ;
|
| 80 |
+
16: for $k = 1 , \cdots , K$ do
|
| 81 |
+
17: Sample a random mini-batch transitions from $\mathcal { R }$ ;
|
| 82 |
+
18: Update weight generator $\theta ^ { w }$ by minimizing Eq. (1);
|
| 83 |
+
19: Update communication based policy module $( \theta ^ { Q } , \theta ^ { g n n } )$ by minimizing Eq. (2);
|
| 84 |
+
20: Update the target networks through Eq. (3).
|
| 85 |
+
|
| 86 |
+
Specifically, the CBRP function automatically and distributively establishes the structured communication network based on the learnt importance weights. The HCOMM function denotes the communication-based policy module, which outputs the $Q$ -values based on the GNN-based communication messages. Both CBRP and HCOMM are discussed in the following subsections, and the details of CBRP and HCOMM can be found in Appendix.
|
| 87 |
+
|
| 88 |
+
# 3.1 STRUCTURED COMMUNICATION NETWORK MODULE
|
| 89 |
+
|
| 90 |
+
The structured communication network module takes the role of establishing a hierarchical structured communication network which will be employed in communication-based policy module. Two sub-modules are included, i.e., the weight generator and the Cluster Based Routing Protocol (CBRP). The weight generator sub-module aims to determine the importance weight for each agent automatically. It is modeled through a neural network $f _ { w g } : o w$ , where the weight $w$ can measure the confidence of an agent to become a center. Further, the CBRP sub-module employs the weights of all agents $\{ w _ { i } \}$ to construct the hierarchical structured communication network. To emphasize, the CBRP sub-module can be implemented in a distributed fashion, as a result, the central agents can be elected distributedly. This advantage ensures the practicability for large-scale case.
|
| 91 |
+
|
| 92 |
+
The CBRP method (Rezaee & Yaghmaee, 2009) is a typical method for establishing a hierarchical routing structure. The key idea for CBRP is that each agent will check whether central agent or agent that has larger weight $w$ exists in its receptive area. The agent will become a central agent if no above agent is found, else it will keep its own role. With enough checking steps, each agent will either be an central agent or in some central agents’ receptive. All agents can be separated into several groups with each central agent as the group leader. The overall hierarchical structured communication network further will be established by fully connecting all central agents from different groups and connecting the agents in each group to their central agent.
|
| 93 |
+
|
| 94 |
+
There is a strong connection between these two modules in LSC algorithm. Different generated weights will lead to different hierarchical structured communication network, which would cause diverse performance of the communication-based policy. Some experiment results also have confirmed that the weights have a great influence on the performance, which motivates us to train these two modules end-to-end. However the CBRP sub-module is not differentiable, which means the gradients cannot be back-propagated from communication-based policy module to the weight generator sub-module. Therefore, we introduce another RL task as an auxiliary, i.e., each agent takes its weight as an action by treating the communication-based policy module as an extra unobservable part of the environment, and receiving the same reward as the main RL task in the communication-based policy module discussed below. Moreover the weight $w$ is constrained in the integer set $\{ 0 , 1 , 2 , 3 , 4 \}$ . The action space becomes discrete, as a result DQN algorithm can be used again to train the weight generator. At this time, the weight generator can be regarded as a $Q$ -value function. The loss $\ell ( \theta ^ { w } )$ for the weight generator sub-module becomes clear as follows, with $y _ { i } = r _ { i } + \gamma \operatorname* { m a x } _ { \tilde { w } _ { i } } Q _ { \theta ^ { w } } ( \tilde { o } _ { i } , \tilde { w } _ { i } )$ . $r _ { i }$ denotes the reward received for agent $i$ from environment.n
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\ell ( \theta ^ { w } ) ^ { \smile } = \mathbb { E } _ { { \mathbf { o } } , { \mathbf { w } } , r , { \tilde { \mathbf { o } } } } \big [ \sum _ { i = 1 } ( Q _ { \theta ^ { w } } ( o _ { i } , w _ { i } ) - y _ { i } ) ^ { 2 } \big ] .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 3.2 COMMUNICATION-BASED POLICY MODULE
|
| 101 |
+
|
| 102 |
+
After the structured communication network topology is determined, the communication-based policy module will learn the communication content and generate the final global collaboration policy. The communication-based policy module consists of two sub-modules, i.e., GNN-based communication sub-module and the $Q$ -Net sub-module. The first one aims to learn the communication messages and further update overall state perception, while the other sub-module learns the policy based on the new state perceptions after efficient communication. Different from many existing works (Foerster et al., 2016; Das et al., 2019; Singh et al., 2019), the agents play differently in the GNN-base communication sub-module. Central agents should guarantee high-level information and dominate the agents in their driven groups respectively. The hope is that such a structure can ensure the effectiveness of communication and the efficiency of intra-group and inter-group collaboration.
|
| 103 |
+
|
| 104 |
+
Recall Figure 3, the well-established hierarchical structured communication network can be represented by a tuple $( \nu , \mathcal { E } )$ while the edges are directed. The node set $\nu$ contains $N _ { v }$ nodes which can be divided into the central node set $\mathcal { V } _ { c }$ and the normal node set $\nu _ { n }$ . For central node $i \in \mathcal { V } _ { c }$ , the node feature vector $v _ { i }$ includes the embedding feature $v _ { i } ^ { n }$ , the central role feature $v _ { i } ^ { c }$ and the global feature $v _ { i } ^ { g }$ ; for normal node $i \in \mathcal { V } _ { n }$ , the node feature vector $v _ { i }$ only includes the embedding feature $v _ { i } ^ { n }$ . For each edge $( i \to j ) \in \mathcal { E }$ with $i , j \in \mathcal { V }$ , the edge feature vector is denoted as $e _ { i j }$ . Functions $\phi$ and $\rho$ denote the update embedding function and aggregate function respectively. As shown in Figure 3, the overall GNN-based communication sub-module consists of three steps, and the GNN operation is detailed in Table 1 and as follows:
|
| 105 |
+
|
| 106 |
+
Step 1: Intra-group aggregation. In each group, the normal agent embeds their local information and sends it to the associated central agent $j \in \mathcal { V } _ { c }$ ; the central agent aggregates the information from all associated normal agents and updates its central role feature;
|
| 107 |
+
|
| 108 |
+
Step 2: Inter-group sharing. The central agent communicates with the other central agent with cluster information, further aggregates the received and indicates the global perception;
|
| 109 |
+
|
| 110 |
+
Step 3: Intra-group sharing. The central agent communicates all its feature with the associated normal agents while the normal agent aggregates the received information from central agents. Both the embedding feature of central and normal agents will be updated.
|
| 111 |
+
|
| 112 |
+
Table 1: GNN-based Communication Architecture
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan=1 colspan=1>Type</td><td rowspan=1 colspan=1>Edge(i→j)∈ε</td><td rowspan=1 colspan=1>EdgeUpdateScheme</td><td rowspan=1 colspan=2>NodeUpdateScheme</td></tr><tr><td rowspan=1 colspan=1>Step1:intra-group aggregation</td><td rowspan=1 colspan=1>i∈Vn,j∈Vc</td><td rowspan=1 colspan=1>eij=(u),ej=p({eijf(i→)∈ε)</td><td rowspan=1 colspan=1>u=Φ(ej,u")</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Step 2: inter-group sharing</td><td rowspan=1 colspan=1>iEVc,j∈Vc</td><td rowspan=1 colspan=1>eij=Φ(u,u),ej=p({eij(i→j)∈ε)</td><td rowspan=1 colspan=2>u=Φ(e,)</td></tr><tr><td rowspan=1 colspan=1>Step 3: intra-group sharing</td><td rowspan=1 colspan=1>iEVc,jEVnUVc</td><td rowspan=1 colspan=1>eij=(u,v,v),ej=p({eijs(i→)∈ε)</td><td rowspan=1 colspan=2>U=Φ(e,U),U=Φ(ej,U")</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 2: Comparison of different MARL algorithms for communication efficiency.
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan=1 colspan=1>Algorithm</td><td rowspan=1 colspan=1>DIAL</td><td rowspan=1 colspan=1>CommNet</td><td rowspan=1 colspan=1>IC3</td><td rowspan=1 colspan=1>ATOC</td><td rowspan=1 colspan=1>LSC</td></tr><tr><td rowspan=1 colspan=1>Nmsg</td><td rowspan=1 colspan=1>O(n2)</td><td rowspan=1 colspan=1>O(n)</td><td rowspan=1 colspan=1>O(n)</td><td rowspan=1 colspan=1>O(kb)</td><td rowspan=1 colspan=1>O(k² + kb)</td></tr><tr><td rowspan=1 colspan=1>Nstep</td><td rowspan=1 colspan=1>0(1)</td><td rowspan=1 colspan=1>0(1)</td><td rowspan=1 colspan=1>0(1)</td><td rowspan=1 colspan=1>O(d)</td><td rowspan=1 colspan=1>0(1)</td></tr><tr><td rowspan=1 colspan=1>Nb-r</td><td rowspan=1 colspan=1>O(n)</td><td rowspan=1 colspan=1>O(n)</td><td rowspan=1 colspan=1>O(n)</td><td rowspan=1 colspan=1>0(6)</td><td rowspan=1 colspan=1>O(max(b,k))</td></tr></table>
|
| 119 |
+
|
| 120 |
+
The GNN-based communication sub-module is modeled as a GNN $( f _ { \theta ^ { g n n } } )$ with parameter $\theta ^ { g n n }$ , while the following $Q$ -Net of agent $i$ $( Q _ { \theta ^ { Q } } ^ { i } )$ is parameterized by shared parameter $\bar { \theta } ^ { Q }$ . The gradient can be back-propagated from $Q$ -Net to the graph neural network, as a result the overall loss of communication based policy module is as follows:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\ell ( \theta ^ { Q } , \theta ^ { g n n } ) : = \mathbb { E } _ { { \mathbf { o } } , { \mathbf { a } } , r , { \tilde { \mathbf { o } } } } \left[ \sum _ { i = 1 } ^ { n } \left( Q _ { \theta ^ { Q } } ^ { i } \big ( f _ { \theta ^ { g n n } } ( \mathbf { o } ) , a _ { i } \big ) - y _ { i } \right) ^ { 2 } \right] ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\begin{array} { r } { y _ { i } \ = \ r _ { i } + \gamma \operatorname* { m a x } _ { { \tilde { a } } _ { i } } Q _ { \theta ^ { Q } } ^ { i } \big ( f _ { \theta ^ { g n n } } ( \tilde { \mathbf { o } } ) , \tilde { a } _ { i } \big ) } \end{array}$ . $r _ { i }$ denotes the reward received for agent $i$ from environment. Some softly updating scheme is further employed to update target network, i.e.,
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\theta ^ { \tilde { Q } } = \tau \theta ^ { Q } + ( 1 - \tau ) \theta ^ { \tilde { Q } } , \quad \mathrm { a n d } \quad \theta ^ { g \tilde { n } n } = \tau \theta ^ { g n n } + ( 1 - \tau ) \theta ^ { g \tilde { n } n } .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Here we discuss communication efficiency from three aspects: the number of message exchanging $( N _ { m s g } )$ among agents; the number of steps during the communication procedure $( N _ { s t e p } )$ ; the communication bandwidth and range requirements for each agent $( N _ { b - r } )$ , and $n$ is the total number of agents. The details about communication efficiency are presented in Table 2 for each stage of the MARL algorithms. For DIAL, each agent communicates with all other agents based on the fullyconnected network, which results in $\bar { \mathcal { O } } ( n ^ { 2 } )$ message exchanging complexity. DIAL need only one communication step, however the communication bandwidth and range requirement for each agent is high and in the order of ${ \mathcal { O } } ( n )$ . Different from DIAL, CommNet and IC3 both employ the star communication network, as a result the number of message exchanging is in the order of ${ \mathcal { O } } ( n )$ . $N _ { s t e p }$ and $N _ { b - r }$ are the same as DIAL. The communication complexity of ATOC and our proposed LSC depends on the number of groups (denoted as $k < n$ , which is automatically determined in the algorithms) and the maximum output degree of the communication network (denoted as $b < n$ ). For ATOC, the communication network it tree-type, so that it only need to exchange $\mathcal { O } ( k b )$ messages. However, the number of steps is larger for ATOC for its sequential property and is in the order of $\mathcal O ( d )$ $\cdot d$ denotes the depth of the communication network). $N _ { b - r }$ will become much smaller to be ${ \mathcal { O } } ( b )$ because communication happens in groups. Furthermore for our LSC, the number of message exchanging is a bit larger than ATOC due to the communication among all elected centers, i.e., $\check { \mathcal { O } } ( k ^ { 2 } + k b )$ . However the depth of the hierarchical communication network is only two which results in $\mathcal { O } ( 1 )$ communication steps, while $N _ { b - r }$ is in the order of ${ \mathcal { O } } ( \operatorname* { m a x } ( b , k ) )$ . Overall, our LSC algorithm has advantage in the communication efficiency.
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
We compare LSC with state-of-the-art MARL methods in two large-scale battle environments, i.e., the grid world platform MAgent (Zheng et al., 2017) and StarCraft2 (Samvelyan et al., 2019), to evaluate their performances from aspects of both network structure and communication.
|
| 137 |
+
|
| 138 |
+
# 4.1 LARGE SCALE BATTLE GAME IN MAGENT
|
| 139 |
+
|
| 140 |
+
Settings. In a MAgent battle, agents fighting against enemies in a $4 0 \times 4 0$ grid world. Each agent only receives its local observation, acts independently and cooperatively, and further gains its reward. The goal for each agent is to attack its enemies and prevent them from being attacked. Each agent from both sides has a $6 \times 6$ visual field and can attack its 8 adjacent grids. The speed, attack power and health point for each agent are 1, 1 and 4, which are increased to 2, 2 and 10 for the enemy to increase the difficulty. The reward is $+ 5$ for successfully attacking an enemy, $- 2$ for being killed and $- 0 . 0 1$ for attacking a blank grid.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
|
| 144 |
+
Baselines. To evaluate the effects of communication scheme, three peer methods on learning to communicate for MARL, i.e., CommNet, IC3 and ATOC, are chosen to compete with our proposed LSC. Considering the weakness of mean aggregation, we replace the aggregation function of CommNet and IC3 with GNN which is same as LSC. The group radius is 6, the same as the visual field, in ATOC and LSC. All communication messages are embedded to 3-dimension vectors for cost-effectiveness. Besides, two MARL methods with no communication, i.e., IDQN and MFQ are also compared, since they are widely used in large-scale environments. In MAgent, the policy of enemy is pretrained by IDQN.
|
| 145 |
+
|
| 146 |
+
Policy performance. Figure 5(a) and Table 3 show the overall performances of compared algorithm in a 64 vs. 64 battle. The learning curves in Figure 5(a) present the average reward of different agents by epoch. LSC achieves better rewards quickly after 700 epochs and finally converges to an obvious higher point (about 1.15) than baselines. Table 3 and Table 4 give quantitative comparisons of these methods. Each algorithm is given 50 trials with its well-trained model. Mean-reward, $N _ { k i l l }$ , $N _ { d e a d }$ , $R a t i o _ { k d }$ in Table 3 denote the mean of average final rewards of agents, the number of killed enemies and dead agents, and the ratio $N _ { k i l l } / N _ { d e a d }$ , respectively. Following Figure 5(a), LSC can obtain a better mean reward stably, with a $3 0 \%$ performance advantage at least. $N _ { k i l l }$ are similar, because all approaches fulfill the mission, and beat the pre-trained IDQN. It is achieved by LSC with the least casualty, i.e., the smallest $N _ { d e a d }$ and the highest $R a t i o _ { k d }$ . Table 4 gives the comparisons in terms of the number of epochs to achieve the same reward value from 0.7 to 1.2 within maximal 1750 epochs in the training procedure. One can see that LSC needs fewer epochs to achieve the same reward compared with all the other algorithms, while more reward can be guaranteed within the maximal epochs. These results indicate that LSC can promote collaboration and cooperation, and produce superior policies.
|
| 147 |
+
|
| 148 |
+
Communication effectiveness. As observed from the blue and orange curves in Figure 5(a) and the first and fifth columns in Table 3, that LSC outperforms IDQN greatly. Since IDQN is the special case of LSC without communication procedure, this phenomenon demonstrates the usefulness of our proposed communication solution. Meanwhile, it can be noted that LSC also surpasses other MARL with communication algorithms, which is the consequence of its advanced structure. As mentioned in our experiments, CommNet and IC3 adopt the same message dimension and the same aggregation function as LSC, which leads to better performances than the original versions. However, the star structure makes the center node need to process all agents’ information in CommNet and IC3. When the agent number increases, the message extraction could be difficult. Thus, the final performances cannot be compared with the LSC. For ATOC in large scale environments, the message needs to jump multiple times between local circles, and multiple information aggregation and extraction bring in approximation error, which results in policy deterioration.
|
| 149 |
+
|
| 150 |
+
Scalability. Figure 5(b) shows the total reward curves of team by the agent number (10-99). Especially when the team has 99 agents, the reward of LSC is 1.45-2.75 times of other methods. It can be seen that the structured communication of LSC confers superior performances at different scales, because it utilizes the divide-and-conquer strategy to automatically group local agents and aggregate centers. In Figure 5(b) When the agent number is less than 80, the communication between agents can help to learn policy, so the orange dashed line is almost bellow other lines. When the number is more than 80, the demand of star-style information processing exceed the ability of aggregation network, thus CommNet and IC3 are inferior to IDQN. For ATOC, the jump of message becomes the bottleneck as the agent number increases, as inspected in the analysis above. To sum up, the experiments indicate LSC obviously has better scalability than the baseline.
|
| 151 |
+
|
| 152 |
+
Table 3: Performance comparisons in terms of average mean-reward, numbers and ratio of kills and death (64 vs. 64 agents, in 50 testing trials). The bold stands for the best result in each row.
|
| 153 |
+
|
| 154 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>LSC</td><td rowspan=1 colspan=1>CommNet</td><td rowspan=1 colspan=1>IC3</td><td rowspan=1 colspan=1>ATOC</td><td rowspan=1 colspan=1>IDQN</td><td rowspan=1 colspan=1>MFQ</td></tr><tr><td rowspan=1 colspan=1>Mean-reward</td><td rowspan=1 colspan=1>1.11</td><td rowspan=1 colspan=1>0.86</td><td rowspan=1 colspan=1>0.93</td><td rowspan=1 colspan=1>0.58</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.83</td></tr><tr><td rowspan=1 colspan=1>Nkill</td><td rowspan=1 colspan=1>62.6</td><td rowspan=1 colspan=1>61.3</td><td rowspan=1 colspan=1>62.48</td><td rowspan=1 colspan=1>61.46</td><td rowspan=1 colspan=1>62.1</td><td rowspan=1 colspan=1>62</td></tr><tr><td rowspan=1 colspan=1>Ndead</td><td rowspan=1 colspan=1>28.9</td><td rowspan=1 colspan=1>31.64</td><td rowspan=1 colspan=1>32.0</td><td rowspan=1 colspan=1>51.42</td><td rowspan=1 colspan=1>32.3</td><td rowspan=1 colspan=1>31.4</td></tr><tr><td rowspan=1 colspan=1>Ratiokd</td><td rowspan=1 colspan=1>2.16</td><td rowspan=1 colspan=1>1.93</td><td rowspan=1 colspan=1>1.95</td><td rowspan=1 colspan=1>1.20</td><td rowspan=1 colspan=1>1.92</td><td rowspan=1 colspan=1>1.97</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 4: Comparisons on the used epoch number to achieve same reward of the training procedure in the MAgent environment.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan=1 colspan=1>Reward</td><td rowspan=1 colspan=1>LSC</td><td rowspan=1 colspan=1>CommNet</td><td rowspan=1 colspan=1>IC3</td><td rowspan=1 colspan=1>ATOC</td><td rowspan=1 colspan=1>IDQN</td><td rowspan=1 colspan=1>MFQ</td></tr><tr><td rowspan=1 colspan=1>0.7</td><td rowspan=1 colspan=1>769</td><td rowspan=1 colspan=1>1199</td><td rowspan=1 colspan=1>787</td><td rowspan=1 colspan=1>933</td><td rowspan=1 colspan=1>1133</td><td rowspan=1 colspan=1>1254</td></tr><tr><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>828</td><td rowspan=1 colspan=1>1292</td><td rowspan=1 colspan=1>935</td><td rowspan=1 colspan=1>1151</td><td rowspan=1 colspan=1>1460</td><td rowspan=1 colspan=1>1304</td></tr><tr><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>1051</td><td rowspan=1 colspan=1>1525</td><td rowspan=1 colspan=1>1508</td><td rowspan=1 colspan=1>1471</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1426</td></tr><tr><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1271</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1588</td><td rowspan=1 colspan=1>1506</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>1.1</td><td rowspan=1 colspan=1>1413</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>1619</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>1.2</td><td rowspan=1 colspan=1>1704</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>
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 6: Behavior illustration. The first row shows two typical behavior by LSC. In the second row, the top and bottom plot denote the early state and the near to final battle state, respectively.
|
| 162 |
+
|
| 163 |
+
Message visualization. To analyze the communication messages learned by GNN, we execute LSC with its well-trained policy 50 times, and visualize the 3 dimensional vector sent by central nodes in Figure 5. Observing Figure 5(c) and 5(d), after receiving messages, the majority of agents choose to move, and the minority choose to attack. This means that agents in LSC is very positive to adjust the team formation and then cooperate to attack. It is worthy to notice that most messages have a small norm (less than 10), and the norm of a large proportion is around 0. From the aspect of optimization, the redundant messages with larger norm will bring in more noise to other agents. In this way, LSC minimizes the impact of redundant messages on the final performance. This similar phenomenon that central nodes is nearly silent in many cases, is also mentioned by CommNet (Sukhbaatar et al., 2016). Therefore, the message representation module via the GNN-based communication module can generate meaningful and efficient messages theoretically and empirically.
|
| 164 |
+
|
| 165 |
+
Behavior pattern. Here, we demonstrate the battle tactics evolved for MARL via structured communication. To analyzed the globally cooperation strategy of LSC, we visualize the progress of the battle. For fairness, we start six algorithms from the same state in Figure 6(a). The typical behavior patterns learnt by LSC are presented in the figures of the first row. Via the intra-group communication and cooperation, in Figure 6(b), the blue team (LSC) organizes an encirclement to nearby red enemies; the team has a local numerical superiority, and focus agents’ fire to wipe out enemies, denoted by the black attack arrows in Figure 6(c). These show the intra-group cooperation of LSC. Upper figures in the second row of Figure 6 shows the situation of early stage (17 steps) after initialization for six methods, and lower figures show the states after 50 steps. From these results, we may arrive a conclusion that the team with our LSC can beat the opponent more quickly with a more aggressive policy. By intra-group and inter-group collaboration, Figure 6(d) LSC has carried out encircling and fire-focusing many times, and achieves an enormous advantage within only 17 steps, and wipe out the enemies within 50 steps. For both IDQN and MFQ, agents tend to cooperate within their visual range, and once the agents get separated out of visual range, they can hardly form global cooperation, which lead to the failure result in Figure 6(h) and 6(i). Similarly, agents controlled by ATOC communicate only among group range, thus they encounter similar situations. Agents for CommNet and IC3 have global communication, however once some agents get far away from the central agents, central agents can hardly understand their messages, making ineffective cooperation. As Figure 6(e) and 6(f), some agents get far away from the majority of agents, thus their results are not ideal. To sum up, in Figure 6(d), agents controlled by LSC form a global encircle strategy by communication in both intra-group and inter-group, thus LSC-based agents can wipe out enemies faster than the baselines.
|
| 166 |
+
|
| 167 |
+
# 4.2 LARGE SCALE BATTLE GAME IN STARCRAFT2
|
| 168 |
+
|
| 169 |
+
Battle game in StarCraft2 is a confrontation between two marine teams shown in appendix, which is much more complex than MAgent. Specifically, we use a 25 vs. $\mathrm { 2 5 \ m a p }$ , i.e., $\bf { 2 5 m }$ , where the range vision is 9 and the map size is $1 9 2 0 \times 1 2 0 0$ . To evaluate the cooperation, agents one team are controlled by the individual learned policy. Here, we compare our LSC with IQDN, Commnet and IC3. The action space consists of movement to an adjacent grid and shooting with the range 6. We adopt the same dense reward setting (0.44 for killing an enemy, 8.9 for winning the battle) as SMAC (Samvelyan et al., 2019). Agents of the enemy are controlled by the built-in game AI.
|
| 170 |
+
|
| 171 |
+
In Figure 7, LSC outperforms compared algorithms, where the blue reward curve is much higher than others. Although the agent number (25) is fewer than MAgent, the observation and action space of StarCraft2 are much larger, leading to the difficulty to learn policy. Therefore, the performance of IDQN and MFQ degrades notably in this complex environment, while LSC, IC3, CommNet and ATOC outperform it. This is because they entail communication to facilitate cooperation. Moreover, LSC outperforms IC3, CommNet and ATOC. This demonstrates that flexible hierarchical communication and expressive GNN-based message extraction make LSC more qualified for complex tasks than CommNet and IC3’s star-style communication.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 7: Reward curves on StarCraft2
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 177 |
+
|
| 178 |
+
In this paper, a novel learning structured communication (LSC) algorithm is proposed for multiagent reinforcement learning. The hierarchical structure is self-learned by cluster based routing protocol. The communication message representation is naturally embedded and extracted via a graph neural network. Experiments in large-scale games (MAgent and StarCraft2) demonstrated that our LSC can outperform existing learning-to-communicate algorithms with better communication efficiency, cooperation capability, and scalability. In the future, we will improve LSC by considering some practical constraints, such as communication bandwidth and delay.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Jeffrey L Adler and Victor J Blue. A cooperative multi-agent transportation management and route guidance system. Transportation Research Part C: Emerging Technologies, 10(5-6):433–454, 2002.
|
| 183 |
+
|
| 184 |
+
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulcehre, Francis Song, Andrew Ballard, Justin Gilmer, George Dahl, Ashish Vaswani, Kelsey Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks, 2018.
|
| 185 |
+
|
| 186 |
+
Abhishek Das, Theophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Mike Rabbat, and ´ Joelle Pineau. TarMAC: Targeted multi-agent communication. In ICML, pp. 1538–1546, 2019.
|
| 187 |
+
|
| 188 |
+
Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In NeurIPS, pp. 2137–2145, 2016.
|
| 189 |
+
|
| 190 |
+
Jakob N Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. In AAAI, pp. 2974–2982, 2018.
|
| 191 |
+
|
| 192 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In ICML, pp. 1263–1272, 2017.
|
| 193 |
+
|
| 194 |
+
Shariq Iqbal and Fei Sha. Actor-attention-critic for multi-agent reinforcement learning. In ICML, pp. 2961–2970, 2019.
|
| 195 |
+
|
| 196 |
+
Jiechuan Jiang and Zongqing Lu. Learning attentional communication for multi-agent cooperation. In NeurIPS, pp. 7254–7264, 2018.
|
| 197 |
+
|
| 198 |
+
Jiechuan Jiang, Chen Dun, and Zongqing Lu. Graph convolutional reinforcement learning for multiagent cooperation. ArXiv, abs/1810.09202, 2018.
|
| 199 |
+
|
| 200 |
+
Daewoo Kim, Sangwoo Moon, David Hostallero, Wan Ju Kang, Taeyoung Lee, Kyunghwan Son, and Yung Yi. Learning to schedule communication in multi-agent reinforcement learning. In ICLR, 2019.
|
| 201 |
+
|
| 202 |
+
Timothy Lillicrap, Jonathan Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. In ICLR, 2016.
|
| 203 |
+
|
| 204 |
+
Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, OpenAI Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In NeurIPS, pp. 6379–6390, 2017.
|
| 205 |
+
|
| 206 |
+
Aleksandra Malysheva, Tegg Taekyong Sung, Chae-Bong Sohn, Daniel Kudenko, and Aleksei Shpilman. Deep multi-agent reinforcement learning with relevance graphs, 2018.
|
| 207 |
+
|
| 208 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin A Riedmiller, Andreas Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
|
| 209 |
+
|
| 210 |
+
Tabish Rashid, Mikayel Samvelyan, Christian Schroeder de Witt, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. QMIX: Monotonic value function factorisation for deep multi-agent reinforcement learning. In ICML, pp. 4292–4301, 2018.
|
| 211 |
+
|
| 212 |
+
M Rezaee and M Yaghmaee. Cluster based routing protocol for mobile ad hoc networks. INFOCOMP, 8(1):30–36, 2009.
|
| 213 |
+
|
| 214 |
+
Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philiph H. S. Torr, Jakob Foerster, and Shimon Whiteson. The StarCraft Multi-Agent Challenge. CoRR, abs/1902.04043, 2019.
|
| 215 |
+
|
| 216 |
+
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, 2008.
|
| 217 |
+
|
| 218 |
+
Elham Semsar-Kazerooni and Khashayar Khorasani. Multi-agent team cooperation: A game theory approach. Automatica, 45(10):2205–2213, 2009.
|
| 219 |
+
|
| 220 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, January 2016.
|
| 221 |
+
|
| 222 |
+
Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In ICLR, 2019.
|
| 223 |
+
|
| 224 |
+
Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In NeurIPS, pp. 2244–2252, 2016.
|
| 225 |
+
|
| 226 |
+
Andrea Tacchetti, H. Francis Song, Pedro A. M. Mediano, Vinicius Zambaldi, Janos Kram ´ ar, Neil C. ´ Rabinowitz, Thore Graepel, Matthew Botvinick, and Peter W. Battaglia. Relational forward models for multi-agent learning. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ rJlEojAqFm.
|
| 227 |
+
|
| 228 |
+
Ardi Tampuu, Tambet Matiisen, Dorian Kodelja, Ilya Kuzovkin, Kristjan Korjus, Juhan Aru, Jaan Aru, and Raul Vicente. Multiagent cooperation and competition with deep reinforcement learning. PLOS ONE, 12(4):1–15, 2017.
|
| 229 |
+
|
| 230 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, pp. 7794–7803, 2018.
|
| 231 |
+
|
| 232 |
+
Yaodong Yang, Rui Luo, Minne Li, Ming Zhou, Weinan Zhang, and Jun Wang. Mean field multiagent reinforcement learning. In ICML, pp. 5571–5580, 2018.
|
| 233 |
+
|
| 234 |
+
Lianmin Zheng, Jiacheng Yang, Han Cai, Ming Zhou, Weinan Zhang, and Yong Yu. MAgent: A many-agent reinforcement learning platform for artificial collective intelligence. In AAAI, pp. 8222–8223, 2017.
|
| 235 |
+
|
| 236 |
+
# A APPENDIX
|
| 237 |
+
|
| 238 |
+
# A.1 CBRP ALGORITHM AND HCOMM ALGORITHM
|
| 239 |
+
|
| 240 |
+
<table><tr><td colspan="2">Algorithm 2 CBRP: Cluster Based Routing Protocol</td></tr><tr><td>1: function CBRP(Vt,Vt),{wt,.,w}, 2: is the undecided nodes set and ε = ;</td><td>{POSst,..,POSst},d) Define neighbours are distance < d,Te is a constant to control the max-waiting time,Vu = </td></tr><tr><td>3: 4: 5:</td><td>Each node i broadcast its weight wt to neighbours; for i is in central node set Vt do Maintain the structure</td></tr><tr><td></td><td>if there is a central nodes in neighbours and its weight is bigger than agent i then</td></tr><tr><td>6: 7:</td><td>Pop node i from Vt and append it to Vt ;</td></tr><tr><td>8:</td><td>for i is in normal nodes set Vt and no central node is in its neighbour do</td></tr><tr><td>9:</td><td>Pop node i from Vt and append it to Vu; Elect central nodes</td></tr><tr><td>10:</td><td>fori is in Vu concurrently do</td></tr><tr><td>11:</td><td>if does not receive larger weight for Te then</td></tr><tr><td></td><td>append i to Vt and broadcast to neighbours;</td></tr><tr><td>12:</td><td></td></tr><tr><td>13:</td><td>else</td></tr><tr><td>14:</td><td>Wait for the signal from central node for 2Te;</td></tr><tr><td>15:</td><td>if received a signal from central node then</td></tr><tr><td></td><td>append i to Vt;</td></tr><tr><td>16:</td><td>else</td></tr><tr><td>17:</td><td>append i to Vt;</td></tr><tr><td>18:</td><td>for i in Vt do √ generate communication link</td></tr><tr><td>19:</td><td>for j in Vt and j is neighbouring i do</td></tr><tr><td>20:</td><td>append eij = O and eji = O to ε;</td></tr><tr><td>21:</td><td></td></tr><tr><td>22:</td><td>for j in Vt do</td></tr><tr><td></td><td>append eij = 0 toε;</td></tr><tr><td>23:</td><td>Return (Vt,Vt,ε)</td></tr></table>
|
| 241 |
+
|
| 242 |
+
# A.2 DETAILS AND DISCUSSIONS OF ALL HYPERPARAMETERS
|
| 243 |
+
|
| 244 |
+
For both MAgent and StarCraft2 environments, the details of all hyperparameters used for approaches are summarized in the following Table 5 and Table 6. All common hyperparameters of all approaches are set to be the same in the same environments. Except for the ”ATOC”, we change the message dimension to 64 in both enviroments. For the reason that if the dimension of messages is set to be 3 as other algorithms, the necessary GRU embedding in ATOC leads to failure while 64 seems to be robust.
|
| 245 |
+
|
| 246 |
+
For the neural network setting in MAgent enviroment, the node encoder part are all implemented with two convolutional layers with 32 filters and kernel size 3 and a MLP with 256 units. For the $Q$ Encoder part, they are implemented with MLP(128, 64, 13). The message generators for algorithms except for ATOC are implemented with $\mathrm { M L P } ( 6 4 , 3 2 , 3 )$ and the aggregation functions are segment sum. While for ATOC, the message generator is MLP(128, 64) and the aggregation functin isGRU(64). As for neural network setting in Starcraft2, we only tune the input and output layer to adapt to the new environment. All these settings can ensure repeatability.
|
| 247 |
+
|
| 248 |
+
# A.3 BATTLE SCENARIOS OF MAGENT AND STARCRAFT2
|
| 249 |
+
|
| 250 |
+
# A.4 DISCUSSIONS ON WEIGHT GENERATOR AND GROUP RADIUS
|
| 251 |
+
|
| 252 |
+
Although LSC utilize the reward feedback to establish the weight generator, which will be various with respect to different settings. To investigate the improvement brought by our learned importance weight generator, we also compare with a basic random weight generator (randomly chosen the central nodes and separate normal nodes into groups). As shown in Figure 9(a), our learned weight generator significantly outperforms randomly. Faster convergence of our learned weight generator
|
| 253 |
+
|
| 254 |
+
# Algorithm 3 HCOMM: Communication based Policy Module
|
| 255 |
+
|
| 256 |
+
1: function $\overline { { \mathrm { H C O M M } ( \mathcal { V } _ { n } , \mathcal { V } _ { c } , \mathcal { E } ) } }$
|
| 257 |
+
2: $\sharp$ Intra-group aggregation
|
| 258 |
+
3: for $v ^ { i }$ in $\nu _ { n }$ do
|
| 259 |
+
4: for $v ^ { j }$ in $\mathcal { V } _ { c }$ and $( i j )$ in $\mathcal { E }$ do
|
| 260 |
+
5: $e _ { i j } = \phi ^ { e n c } ( v ^ { i } )$ ; $\triangleright$ Generate normal to central messages
|
| 261 |
+
6: for $v _ { j }$ in $\mathcal { V } _ { c }$ do $\bar { e } _ { j } = \rho ( \{ e _ { i j } \} _ { ( i j ) \in \mathcal { E } } )$ ; . Central agents aggregate received messages
|
| 262 |
+
7: $v _ { j } ^ { c } = \phi ( \bar { e } _ { j } , v _ { j } ^ { n } ) ;$ . Generate cluster perception
|
| 263 |
+
8: $\sharp$ Inter-group sharing
|
| 264 |
+
9: for $v _ { j }$ in $\mathcal { V } _ { c }$ do
|
| 265 |
+
10: for $v _ { i }$ in $\mathcal { V } _ { c }$ and $( i j )$ ) in $\mathcal { E }$ do
|
| 266 |
+
11: $e _ { i j } = \phi ( v _ { i } ^ { c } , v _ { i } ^ { n } ) ;$ ; . Generate central to central messages
|
| 267 |
+
12: for $v _ { j }$ in $\mathcal { V } _ { c }$ do
|
| 268 |
+
14: 13: $\begin{array} { l } { \bar { e _ { j } } = \rho ( \{ e _ { i j } \} _ { ( i j ) \in \mathcal { E } } ) ; } \\ { v _ { j } ^ { g } = \phi ( \bar { e } _ { j } , v _ { j } ^ { n } ) ; } \end{array}$ . Aggregate received central to central messages $\triangleright$ Obtain global perception
|
| 269 |
+
15: $\sharp$ Intro-group sharing
|
| 270 |
+
16: for $v _ { i }$ in $\mathcal { V } _ { c }$ do
|
| 271 |
+
17: for $v _ { j }$ in $\nu _ { n }$ and $( i j )$ in $\mathcal { E }$ do
|
| 272 |
+
18: $\bar { e _ { i j } } = \phi ( v _ { i } ^ { g } , v _ { i } ^ { \dot { c } } , v _ { i } ^ { n } , e _ { j i } ) , \bar { e } _ { j } = \rho ( \{ e _ { i j } \} _ { ( i j ) \in \mathcal { E } } )$ ; $\triangleright$ Generate central to normal
|
| 273 |
+
messages
|
| 274 |
+
19: for $v _ { j }$ in $\smash { \mathcal { V } _ { n } \cup \mathcal { V } _ { c } }$ do
|
| 275 |
+
20: for $v _ { i }$ in $\mathcal { V } _ { c }$ and $( i j )$ in $\mathcal { E }$ do
|
| 276 |
+
21: $\bar { e } _ { j } = \rho ( \{ e _ { i j } \} _ { ( i j ) \in \mathcal { E } } ) ;$ ; . Aggregate received central to normal messages
|
| 277 |
+
22: vnj = φ(¯ej , vnj ); . Update states
|
| 278 |
+
23: q j = Q ( v nj );
|
| 279 |
+
return q.
|
| 280 |
+
|
| 281 |
+
Table 5: Hyperparamaters for Magent
|
| 282 |
+
|
| 283 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1>LSC</td><td rowspan=1 colspan=1>IDQN</td><td rowspan=1 colspan=1>MFQ</td><td rowspan=1 colspan=1>CommNet</td><td rowspan=1 colspan=1>IC3</td><td rowspan=1 colspan=1>ATOC</td></tr><tr><td rowspan=1 colspan=1>Episodes</td><td rowspan=1 colspan=1>1750</td><td rowspan=1 colspan=1>1750</td><td rowspan=1 colspan=1>1750</td><td rowspan=1 colspan=1>1750</td><td rowspan=1 colspan=1>1750</td><td rowspan=1 colspan=1>1750</td></tr><tr><td rowspan=1 colspan=1>Estart</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td></tr><tr><td rowspan=1 colspan=1>Eend</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.01</td></tr><tr><td rowspan=1 colspan=1>Learning rate</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td></tr><tr><td rowspan=1 colspan=1>Max env steps</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>400</td><td rowspan=1 colspan=1>400</td></tr><tr><td rowspan=1 colspan=1>dimension of messages</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=1>radius of communication</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>6</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 6: Hyperparamaters for Starcraft2
|
| 286 |
+
|
| 287 |
+
<table><tr><td rowspan=1 colspan=1>Parameter</td><td rowspan=1 colspan=1>LSC</td><td rowspan=1 colspan=1>IDQN</td><td rowspan=1 colspan=1>MFQ</td><td rowspan=1 colspan=1>CommNet</td><td rowspan=1 colspan=1>IC3</td><td rowspan=1 colspan=1>ATOC</td></tr><tr><td rowspan=1 colspan=1>Total steps</td><td rowspan=1 colspan=1>600k</td><td rowspan=1 colspan=1>600k</td><td rowspan=1 colspan=1>600k</td><td rowspan=1 colspan=1>600k</td><td rowspan=1 colspan=1>600k</td><td rowspan=1 colspan=1>600k</td></tr><tr><td rowspan=1 colspan=1>Estart</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>1.0</td></tr><tr><td rowspan=1 colspan=1>Eend</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.05</td></tr><tr><td rowspan=1 colspan=1>Learning rate</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>1e-4</td></tr><tr><td rowspan=1 colspan=1>Max env steps</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>10000</td></tr><tr><td rowspan=1 colspan=1>dimension of messages</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>64</td></tr><tr><td rowspan=1 colspan=1>radius of communication</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>~</td><td rowspan=1 colspan=1>6</td></tr></table>
|
| 288 |
+
|
| 289 |
+
shows the efficiency brought by involving the reward guided weight generator. The hierarchical structured communication network guaranteed through the learned weight generator improves the communication efficiency. The higher average reward obtained by our learned weight generator also shows the necessity of selecting central nodes based on the learned weight generator rather than randomly chosen.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 8: Battle scenarios of MAgent and StarCraft2.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 9: Discussions on weight generator and group radius.
|
| 296 |
+
|
| 297 |
+
To better investigate the hierarchical structure, we compare our LSC algorithm with respect to different group radius $d$ , i.e., 3, 6, 12 and 60. As shown in Figure 9(b), LSC with radius 6 outperform other settings. When the radius increasing, the agents can establish inter-groups cooperation easier. However, LSC with radius 60 performs worse than all the other three cases. LSC with extremely large radius will downgrade to CommNet which is not an effective way to extract valuable information.
|
md/train/Byj72udxe/Byj72udxe.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# POINTER SENTINEL MIXTURE MODELS
|
| 2 |
+
|
| 3 |
+
Stephen Merity, Caiming Xiong, James Bradbury & Richard Socher
|
| 4 |
+
MetaMind - A Salesforce Company
|
| 5 |
+
Palo Alto, CA, USA
|
| 6 |
+
{smerity,cxiong,james.bradbury,rsocher}@salesforce.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recent neural network sequence models with softmax classifiers have achieved their best language modeling performance only with very large hidden states and large vocabularies. Even then they struggle to predict rare or unseen words even if the context makes the prediction unambiguous. We introduce the pointer sentinel mixture architecture for neural sequence models which has the ability to either reproduce a word from the recent context or produce a word from a standard softmax classifier. We explore applying the pointer sentinel mixture model to the LSTM, a standard recurrent neural network building block. Utilizing an LSTM that achieves 80.6 perplexity on the Penn Treebank, the pointer sentinel-LSTM model pushes perplexity down to 70.9 while using far fewer parameters than an LSTM that achieves similar results. In order to evaluate how well language models can exploit longer contexts and deal with more realistic vocabularies and corpora we also introduce the freely available WikiText corpus.1
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
A major difficulty in language modeling is learning when to predict specific words from the immediate context. For instance, imagine a new person is introduced and two paragraphs later the context would allow one to very accurately predict this person’s name as the next word. For standard neural sequence models to predict this name, they would have to encode the name, store it for many time steps in their hidden state, and then decode it when appropriate. As the hidden state is limited in capacity and the optimization of such models suffer from the vanishing gradient problem, this is a lossy operation when performed over many timesteps. This is especially true for rare words.
|
| 15 |
+
|
| 16 |
+
Models with soft attention or memory components have been proposed to help deal with this challenge, aiming to allow for the retrieval and use of relevant previous hidden states, in effect increasing hidden state capacity and providing a path for gradients not tied to timesteps. Even with attention, the standard softmax classifier that is being used in these models often struggles to correctly predict rare or previously unknown words.
|
| 17 |
+
|
| 18 |
+
Pointer networks (Vinyals et al., 2015) provide one potential solution for rare and out of vocabulary (OoV) words as a pointer network uses attention to select an element from the input as output. This allows it to produce previously unseen input tokens. While pointer networks improve performance on rare words and long-term dependencies they are unable to select words that do not exist in the input.
|
| 19 |
+
|
| 20 |
+
We introduce a mixture model, illustrated in Fig. 1, that combines the advantages of standard softmax classifiers with those of a pointer component for effective and efficient language modeling. Rather than relying on the RNN hidden state to decide when to use the pointer, as in the recent work of Gulc¸ehre et al. ¨ (2016), we allow the pointer component itself to decide when to use the softmax vocabulary through a sentinel. The model improves the state of the art perplexity on the Penn Treebank. Since this commonly used dataset is small and no other freely available alternative exists that allows for learning long range dependencies, we also introduce a new benchmark dataset for language modeling called WikiText.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Illustration of the pointer sentinel-RNN mixture model. $g$ is the mixture gate which uses the sentinel to dictate how much probability mass to give to the vocabulary.
|
| 24 |
+
|
| 25 |
+
# 2 THE POINTER SENTINEL FOR LANGUAGE MODELING
|
| 26 |
+
|
| 27 |
+
Given a sequence of words $w _ { 1 } , \ldots , w _ { N - 1 }$ , our task is to predict the next word $w _ { N }$
|
| 28 |
+
|
| 29 |
+
# 2.1 THE SOFTMAX-RNN COMPONENT
|
| 30 |
+
|
| 31 |
+
Recurrent neural networks (RNNs) have seen widespread use for language modeling (Mikolov et al., 2010) due to their ability to, at least in theory, retain long term dependencies. RNNs employ the chain rule to factorize the joint probabilities over a sequence of tokens: $p ( w _ { 1 } , \dots , w _ { N } ) =$ $\begin{array} { r } { \prod _ { i = 1 } ^ { N } p ( w _ { i } | w _ { 1 } , \dots , w _ { i - 1 } ) } \end{array}$ . More precisely, at each time step $i$ , we compute the RNN hidden state $h _ { i }$ according to the previous hidden state $h _ { i - 1 }$ and the input $x _ { i }$ such that $h _ { i } = R N N ( x _ { i } , h _ { i - 1 } )$ . When all the $N - 1$ words have been processed by the RNN, the final state $h _ { { N - 1 } }$ is fed into a softmax layer which computes the probability over a vocabulary of possible words: $p _ { \mathrm { v o c a b } } ( w ) =$ softmax $\left( U h _ { N - 1 } \right)$ , where $\mathbf { \Psi } _ { p _ { \mathrm { v o c a b } } } \in \dot { \mathbb { R } } ^ { V }$ , $U \in \mathbf { \overline { { R } } } ^ { V \times H }$ , $H$ is the hidden size, and $V$ the vocabulary size. RNNs can suffer from the vanishing gradient problem. The LSTM (Hochreiter & Schmidhuber, 1997) architecture has been proposed to deal with this by updating the hidden state according to a set of gates. Our work focuses on the LSTM but can be applied to any RNN architecture that ends in a vocabulary softmax.
|
| 32 |
+
|
| 33 |
+
# 2.2 THE POINTER NETWORK COMPONENT
|
| 34 |
+
|
| 35 |
+
In this section, we propose a modification to pointer networks for language modeling. To predict the next word in the sequence, a pointer network would select the member of the input sequence $p ( w _ { 1 } , \dots , w _ { N - 1 } )$ with the maximal attention score as the output.
|
| 36 |
+
|
| 37 |
+
The simplest way to compute an attention score for a specific hidden state is an inner product with all the past hidden states $h$ , with each hidden state $\boldsymbol { h } _ { i } ^ { \star } \in \mathbb { R } ^ { H }$ . However, if we want to compute such a score for the most recent word (since this word may be repeated), we need to include the last hidden state itself in this inner product. Taking the inner product of a vector with itself results in the vector’s magnitude squared, meaning the attention scores would be strongly biased towards the most recent word. Hence we project the current hidden state to a query vector $q$ first. To produce the query $q$ we compute $q = \mathrm { t a n h } ( W h _ { N - 1 } + b )$ , where $W \in \dot { \mathbb { R } ^ { H \times } } \mathbf { \check { \mathit { H } } }$ , $b \in \mathring { \mathbb { R } } ^ { H }$ , and $\boldsymbol { q } ^ { \mathbf { \lambda } } \in \mathbb { R } ^ { H }$ . To generate the pointer attention scores, we compute the match between the previous RNN output states $h _ { i }$ and the query $q$ by taking the inner product, followed by a softmax activation function to obtain a probability distribution:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { z _ { i } = q ^ { T } h _ { i } , } \\ { a = \mathrm { s o f t m a x } ( z ) , } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $z \in \mathbb { R } ^ { L }$ , $a \in \mathbb { R } ^ { L }$ , and $L$ is the total number of hidden states. The probability mass assigned to a given word is the sum of the probability mass given to all token positions where the given word appears:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
p _ { \mathrm { p t r } } ( w ) = \sum _ { i \in I ( w , x ) } a _ { i } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 2: Visualization of the pointer sentinel-RNN mixture model. The query, produced from applying an MLP to the last output of the RNN, is used by the pointer network to identify likely matching words from the past. The $\odot$ nodes are inner products between the query and the RNN hidden states. If the pointer component is not confident, probability mass can be directed to the RNN by increasing the value of the mixture gate $g$ via the sentinel, seen in grey. If $g = 1$ then only the RNN is used. If $g = 0$ then only the pointer is used.
|
| 51 |
+
|
| 52 |
+
where $I ( w , x )$ results in all positions of the word $w$ in the input $x$ and $p _ { \mathrm { p t r } } \in \mathbb { R } ^ { V }$ . This technique, referred to as pointer sum attention, has been used for question answering (Kadlec et al., 2016).
|
| 53 |
+
|
| 54 |
+
Given the length of the documents used in language modeling, it may not be feasible for the pointer network to evaluate an attention score for all the words back to the beginning of the dataset. Instead, we may elect to maintain only a window of the $L$ most recent words for the pointer to match against. The length $L$ of the window is a hyperparameter that can be tuned on a held out dataset or by empirically analyzing how frequently a word at position $t$ appears within the last $L$ words.
|
| 55 |
+
|
| 56 |
+
To illustrate the advantages of this approach, consider a long article featuring two sentences President Obama discussed the economy and President Obama then flew to Prague. If the query was Which President is the article about?, probability mass could be applied to Obama in either sentence. If the question was instead Who flew to Prague?, only the latter occurrence of Obama provides the proper context. The attention sum model ensures that, as long as the entire attention probability mass is distributed on the occurrences of Obama, the pointer network can achieve zero loss. This flexibility provides supervision without forcing the model to put mass on supervision signals that may be incorrect or lack proper context.
|
| 57 |
+
|
| 58 |
+
# 2.3 THE POINTER SENTINEL MIXTURE MODEL
|
| 59 |
+
|
| 60 |
+
While pointer networks have proven to be effective, they cannot predict output words that are not present in the input, a common scenario in language modeling. We propose to resolve this by using a mixture model that combines a standard softmax with a pointer.
|
| 61 |
+
|
| 62 |
+
Our mixture model has two base distributions: the softmax vocabulary of the RNN output and the positional vocabulary of the pointer model. We refer to these as the RNN component and the pointer component respectively. To combine the two base distributions, we use a gating function $\bar { g } \ : = \ : p ( z _ { i } \ : = \ : k | x _ { i } )$ where $z _ { i }$ is the latent variable stating which base distribution the data point belongs to. As we only have two base distributions, $g$ can produce a scalar in the range $[ 0 , 1 ]$ . A value of 0 implies that only the pointer is used and 1 means only the softmax-RNN is used.
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
p ( y _ { i } | x _ { i } ) = g p _ { \mathrm { v o c a b } } ( y _ { i } | x _ { i } ) + ( 1 - g ) p _ { \mathrm { p t r } } ( y _ { i } | x _ { i } ) .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
While the models could be entirely separate, we re-use many of the parameters for the softmaxRNN and pointer components. This sharing minimizes the total number of parameters in the model and capitalizes on the pointer network’s supervision for the RNN component.
|
| 69 |
+
|
| 70 |
+
# 2.4 DETAILS OF THE GATING FUNCTION
|
| 71 |
+
|
| 72 |
+
To compute the new pointer sentinel gate $g$ , we modify the pointer component. In particular, we add an additional element to $z$ , the vector of attention scores as defined in Eq. 1. This element is computed using an inner product between the query and the sentinel2 vector $s \in \mathbb { R } ^ { H }$ . This change can be summarized by changing Eq. 2 to $a = \operatorname { \bar { s o f t m a x } } \left( \left[ z ; q ^ { T } s \right] \right)$ . We define $a \in \mathbb { R } ^ { V + 1 }$ to be the attention distribution over both the words in the pointer window as well as the sentinel state. We interpret the last element of this vector to be the gate value: $g = a [ V + 1 ]$ .
|
| 73 |
+
|
| 74 |
+
Any probability mass assigned to $g$ is given to the standard softmax vocabulary of the RNN. The final updated, normalized pointer probability over the vocabulary in the window then becomes:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
p _ { \mathrm { p t r } } ( y _ { i } | x _ { i } ) = \frac { 1 } { 1 - g } a [ 1 : V ] ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where we denoted $[ 1 : V ]$ to mean the first $V$ elements of the vector. The final mixture model is the same as Eq. 4 but with the updated Eq. 5 for the pointer probability.
|
| 81 |
+
|
| 82 |
+
This setup encourages the model to have both components compete: use pointers whenever possible and back-off to the standard softmax otherwise. By integrating the gating function into the pointer computation, it is influenced by both the RNN hidden state and the pointer window’s hidden states.
|
| 83 |
+
|
| 84 |
+
# 2.5 MOTIVATION FOR THE SENTINEL AS GATING FUNCTION
|
| 85 |
+
|
| 86 |
+
To make the best decision possible regarding which component to use the gating function must have as much context as possible. As we increase the window of words for the pointer component to consider, the RNN hidden state by itself isn’t guaranteed to accurately recall the identity or order of words it has recently seen (Adi et al., 2016). This is an obvious limitation of encoding a variable length sequence into a fixed dimensionality vector.
|
| 87 |
+
|
| 88 |
+
If we want a pointer window where the length $L$ is in the hundreds, accurately modeling all of this information within the RNN hidden state is impractical. The position of specific words is also a vital feature as relevant words eventually fall out of the pointer component’s window. To correctly model this would require the RNN hidden state to store both the identity and position of each word in the pointer window. This is far beyond the capability of the fixed dimensionality RNN hidden state.
|
| 89 |
+
|
| 90 |
+
For this reason, we integrate the gating function directly into the pointer network by use of the sentinel. The decision to back-off to the softmax vocabulary is then informed by both the query $q$ , generated using the RNN hidden state $h _ { N - 1 }$ , and from the contents of the hidden states in the pointer window itself. This allows the model to accurately query what hidden states are contained in the pointer window and avoid maintaining state for words that may have fallen out of the window.
|
| 91 |
+
|
| 92 |
+
# 2.6 POINTER SENTINEL LOSS FUNCTION
|
| 93 |
+
|
| 94 |
+
We minimize the cross-entropy loss of $\begin{array} { r } { - \sum _ { j } \hat { y _ { i j } } \log p \big ( y _ { i j } | x _ { i } \big ) } \end{array}$ , where $\hat { y } _ { i }$ is a one hot encoding of the correct output. During training, as $\hat { y } _ { i }$ is one hot, only a single mixed probability $p ( y _ { i j } )$ must be computed for calculating the loss. This can result in a far more efficient GPU implementation. At prediction time, when we want all values for $p ( y _ { i } | x _ { i } )$ , a maximum of $L$ word probabilities must be mixed, as there is a maximum of $L$ unique words in the pointer window of length $L$ . This mixing can occur on the CPU where random access indexing is more efficient than the GPU.
|
| 95 |
+
|
| 96 |
+
Following the pointer sum attention network, the aim is to place probability mass from the attention mechanism on the correct output $\hat { y } _ { i }$ if it exists in the input. In the case of our mixture model the pointer loss instead becomes $\begin{array} { r } { - \log \left( g + \sum _ { i \in I ( y , x ) } a _ { i } \right) } \end{array}$ , where $I ( y , x )$ results in all positions of the correct output $y$ in the input $x$ . The gate $g$ may be assigned all probability mass if, for instance, the correct output $\hat { y } _ { i }$ exists only in the softmax-RNN vocabulary. There is no penalty if the model places the entire probability mass on any of the instances of the correct word in the input window. If the pointer component places the entirety of the probability mass on the gate $g$ , the pointer network incurs no penalty and the loss is entirely determined by the loss of the softmax-RNN component.
|
| 97 |
+
|
| 98 |
+
Table 1: Statistics of the Penn Treebank, WikiText-2, and WikiText-103. The out of vocabulary $\left( \mathrm { O o V } \right)$ rate notes what percentage of tokens have been replaced by an $\left. u n k \right.$ token. The token count includes newlines which add to the structure of the WikiText datasets.
|
| 99 |
+
|
| 100 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Penn Treebank Test</td><td colspan="3">WikiText-2 Test</td><td colspan="3">WikiText-103</td></tr><tr><td colspan="3">Train Valid</td><td colspan="3">Train Valid</td><td colspan="3">Train Valid</td></tr><tr><td>Articles</td><td>-</td><td>-</td><td>-</td><td>600</td><td>60</td><td>60</td><td>28,475</td><td>60</td><td>Test 60</td></tr><tr><td>Tokens</td><td>929k</td><td>73k 10,000</td><td>82k</td><td>2,088k</td><td>217k</td><td>245k</td><td>103,227k</td><td>217k</td><td>245k</td></tr><tr><td>Vocab size OoV rate</td><td colspan="3">4.8%</td><td></td><td colspan="3">33,278 2.6%</td><td colspan="3">267,735 0.4%</td></tr></table>
|
| 101 |
+
|
| 102 |
+
# 2.7 PARAMETERS AND COMPUTATION TIME
|
| 103 |
+
|
| 104 |
+
The pointer sentinel-LSTM mixture model results in a relatively minor increase in parameters and computation time, especially when compared to the model size required to achieve similar performance using a standard LSTM. The only two additional parameters required by the model are those required for computing $q$ , specifically $\dot { W } \in \mathbb { R } ^ { H \times H }$ and $\bar { b } \in \mathbb { R } ^ { H }$ , and the sentinel vector embedding, $s \in \mathbb { R } ^ { H }$ . This is independent of the depth of the RNN as the pointer component only interacts with the output of the final RNN layer. The additional $H ^ { 2 } + 2 H \bar { }$ parameters are minor compared to a single LSTM layer’s $8 H ^ { 2 } + 4 \dot { H }$ parameters. Most models also use multiple LSTM layers.
|
| 105 |
+
|
| 106 |
+
In terms of additional computation, a pointer sentinel-LSTM of window size $L$ only requires computing the query $q$ (a linear layer with tanh activation), a total of $L$ parallelizable inner product calculations, and the attention scores for the $L$ resulting scalars via the softmax function.
|
| 107 |
+
|
| 108 |
+
# 3 RELATED WORK
|
| 109 |
+
|
| 110 |
+
Considerable research has been dedicated to the task of language modeling, from traditional machine learning techniques such as n-grams to deep neural sequence models.
|
| 111 |
+
|
| 112 |
+
Mixture models composed of various knowledge sources have been proposed in the past for language modeling. Rosenfeld (1996) uses a maximum entropy model to combine a variety of information sources to improve language modeling on news text and speech. These information sources include complex overlapping n-gram distributions and n-gram caches that aim to capture rare words.
|
| 113 |
+
|
| 114 |
+
Beyond n-grams, neural sequence models such as recurrent neural networks have been shown to achieve state of the art results (Mikolov et al., 2010). A variety of RNN regularization methods have been explored, including a number of dropout variations (Zaremba et al., 2014; Gal, 2015) which prevent overfitting of complex LSTM language models. Other work has modified the RNN architecture to better handle increased recurrence depth (Zilly et al., 2016).
|
| 115 |
+
|
| 116 |
+
In order to increase capacity and minimize the impact of vanishing gradients, some language and translation models have also added a soft attention or memory component (Bahdanau et al., 2015; Sukhbaatar et al., 2015; Cheng et al., 2016; Kumar et al., 2016; Xiong et al., 2016; Ahn et al., 2016). These mechanisms allow for the retrieval and use of relevant previous hidden states. Soft attention mechanisms need to first encode the relevant word into a state vector and then decode it again, even if the output word is identical to the input word used to compute that hidden state or memory. A drawback to soft attention is that if, for instance, January and March are both equally attended candidates, the attention mechanism may blend the two vectors, resulting in a context vector closest to February (Kadlec et al., 2016). Even with attention, the standard softmax classifier being used in these models often struggles to correctly predict rare or previously unknown words.
|
| 117 |
+
|
| 118 |
+
Attention-based pointer mechanisms were introduced in Vinyals et al. (2015) where the pointer network is able to select elements from the input as output. In the above example, only January or March would be available as options, as February does not appear in the input. The use of pointer networks have been shown to help with geometric problems (Vinyals et al., 2015), code generation (Ling et al., 2016), summarization (Gu et al., 2016; Gulc¸ehre et al. ¨ , 2016), question answering (Kadlec et al., 2016). While pointer networks improve performance on rare words and long-term dependencies they are unable to select words that do not exist in the input.
|
| 119 |
+
|
| 120 |
+
Gulc¸ehre et al. ¨ (2016) introduce a pointer softmax model that can generate output from either the vocabulary softmax of an RNN or the location softmax of the pointer network. Not only does this allow for producing OoV words which are not in the input, the pointer softmax model is able to better deal with rare and unknown words than a model only featuring an RNN softmax. Rather than constructing a mixture model as in our work, they use a switching network to decide which component to use. For neural machine translation, the switching network is conditioned on the representation of the context of the source text and the hidden state of the decoder. The pointer network is not used as a source of information for the switching network as in our model. The pointer and RNN softmax are scaled according to the switching network and the word or location with the highest final attention score is selected for output. Although this approach uses both a pointer and RNN component, it is not a mixture model and does not combine the probabilities for a word if it occurs in both the pointer location softmax and the RNN vocabulary softmax. In our model the word probability is a mix of both the RNN and pointer components, allowing for better predictions when the context may be ambiguous.
|
| 121 |
+
|
| 122 |
+
Extending this concept further, the latent predictor network (Ling et al., 2016) generates an output sequence conditioned on an arbitrary number of base models where each base model may have differing granularity. In their task of code generation, the output could be produced one character at a time using a standard softmax or instead copy entire words from referenced text fields using a pointer network. As opposed to Gulc¸ehre et al. ¨ (2016), all states which produce the same output are merged by summing their probabilities. The model requires a complex training process involving the forward-backward algorithm for Semi-Markov models to prevent an exponential path explosion.
|
| 123 |
+
|
| 124 |
+
# 4 WIKITEXT - A BENCHMARK FOR LANGUAGE MODELING
|
| 125 |
+
|
| 126 |
+
We first describe the most commonly used language modeling dataset and its pre-processing in order to then motivate the need for a new benchmark dataset.
|
| 127 |
+
|
| 128 |
+
# 4.1 PENN TREEBANK
|
| 129 |
+
|
| 130 |
+
In order to compare our model to the many recent neural language models, we conduct word-level prediction experiments on the Penn Treebank (PTB) dataset (Marcus et al., 1993), pre-processed by Mikolov et al. (2010). The dataset consists of $9 2 9 \mathrm { k }$ training, $7 3 \mathrm { k }$ validation, and ${ } ^ { 8 2 \mathrm { k } }$ test words. As part of the pre-processing performed by Mikolov et al. (2010), words were lower-cased, numbers were replaced with N, newlines were replaced with $\langle e o s \rangle$ , and all other punctuation was removed. The vocabulary is the most frequent 10k words with OoV tokens replaced by an $\left. u n k \right.$ token. For full statistics, refer to Table 1.
|
| 131 |
+
|
| 132 |
+
# 4.2 REASONS FOR A NEW DATASET
|
| 133 |
+
|
| 134 |
+
While the processed version of the PTB above has been frequently used for language modeling, it has many limitations. The tokens in PTB are all lower case, stripped of any punctuation, and limited to a vocabulary of only 10k words. These limitations mean that the PTB is unrealistic for real language use, especially when far larger vocabularies with many rare words are involved. The appendix contains a graph illustrating this using a Zipfian plot over the training partition of the PTB, with the curve stopping abruptly at the 10k limit. Given that accurately predicting rare words, such as named entities, is an important task for many applications, the lack of a long tail is problematic.
|
| 135 |
+
|
| 136 |
+
Other larger scale language modeling datasets exist. Unfortunately, they either have restrictive licensing which prevents widespread use or have randomized sentence ordering (Chelba et al., 2013) which is unrealistic for most language use and prevents the effective learning and evaluation of longer term dependencies. Hence, we constructed a language modeling dataset using text extracted from Wikipedia and have made this available to the community.
|
| 137 |
+
|
| 138 |
+
# 4.3 CONSTRUCTION AND PRE-PROCESSING
|
| 139 |
+
|
| 140 |
+
We selected articles only fitting the Good or Featured article criteria specified by editors on Wikipedia. These articles have been reviewed by humans and are considered well written, factually accurate, broad in coverage, neutral in point of view, and stable. This resulted in 23,805 Good articles and 4,790 Featured articles. The text for each article was extracted using the Wikipedia API. Extracting text from Wikipedia mark-up is nontrivial due to the large number of macros in use, used for metric conversions, abbreviations, language notation, and date handling.
|
| 141 |
+
|
| 142 |
+
Once extracted, specific sections which primarily featured lists were removed by default. Other minor bugs, such as sort keys and Edit buttons that leaked in from the HTML, were also removed. Mathematical formulae and $\mathrm { { I A T } _ { E } X }$ code were replaced with $\langle f o r m u l a \rangle$ tokens. Normalization and tokenization were performed using the Moses tokenizer (Koehn et al., 2007), slightly augmented to further split numbers $( 8 , 6 0 0 8 \ \textcircled { \omega } , @ \ 6 0 0 )$ and with some additional minor fixes. Following Chelba et al. (2013) a vocabulary was constructed by discarding all words with a count below 3. Words outside of the vocabulary were mapped to the $\left. u n k \right.$ token, also a part of the vocabulary.
|
| 143 |
+
|
| 144 |
+
# 4.4 STATISTICS
|
| 145 |
+
|
| 146 |
+
The full WikiText dataset is over 103 million words in size, a hundred times larger than the PTB. It is also a tenth the size of the One Billion Word Benchmark (Chelba et al., 2013), one of the largest publicly available language modeling benchmarks, whilst consisting of articles that allow for the capture and usage of longer term dependencies as might be found in many real world tasks.
|
| 147 |
+
|
| 148 |
+
The dataset is available in two different sizes: WikiText-2 and WikiText-103. Both feature punctuation, original casing, a larger vocabulary, and numbers. WikiText-2 is two times the size of the Penn Treebank dataset. WikiText-103 features all extracted articles. Both datasets use the same articles for validation and testing, only differing in the vocabularies. For full statistics, refer to Table 1.
|
| 149 |
+
|
| 150 |
+
# 5 EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
# 5.1 TRAINING DETAILS
|
| 153 |
+
|
| 154 |
+
As the pointer sentinel mixture model uses the outputs of the RNN from up to $L$ timesteps back, this presents a challenge for training. If we do not regenerate the stale historical outputs of the RNN when we update the gradients, backpropagation through these stale outputs may result in incorrect gradient updates. If we do regenerate all stale outputs of the RNN, the training process is far slower. As we can make no theoretical guarantees on the impact of stale outputs on gradient updates, we opt to regenerate the window of RNN outputs used by the pointer component after each gradient update.
|
| 155 |
+
|
| 156 |
+
We also use truncated backpropagation through time (BPTT) in a different manner to many other RNN language models. Truncated BPTT allows for practical time-efficient training of RNN models but has fundamental trade-offs that are rarely discussed. For running truncated BPTT, BPTT is run for $k _ { 2 }$ timesteps once every $k _ { 1 }$ timesteps. For many RNN language modeling training schemes, $k _ { 1 } = k _ { 2 }$ , meaning that every $k$ timesteps truncated BPTT is performed for the $k$ previous timesteps. This results in only a single RNN output receiving backpropagation for $k$ timesteps, with the other extreme being that the first token receives backpropagation for 0 timesteps. As such, most words in the training data will never experience a full backpropagation for $k$ timesteps.
|
| 157 |
+
|
| 158 |
+
In our task, the pointer component always looks $L$ timesteps into the past if $L$ past timesteps are available. We select $k _ { 1 } = 1$ and $k _ { 2 } = L$ such that for each timestep we perform backpropagation for $L$ timesteps and advance one timestep at a time. Only the loss for the final predicted word is used for backpropagation through the window.
|
| 159 |
+
|
| 160 |
+
# 5.2 MODEL DETAILS
|
| 161 |
+
|
| 162 |
+
Our experimental setup reflects that of Zaremba et al. (2014) and Gal (2015). We increased the number of timesteps used during training from 35 to 100, matching the length of the window $L$ . Batch size was increased to 32 from 20. We also halve the learning rate when validation perplexity is worse than the previous iteration, stopping training when validation perplexity fails to improve for three epochs or when 64 epochs are reached. The gradients are rescaled if their global norm exceeds 1 (Pascanu et al., 2013b).3 We evaluate the medium model configuration which features a two layer
|
| 163 |
+
|
| 164 |
+
Table 2: Single model perplexity on validation and test sets for the Penn Treebank language modeling task. For our models and the models of Zaremba et al. (2014) and Gal (2015), medium and large refer to a 650 and 1500 unit two layer LSTM respectively. Parameter numbers with $^ \ddag$ are estimates based upon our understanding of the model and with reference to Kim et al. (2016).
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Mikolov & Zweig (2012) - KN-5</td><td>2M</td><td></td><td>141.2</td></tr><tr><td>Mikolov & Zweig (2012) - KN5 + cache</td><td>2M</td><td></td><td>125.7</td></tr><tr><td>Mikolov&Zweig g(2012) -RNN</td><td>6M</td><td></td><td>124.7</td></tr><tr><td>Mikolov&Zweig g(2012)-RNN-LDA</td><td>7M</td><td></td><td>113.7</td></tr><tr><td>Mikolov & Zweig ( g(2012) - RNN-LDA + KN-5 +cache</td><td>9M</td><td></td><td>92.0</td></tr><tr><td>Pascanu et al. (2013a) - Deep RNN</td><td>6M</td><td></td><td>107.5</td></tr><tr><td>Cheng et al. (2014) - Sum-Prod Net</td><td>5Mt</td><td>一</td><td>100.0</td></tr><tr><td>Zaremba et al. (2014) - LSTM (medium) Zaremba et al. (2014) - LSTM (large)</td><td>20M</td><td>86.2</td><td>82.7</td></tr><tr><td>Gal (2015) - Variational LSTM (medium, untied)</td><td>66M</td><td>82.2</td><td>78.4</td></tr><tr><td>Gal (2015) - Variational LSTM (medium,untied, MC)</td><td>20M 20M</td><td>81.9 ± 0.2</td><td>79.7 ± 0.1</td></tr><tr><td>Gal (2015) - Variational LSTM (large,untied)</td><td>66M</td><td>一</td><td>78.6 ±0.1</td></tr><tr><td>Gal (2015) - Variational LSTM (large,untied, MC)</td><td></td><td>77.9 ± 0.3</td><td>75.2 ± 0.2</td></tr><tr><td>Kim etal. (2016) - CharCNN</td><td>66M 19M</td><td>1</td><td>73.4± 0.0</td></tr><tr><td>Zilly et al. (2016) - Variational RHN</td><td>32M</td><td>一</td><td>78.9</td></tr><tr><td></td><td></td><td>72.8</td><td>71.3</td></tr><tr><td>Zoneout + Variational LSTM (medium)</td><td>20M</td><td>84.4</td><td>80.6</td></tr><tr><td>Pointer Sentinel-LSTM (medium)</td><td>21M</td><td>72.4</td><td>70.9</td></tr></table>
|
| 167 |
+
|
| 168 |
+
LSTM of hidden size 650. We compare against the large model configuration which features a two layer LSTM of hidden size 1500.
|
| 169 |
+
|
| 170 |
+
We produce results for two model types, an LSTM model that uses dropout regularization and the pointer sentinel-LSTM model. The variants of dropout used were zoneout (Krueger et al., 2016) and variational inference based dropout (Gal, 2015). Zoneout, which stochastically forces some recurrent units to maintain their previous values, was used for the recurrent connections within the LSTM. Variational inference based dropout, where the dropout mask for a layer is locked across timesteps, was used on the input to each RNN layer and also on the output of the final RNN layer. We used a value of 0.5 for both dropout connections.
|
| 171 |
+
|
| 172 |
+
# 5.3 COMPARISON OVER PENN TREEBANK
|
| 173 |
+
|
| 174 |
+
Table 2 compares the pointer sentinel-LSTM to a variety of other models on the Penn Treebank dataset. The pointer sentinel-LSTM achieves the lowest perplexity, followed by the recent Recurrent Highway Networks (Zilly et al., 2016). The medium pointer sentinel-LSTM model also achieves lower perplexity than the large LSTM models. Note that the best performing large variational LSTM model uses computationally intensive Monte Carlo (MC) dropout averaging. Monte Carlo dropout averaging is a general improvement for any sequence model that uses dropout but comes at a greatly increased test time cost. In Gal (2015) it requires rerunning the test model with 1000 different dropout masks. The pointer sentinel-LSTM is able to achieve these results with far fewer parameters than other models with comparable performance, specifically with less than a third the parameters used in the large variational LSTM models.
|
| 175 |
+
|
| 176 |
+
We also test a variational LSTM that uses zoneout, which serves as the RNN component of our pointer sentinel-LSTM mixture. This variational LSTM model performs BPTT for the same length $L$ as the pointer sentinel-LSTM, where $L = 1 0 0$ timesteps. The results for this model ablation are worse than that of Gal (2015)’s variational LSTM without Monte Carlo dropout averaging.
|
| 177 |
+
|
| 178 |
+
# 5.4 COMPARISON OVER WIKITEXT-2
|
| 179 |
+
|
| 180 |
+
As WikiText-2 is being introduced in this dataset, there are no existing baselines. We provide two baselines to compare the pointer sentinel-LSTM against: our variational LSTM using zoneout and
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Variational LSTM implementation from Gal (2015)</td><td>20M</td><td>101.7</td><td>96.3</td></tr><tr><td>Zoneout + Variational LSTM</td><td>20M</td><td>108.7</td><td>100.9</td></tr><tr><td>Pointer Sentinel-LSTM</td><td>21M</td><td>84.8</td><td>80.8</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Table 3: Single model perplexity on validation and test sets for the WikiText-2 language modeling task. All compared models use a two layer LSTM with a hidden size of 650.
|
| 185 |
+
|
| 186 |
+
the medium variational LSTM used in Gal (2015).4 Attempts to run the Gal (2015) large model variant, a two layer LSTM with hidden size 1500, resulted in out of memory errors on a 12GB K80 GPU, likely due to the increased vocabulary size. We chose the best hyperparameters from PTB experiments for all models. Table 3 shows a similar gain made by the pointer sentinel-LSTM over the variational LSTM models. The variational LSTM from Gal (2015) again beats out the variational LSTM used as a base for our experiments.
|
| 187 |
+
|
| 188 |
+
# 6 ANALYSIS
|
| 189 |
+
|
| 190 |
+
# 6.1 IMPACT ON RARE WORDS
|
| 191 |
+
|
| 192 |
+
A hypothesis as to why the pointer sentinel-LSTM can outperform an LSTM is that the pointer component allows the model to effectively reproduce rare words. The RNN may better use hidden state capacity by relying on the pointer component. The pointer component may also allow for a sharper selection of a single word than may be possible using only the softmax.
|
| 193 |
+
|
| 194 |
+
The appendix contains a graph which shows the improvement of perplexity when comparing the LSTM to the pointer sentinel-LSTM. Words are split across buckets according to frequency. As the words become rarer, the pointer sentinel-LSTM has stronger improvements in perplexity. Even on the Penn Treebank, where there is a relative absence of rare words due to only selecting the most frequent 10k words, we can see the pointer sentinel-LSTM mixture model provides a direct benefit.
|
| 195 |
+
|
| 196 |
+
While the improvements are largest on rare words, we can see the pointer sentinel-LSTM is still helpful on relatively frequent words. This may be the pointer component directly selecting the word or through the pointer supervision signal improving the RNN by allowing gradients to flow directly to other occurrences of the word in that window.
|
| 197 |
+
|
| 198 |
+
# 6.2 QUALITATIVE ANALYSIS OF POINTER USAGE
|
| 199 |
+
|
| 200 |
+
In a qualitative analysis, we visualized the gate use and pointer attention for a variety of examples in the validation set, focusing on predictions where the gate primarily used the pointer component. These visualizations are available in the appendix.
|
| 201 |
+
|
| 202 |
+
As expected, the pointer component is heavily used for rare names such as Seidman (23 times in training), Iverson (7 times in training), and Rosenthal (3 times in training). The pointer component was also heavily used when it came to other named entity names such as companies like Honeywell (8 times in training) and Integrated (41 times in training, though due to lowercasing of words this includes integrated circuits, fully integrated, and other generic usage). Surprisingly, the pointer component was also used for many frequent tokens. For selecting units of measurement (tons, kilograms, . . . ) or the short scale of numbers (thousands, millions, billions, . . . ), the pointer would refer to recent usage. This is to be expected, especially when phrases are of the form increased from N tons to N tons. The model can even be found relying on a mixture of the softmax and the pointer for predicting frequent verbs such as said.
|
| 203 |
+
|
| 204 |
+
Finally, the pointer component can be seen pointing to words at the very end of the 100 word window (position 97), a far longer horizon than the 35 steps that most language models truncate their backpropagation training to. This illustrates why the gating function must be integrated into the pointer component. If the gating function could only use the RNN hidden state, it would need to be wary of words that were near the tail of the pointer, especially if it was not able to accurately track exactly how long it was since seeing a word. By integrating the gating function into the pointer component, we avoid the RNN hidden state having to maintain this intensive bookkeeping.
|
| 205 |
+
|
| 206 |
+
# 7 CONCLUSION
|
| 207 |
+
|
| 208 |
+
We introduced the pointer sentinel mixture model and the WikiText language modeling dataset. The pointer sentinel mixture model can be applied to any classifier that ends in a softmax, including various recurrent neural network building blocks. When applied to a standard LSTM, the pointer sentinel-LSTM achieves state of the art results in language modeling over the Penn Treebank while using few additional parameters and little additional computational complexity at prediction time.
|
| 209 |
+
|
| 210 |
+
We have also motivated the need to move from Penn Treebank to a new language modeling dataset for long range dependencies, providing WikiText-2 and WikiText-103 as potential options. We hope these new datasets can serve as a platform to improve handling of rare words and the usage of long term dependencies in language modeling.
|
| 211 |
+
|
| 212 |
+
# REFERENCES
|
| 213 |
+
|
| 214 |
+
Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained Analysis of Sentence Embeddings Using Auxiliary Prediction Tasks. arXiv preprint arXiv:1608.04207, 2016.
|
| 215 |
+
Sungjin Ahn, Heeyoul Choi, Tanel Parnamaa, and Yoshua Bengio. A Neural Knowledge Language ¨ Model. CoRR, abs/1608.00318, 2016.
|
| 216 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In ICLR, 2015.
|
| 217 |
+
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling. arXiv preprint arXiv:1312.3005, 2013.
|
| 218 |
+
Jianpeng Cheng, Li Dong, and Mirella Lapata. Long Short-Term Memory-Networks for Machine Reading. CoRR, abs/1601.06733, 2016.
|
| 219 |
+
Wei-Chen Cheng, Stanley Kok, Hoai Vu Pham, Hai Leong Chieu, and Kian Ming Adam Chai. Language Modeling with Sum-Product Networks. In INTERSPEECH, 2014.
|
| 220 |
+
Yarin Gal. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. arXiv preprint arXiv:1512.05287, 2015.
|
| 221 |
+
Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. Incorporating Copying Mechanism in Sequence-to-Sequence Learning. CoRR, abs/1603.06393, 2016.
|
| 222 |
+
C¸ aglar Gulc¸ehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Bengio. Pointing the ¨ Unknown Words. arXiv preprint arXiv:1603.08148, 2016.
|
| 223 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long Short-Term Memory. ¨ Neural Computation, 9(8): 1735–1780, Nov 1997. ISSN 0899-7667.
|
| 224 |
+
Rudolf Kadlec, Martin Schmid, Ondrej Bajgar, and Jan Kleindienst. Text Understanding with the Attention Sum Reader Network. arXiv preprint arXiv:1603.01547, 2016.
|
| 225 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M. Rush. Character-aware neural language models. CoRR, abs/1508.06615, 2016.
|
| 226 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open Source Toolkit for Statistical Machine Translation. In ACL, 2007.
|
| 227 |
+
|
| 228 |
+
David Krueger, Tegan Maharaj, Janos Kram ´ ar, Mohammad Pezeshki, Nicolas Ballas, Nan Rosemary ´ Ke, Anirudh Goyal, Yoshua Bengio, Hugo Larochelle, Aaron Courville, et al. Zoneout: Regularizing RNNs by Randomly Preserving Hidden Activations. arXiv preprint arXiv:1606.01305, 2016.
|
| 229 |
+
|
| 230 |
+
Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. Ask me anything: Dynamic memory networks for natural language processing. In ICML, 2016.
|
| 231 |
+
|
| 232 |
+
Wang Ling, Edward Grefenstette, Karl Moritz Hermann, Tomas Kocisk ´ y, Andrew Senior, ´ Fumin Wang, and Phil Blunsom. Latent Predictor Networks for Code Generation. CoRR, abs/1603.06744, 2016.
|
| 233 |
+
|
| 234 |
+
Mitchell P. Marcus, Beatrice Santorini, and Mary Ann Marcinkiewicz. Building a Large Annotated Corpus of English: The Penn Treebank. Computational Linguistics, 19:313–330, 1993.
|
| 235 |
+
|
| 236 |
+
Tomas Mikolov and Geoffrey Zweig. Context dependent recurrent neural network language model. In SLT, 2012.
|
| 237 |
+
|
| 238 |
+
Tomas Mikolov, Martin Karafiat, Luk ´ as Burget, Jan Cernock ´ y, and Sanjeev Khudanpur. Recurrent ´ neural network based language model. In INTERSPEECH, 2010.
|
| 239 |
+
|
| 240 |
+
Razvan Pascanu, C¸ aglar Gulc¸ehre, Kyunghyun Cho, and Yoshua Bengio. How to Construct Deep ¨ Recurrent Neural Networks. CoRR, abs/1312.6026, 2013a.
|
| 241 |
+
|
| 242 |
+
Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013b.
|
| 243 |
+
|
| 244 |
+
Roni Rosenfeld. A Maximum Entropy Approach to Adaptive Statistical Language Modeling. 1996.
|
| 245 |
+
|
| 246 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-To-End Memory Networks. In NIPS, 2015.
|
| 247 |
+
|
| 248 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015.
|
| 249 |
+
|
| 250 |
+
Caiming Xiong, Stephen Merity, and Richard Socher. Dynamic Memory Networks for Visual and Textual Question Answering. In ICML, 2016.
|
| 251 |
+
|
| 252 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 253 |
+
|
| 254 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ Highway Networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 255 |
+
|
| 256 |
+
# APPENDIX
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure A1: Mean difference in log perplexity on PTB when using the pointer sentinel-LSTM compared to the LSTM model. Words were sorted by frequency and split into equal sized buckets.
|
| 260 |
+
|
| 261 |
+
# POINTER USAGE ON THE PENN TREEBANK
|
| 262 |
+
|
| 263 |
+
For a qualitative analysis, we visualize how the pointer component is used within the pointer sentinel mixture model. The gate refers to the result of the gating function, with 1 indicating the RNN component is exclusively used whilst 0 indicates the pointer component is exclusively used. We begin with predictions that are using the RNN component primarily and move to ones that use the pointer component primarily.
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure A2: In predicting the fall season has been a good one especially for those retailers, the pointer component suggests many words from the historical window that would fit - retailers, investments, chains, and institutions. The gate is still primarily weighted towards the RNN component however.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure A3: In predicting the national cancer institute also projected that overall u.s. mortality, the pointer component is focused on mortality and rates, both of which would fit. The gate is still primarily weighted towards the RNN component.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure A4: In predicting people do n’t seem to be unhappy with it he said, the pointer component correctly selects said and is almost equally weighted with the RNN component. This is surprising given how frequent the word said is used within the Penn Treebank.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure A5: For predicting the federal government has had to pump in $\$ 1$ N billion, the pointer component focuses on the recent usage of billion with highly similar context. The pointer component is also relied upon more heavily than the RNN component - surprising given the frequency of billion within the Penn Treebank and that the usage was quite recent.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure A6: For predicting $\left. u n k \right.$ ’s ghost sometimes runs through the e ring dressed like gen. noriega, the pointer component reaches 97 timesteps back to retrieve gen. douglas. Unfortunately this prediction is incorrect but without additional context a human would have guessed the same word. This additionally illustrates why the gating function must be integrated into the pointer component. The named entity gen. douglas would have fallen out of the window in only four more timesteps, a fact that the RNN hidden state would not be able to accurately retain for almost 100 timesteps.
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure A7: For predicting mr. iverson, the pointer component has learned the ability to point to the last name of the most recent named entity. The named entity also occurs 45 timesteps ago, which is longer than the 35 steps that most language models truncate their backpropagation to.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure A8: For predicting mr. rosenthal, the pointer is almost exclusively used and reaches back 65 timesteps to identify bruce rosenthal as the person speaking, correctly only selecting the last name.
|
| 285 |
+
|
| 286 |
+

|
| 287 |
+
Figure A9: For predicting in composite trading on the new york stock exchange yesterday integrated, the company Integrated and the $\left. u n k \right.$ token are primarily attended to by the pointer component, with nearly the full prediction being determined by the pointer component.
|
| 288 |
+
|
| 289 |
+
# ZIPFIAN PLOT OVER PTB AND WIKITEXT-2
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure A10: Zipfian plot over the training partition in Penn Treebank and WikiText-2 datasets. Notice the severe drop on the Penn Treebank when the vocabulary hits $1 0 ^ { 4 }$ . Two thirds of the vocabulary in WikiText-2 are past the vocabulary cut-off of the Penn Treebank.
|
| 293 |
+
|
| 294 |
+
ZIPFIAN PLOT OVER WIKITEXT-103
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure A11: Zipfian plot over the training partition in the WikiText-103 dataset. With the dataset containing over 100 million tokens, there is reasonable coverage of the long tail of the vocabulary.
|
md/train/H1fsUiRcKQ/H1fsUiRcKQ.md
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FAST ADVERSARIAL TRAINING FOR SEMI-SUPERVISEDLEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors
|
| 4 |
+
|
| 5 |
+
Paper under double-blind review
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In semi-supervised learning, Bad GAN approach is one of the most attractive method due to the intuitional simplicity and powerful performances. Bad GAN learns a classifier with bad samples distributed on complement of the support of the input data. But Bad GAN needs additional architectures, a generator and a density estimation model, which involves huge computation and memory consumption cost. VAT is another good semi-supervised learning algorithm, which utilizes unlabeled data to improve the invariance of the classifier with respect to perturbation of inputs. In this study, we propose a new method by combining the ideas of Bad $G A N$ and VAT. The proposed method generates bad samples of high-quality by use of the adversarial training used in VAT. We give theoretical explanations why the adversarial training is good at both generating bad samples and semi-supervised learning. An advantage of the proposed method is to achieve the competitive performances with much fewer computations. We demonstrate advantages our method by various experiments with well known benchmark image datasets.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep learning has accomplished unprecedented success due to the development of deep architectures, learning techniques and hardwares (Krizhevsky et al., 2012; Ioffe & Szegedy, 2015; Szegedy et al., 2015; Hinton et al., 2012; Kingma & Ba, 2014). However, deep learning has also suffered from collecting large amount of labeled data which requires both cost and time. Thus it becomes important to develop semi-supervised methodologies that learn a classifier (or discriminator) by using small labeled data and large unlabeled data.
|
| 14 |
+
|
| 15 |
+
Various semi-supervised learning methods have been proposed for deep learning. Weston et al. (2012) employs a manifold embedding technique using the pre-constructed graph of unlabeled data and Rasmus et al. (2015) uses a specially designed auto-encoder to extract essential features for classification. Variational auto encoder (Kingma & Welling, 2013) is also used in the context of semi-supervised learning by maximizing the variational lower bound of both labeled and unlabeled data (Kingma et al., 2014; Maaløe et al., 2016).
|
| 16 |
+
|
| 17 |
+
Recently, semi-supervised learning based on generative adversarial networks (GAN, Goodfellow et al. (2014a)) has received much attention. For $K$ -class classification problems, Salimans et al. (2016) solves the $( K + 1 )$ -class classification problem where the additional $( K + 1 )$ th class consists of synthetic images made by a generator of the $G A N$ learned by unlabeled data. Dai et al. (2017) notices that not a good generator but a bad generator which generates synthetic images much different from observed images is crucial for the success of semi-supervised learning. Dai et al. (2017) gives theoretical justifications of using a bad generator and develops a semi-supervised learning algorithm called Bad GAN which achieves the state-of-the-art performances over multiple benchmark datasets.
|
| 18 |
+
|
| 19 |
+
However, Bad GAN has several limitations. It needs two additional deep architectures - bad generator and pre-trained density estimation model besides the one for the classifier. Learning these multiple deep architectures requires huge computation and memory consumption. In particular, the Pixel$C N N { + + }$ (Salimans et al., 2017) is used for the pre-trained density estimation model which needs very large computational resources.
|
| 20 |
+
|
| 21 |
+
Another difficulty in Bad GAN is that it requires a two-step learning procedure - the first step is to learn the $P i x e l C N N { + + }$ model and the second step is to learn the classifier and the bad generator. The optimal learning of the first step may not be optimal for the second step and hence the regularization of the both steps would need special techniques.
|
| 22 |
+
|
| 23 |
+
In this study, we propose a new semi-supervised learning method which competes well with other stateof-the-art semi-supervised learning algorithms and yet needs much smaller amount of computational resources. In particular, the proposed method employs only one deep architecture and hence the corresponding learning phase is much easier and faster.
|
| 24 |
+
|
| 25 |
+
Our proposed method is motivated by close investigation of VAT (Virtual Adversarial Training) method (Miyato et al., 2015; 2017). VAT tries to find a deep classifier which has a good prediction accuracy on training data and at the same time is less sensitive to data perturbation toward the adversarial direction. Here, the adversarial direction for a given datum is the direction to which the probabilities of each class change most. In Section 3, we prove that the perturbed data toward their adversarial directions can serve as ‘good’ bad samples. By using the adversarial directions for both measuring the invariance and generating the bad samples, the proposed method combines the advantages of Bad GAN and VAT together. Note that only a deep architecture for classification is needed to calculate the adversarial directions and thus the corresponding learning procedure is cheaper, easier and faster. We call our proposed method FAT (Fast Adversarial Training).
|
| 26 |
+
|
| 27 |
+
Dai et al. (2017) proves that bad samples play a role to pull the decision boundary toward the low density regions of data. In Section 5, we give a theoretical explanation that VAT pushes the decision boundary away from the high density regions of data. That is, FAT accelerates the learning procedure by using both pushing and pulling operations simultaneously. In section 6, we show that $F A T$ achieves almost the state-of-the-art performances with much fewer training epochs. Especially, for the MNIST dataset, FAT achieves similar test accuracies to those of Bad GAN and VAT with 5 times and 7 times fewer training epochs, respectively.
|
| 28 |
+
|
| 29 |
+
This paper is organized as follows. In Section 2, we review the Bad GAN and VAT methods briefly. In Section 3, the technique to generate bad samples using the adversarial directions is described, and our proposed semi-supervised learning method is presented in Section 4. Theoretical analysis of VAT is given in Section 5. Results of various experiments are presented in Section 6 and conclusions follow in Section 7.
|
| 30 |
+
|
| 31 |
+
# 2 Bad GAN AND VAT
|
| 32 |
+
|
| 33 |
+
# 2.1 Bad GAN APPROACH
|
| 34 |
+
|
| 35 |
+
Bad GAN is a method that trains a good discriminator with a bad generator. This procedure trains a generator as well as a discriminator simultaneously. Let $\mathcal { D } _ { G } ( \phi )$ be generated bad samples with a bad generator $p _ { G } ( \cdot ; \phi )$ parametrized by $\phi$ . Here, the ‘bad generator’ is a deep architecture to generate samples different from observed data. Let $p ^ { \mathrm { p t } } ( \cdot )$ be a pre-trained density estimation model. For a given discriminator with a feature vector $v ( x ; \theta )$ of a given input $x$ parameterized by $\theta$ , Bad GAN learns the bad generator by minimizing the following:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\mathbb { E } _ { x \sim \mathcal { D } _ { G } ( \phi ) } \left[ \log p ^ { \mathrm { p t } } ( x ) \mathbb { I } ( p ^ { \mathrm { p t } } ( x ) > \tau ) \right] + | | \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } v ( x ; \widehat { \theta } ) - \mathbb { E } _ { x \sim \mathcal { D } _ { G } ( \phi ) } v ( x ; \widehat { \theta } ) | | ^ { 2 }
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
with respect to $\phi$ , where $\tau > 0$ is a tuning parameter, $\boldsymbol { \mathcal { U } } ^ { t r }$ is the unlabeled data, and $\widehat { \theta }$ is the current estimate of $\theta$ and $\| \cdot \|$ is the Euclidean norm.
|
| 42 |
+
|
| 43 |
+
In turn, to train the discriminator, we consider the $K$ -class classification problem as the $( K + 1 )$ -class classification problem where the $( K + 1 )$ -th class is an artificial label of the bad samples generated by the bad generator. We estimate the parameter $\theta$ in the discriminator by minimizing the following:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { l } { - \mathbb { E } _ { x , y \sim \mathcal { L } ^ { t r } } \left[ \log p ( y | x , y \leq K ; \theta ) \right] - \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } \left[ \log \left\{ \displaystyle \sum _ { k = 1 } ^ { K } p ( k | x ; \theta ) \right\} \right] } \\ { - \mathbb { E } _ { x \sim \mathcal { D } _ { G } ( \phi ) } \left[ \log p ( K + 1 | x ; \theta ) \right] - \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } \left[ \displaystyle \sum _ { k = 1 } ^ { K } p ( k | x ; \theta ) \log p ( k | x ; \theta ) \right] } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
for given $\phi$ , where $\mathcal { L } ^ { t r }$ is the labeled set. The second and the third terms in (1) are the cross-entropies between the unlabeled and the bad samples. The fourth term is similar the entropy of the unlabeled data which is usually helpful for semi-supervised learning (Grandvalet & Bengio, 2005). See Dai et al. (2017) for details of the objective function (1).
|
| 50 |
+
|
| 51 |
+
# 2.2 VAT APPROACH
|
| 52 |
+
|
| 53 |
+
$V A T$ is a regularization method which is inspired by the adversarial training (Goodfellow et al., 2014b). The regularization term of VAT is given as:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r c l } { \boldsymbol { L } ^ { \mathrm { V A T } } ( \boldsymbol { \theta } ; \widehat { \boldsymbol { \theta } } , \boldsymbol { x } , \epsilon ) } & { = } & { \displaystyle { D _ { \mathrm { K L } } } \left( p ( \cdot | \boldsymbol { x } ; \widehat { \boldsymbol { \theta } } ) | | p ( \cdot | \boldsymbol { x } + r _ { \mathrm { a d v r } } ( \boldsymbol { x } , \epsilon ) ; \boldsymbol { \theta } ) \right) } \\ & { = } & { \displaystyle - \sum _ { k = 1 } ^ { K } p ( k | \boldsymbol { x } ; \widehat { \boldsymbol { \theta } } ) \log p ( k | \boldsymbol { x } + r _ { \mathrm { a d v r } } ( \boldsymbol { x } , \epsilon ) ; \boldsymbol { \theta } ) + C , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
r _ { \mathrm { a d v r } } ( \boldsymbol { x } , \epsilon ) = \underset { r ; | \lvert r \rvert | \le \epsilon } { \mathrm { a r g m a x } } D _ { \mathrm { K L } } \left( p ( \cdot | \boldsymbol { x } ; \widehat { \boldsymbol { \theta } } ) | | p ( \cdot | \boldsymbol { x } + r ; \widehat { \boldsymbol { \theta } } ) \right) ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$\epsilon > 0$ is a tuning parameter, $\theta$ is the parameter in the discriminator to train, $\widehat { \theta }$ is the current estimate of $\theta$ and $C$ is a constant. Combining with the cross-entropy term of the labeled data, we get the final objective function of $V A T$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
- \mathbb { E } _ { \boldsymbol { x } , \boldsymbol { y } \sim \mathcal { L } ^ { t r } } \left[ \log p ( \boldsymbol { y } | \boldsymbol { x } ; \boldsymbol { \theta } ) \right] + \mathbb { E } _ { \boldsymbol { x } \sim \mathcal { U } ^ { t r } } \left[ \boldsymbol { L } ^ { \mathrm { V A T } } ( \boldsymbol { \theta } ; \widehat { \boldsymbol { \theta } } , \boldsymbol { x } , \epsilon ) \right] .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
# 3 GENERATION OF BAD SAMPLES BY ADVERSARIAL TRAINING
|
| 72 |
+
|
| 73 |
+
The key role of bad samples in Bad GAN is to enforce the decision boundary to be pulled toward the low density regions of the unlabeled data. To do this, bad samples must be located at the valleys of the distribution of the unlabeled data. In this section, we propose a novel technique to generate ‘good’ bad samples by use of only a given classifier.
|
| 74 |
+
|
| 75 |
+
# 3.1 MOTIVATION
|
| 76 |
+
|
| 77 |
+
In this subsection, we explain why the adversarial direction is toward the decision boundary. For simplicity, we only consider the linear decision boundary. For the decision boundary made by the DNN model with ReLU activation function, see Appendix A.2.
|
| 78 |
+
|
| 79 |
+
Let us consider the 2-class linear logistic regression model parametrized by $\eta = \{ w , b \}$ , that is, $p ( y = 1 | x ; \eta ) = \left( 1 + \exp ( - b - w ^ { ' } x ) \right) ^ { - 1 }$ . Note that the decision boundary is $\{ x : b + w ^ { ' } x = 0 \}$ , and for any given $x$ , the distance between $x$ and the decision boundary is $| b + w ^ { ' } x | / | | w | |$ . The key
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 1: Demonstration of how the bad samples generated by the adversarial training are distributed. We consider two cases: 3-class classification problem (Left) and 4-class classification problem (Right). True data and bad data are coloured by blue and orange, respectively.
|
| 83 |
+
|
| 84 |
+
result is that moving $x$ toward the adversarial direction $r _ { \mathrm { a d v r } } ( x , \epsilon )$ is equivalent to moving $x$ toward the decision boundary which is stated rigorously in the following proposition. The proof is in the appendix.
|
| 85 |
+
|
| 86 |
+
Proposition 1 For a sufficiently small $\epsilon > 0$ , we have
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
s i g n ( w ^ { ' } x + b ) \cdot s i g n \left( w ^ { ' } r _ { a d \nu r } ( x , \epsilon ) \right) = - 1 .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Proposition 1 implies that $| b + w ^ { ' } x | / | | w | | > | b + w ^ { ' } ( x + r ^ { \mathrm { a d v r } } ( x , \epsilon ) | / | | w | |$ unless $| b + w ^ { ' } x | = 0$ . Hence, we can treat $x + \delta r _ { \mathrm { a d v r } } ( x , \epsilon ) / | | r ^ { \mathrm { a d v r } } ( x , \epsilon ) | |$ for appropriately choosing $\delta > 0$ as a bad sample (a sample closer to the decision boundary).
|
| 93 |
+
|
| 94 |
+
# 3.2 BAD SAMPLE GENERATION WITH GENERAL CLASSIFIER
|
| 95 |
+
|
| 96 |
+
Motivated by Proposition 1, we propose a bad sample generator as follows. Let $\delta > 0$ be fixed and $\widehat { \theta }$ be the current estimate of $\theta$ . For a given input $x$ and a classifier $p ( \cdot | x ; \widehat { \theta } )$ , we calculate the adversarial direction $r _ { \mathrm { a d v r } } ( x , \epsilon )$ for given $\epsilon$ by (2). Then, we consider $x _ { \mathrm { b a d } } = x + \delta r _ { \mathrm { a d v r } } ( x , \epsilon ) / \| r _ { \mathrm { a d v r } } ( x . \epsilon ) \|$ as a bad sample (a sample closer to the decision boundary). We generate bad samples for all unlabeled data. In practice, we apply the same $\delta$ to all unlabeled data and choose $\delta$ based on the validation data accuracy.
|
| 97 |
+
|
| 98 |
+
In Figure 1, we illustrate how the bad samples generated by the proposed adversarial training are distributed for multi-class problem. With a good classifier, we can clearly see that most bad samples are located well in the low density regions of the data.
|
| 99 |
+
|
| 100 |
+
It may happen that a generated bad sample is not sufficiently close to the decision boundary to be a ’good’ bad sample, in particular when $\delta$ is too large or too small. To avoid such a situation, we exclude $x _ { \mathrm { b a d } }$ which satisfies the following condition:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\operatorname* { m a x } _ { k } p ( k | x _ { \mathrm { b a d } } ; \widehat { \theta } ) > 1 - \tau
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
for a prespecified $\tau > 0$ . In our experiments, we set the optimal $\tau$ with validation data.
|
| 107 |
+
|
| 108 |
+
# 4 FAST ADVERSARIAL TRAINING WITH BAD SAMPLES
|
| 109 |
+
|
| 110 |
+
Once we generate bad samples by the adversarial training, $F A T$ updates $\theta$ by minimizing the following objective function:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array} { r l } & { - \mathbb { E } _ { x , y \sim \mathcal { L } ^ { t r } } \left[ \log p ( y | x ; \theta ) \right] + \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } \left[ L ^ { \mathrm { t r u e } } ( \theta ; x ) \right] + \mathbb { E } _ { x \sim \mathcal { D } ^ { b a d } ( \widehat { \theta } , \epsilon , \delta ) } \left[ L ^ { \mathrm { f a k e } } ( \theta , x ) \right] } \\ & { + \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } \left[ L ^ { \mathrm { V a T } } ( \theta ; \widehat { \theta } , x , \epsilon ) \right] } \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\mathcal { D } ^ { b a d } ( \widehat { \theta } , \epsilon , \delta )$ is the set of generated bad samples with ${ \widehat { \theta } } , \epsilon$ and $\delta$ ,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { l } { { { \cal L } ^ { \mathrm { t r u e } } } ( \theta ; x ) = - \displaystyle \sum _ { k = 1 } ^ { K } \left[ \displaystyle \frac { \exp ( g _ { k } ( x ; \theta ) ) } { 1 + \sum _ { k ^ { \prime } = 1 } ^ { K } \exp ( g _ { k ^ { \prime } } ( x ; \theta ) ) } \log \displaystyle \frac { \exp ( g _ { k } ( x ; \theta ) ) } { 1 + \sum _ { k ^ { \prime } = 1 } ^ { K } \exp ( g _ { k ^ { \prime } } ( x ; \theta ) ) } \right] , } \\ { { { \cal L } ^ { \mathrm { f a k e } } } ( \theta ; x ) = - \log \displaystyle \frac { 1 } { 1 + \sum _ { k = 1 } ^ { K } \exp ( g _ { k } ( x ; \theta ) ) } , } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
$g ( x ; \theta ) \in \mathbb { R } ^ { K }$ is a pre-softmax vector of a given deep architecture and $\lambda > 0$ . We treat $\epsilon$ and $\delta$ as tuning parameters to be selected based on the validation data accuracy. We minimize the objective function with one of the standard optimization algorithms such as Adam (Kingma & Ba, 2014) or RMSProp (Tieleman & Hinton, 2012).
|
| 123 |
+
|
| 124 |
+
The objective function (5) differs from the objective function (1) of Bad GAN in a way that the second term of (1), the cross-entropy of not being a bad sample, is deleted and the regularization term of VAT is added. We delete the second term of (1) because it can be easily shown that a perfect classifier of unlabeled data can be obtained from the minimizer of the objective function (1) without the second term under the conditions in Dai et al. (2017). The regularization term of VAT is added to improve the bad sample generator based on adversarial training. See Section 5.1 for detailed discussions.
|
| 125 |
+
|
| 126 |
+
Miyato et al. (2017) proposes the fast approximation method to calculate the adversarial direction $r _ { \mathrm { a d v r } } ( x , \epsilon )$ by using the second-order Taylor expansion. Let us define $H ( x , { \widehat { \theta } } ) \ =$ $\nabla \nabla D _ { \mathrm { K L } } \left( p ( \cdot | x ; \widehat { \theta } ) | | p ( \cdot | x + r ; \widehat { \theta } ) \right) | _ { r = 0 }$ . They claim that $r _ { \mathrm { a d v r } }$ emerges as the first dominant eigenvector $u ( x , \widehat { \theta } )$ of $H ( x , { \widehat { \theta } } )$ with magnitude $\epsilon$ . But there always exist two dominant eigenvectors, $\pm u ( x , \widehat { \theta } )$ , and the sign should be selected carefully. So, we slightly modify the approximation method of Miyato et al. (2017) by
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
r _ { \mathrm { a d v r } } ( \boldsymbol { x } , \epsilon ) = \operatorname * { a r g m a x } _ { \boldsymbol { r } \in \{ \boldsymbol { u } ( \boldsymbol { x } , \widehat { \boldsymbol { \theta } } ) , - \boldsymbol { u } ( \boldsymbol { x } , \widehat { \boldsymbol { \theta } } ) \} } D _ { \mathrm { K L } } \left( p ( \cdot | \boldsymbol { x } ; \widehat { \boldsymbol { \theta } } ) | | p ( \cdot | \boldsymbol { x } + \boldsymbol { r } ; \widehat { \boldsymbol { \theta } } ) \right) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
This modification helps to improve convergence speed of the test accuracy, which will be demonstrated in the ablation experiments.
|
| 133 |
+
|
| 134 |
+
# 5 ROLE OF VAT FOR SEMI-SUPERVISED LEARNING
|
| 135 |
+
|
| 136 |
+
In this section, we investigate the roles of the regularization term of VAT in our method in detail. First, we verify that VAT regularization term does help to generate ’better’ bad samples with a simple experiment. Furthermore, we give a theoretical insight for the role of the regularization term of VAT in semi-supervised learning. We will show that the regularization term of VAT pushes the decision boundary from the high density regions of unlabeled data. As a result, FAT uses pushing operations by VAT term as well as pulling operations by bad samples simultaneously, which makes it possible to accelerate the training process with improved performances.
|
| 137 |
+
|
| 138 |
+
# 5.1 IMPROVEMENT OF BAD SAMPLES WITH VAT
|
| 139 |
+
|
| 140 |
+
For generated samples by adversarial training to be ‘good’ bad samples, the adversarial directions should be toward the decision boundary. While this always happens for the linear model by Proposition 1, adversarial directions could be opposite to the decision boundary for deep model. To avoid such undesirable cases as much as possible, it would be helpful to smoothen the classifier with a regularization term. In this section, we explain that the regularization term of VAT plays such a role.
|
| 141 |
+
|
| 142 |
+
The adversarial direction obtained by maximizing the KL divergence is sensitive to local fluctuations of the class probabilities which is examplified in Figure 2. The regularization term of VAT is helpful to find a right adversarial direction which is toward the decision boundary by eliminating unnecessary local fluctuations of the class probabilities. In Figure 3, we compare bad samples generated by the adversarial training with and without the regularization term of VAT for the MNIST dataset. While the bad samples generated without the regularization term of VAT are visually similar to the given input vectors, the bad samples generated with the regularization term of VAT look like mixtures of two different digits and thus serve as ‘better’ bad samples.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Examples of $P ( y = 1 | x )$ of smooth (Left) and wiggle (Right) cases. We plot 3 points and their adversarial directions on each case.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 3: (Upper) 10 randomly sampled original MNIST dataset. (Middle and Lower) Bad samples obtained by the classifier learned with and without the regularization term of VAT.
|
| 149 |
+
|
| 150 |
+
# 5.2 THEORETICAL ANALYSIS OF VAT
|
| 151 |
+
|
| 152 |
+
Suppose that $\mathcal { X }$ is partitioned by $( K + 1 )$ mutually disjoint subsets $\mathcal { X } _ { k }$ for $k = 1 , \ldots , K + 1$ such that $y ( x ) = k$ for all $x \in { \mathcal { X } } _ { k } , k \leq K$ and $p ^ { * } ( x ) = 0$ for $x \in \mathcal { X } _ { K + 1 }$ , where $y ( x )$ is the ground-truth label of $x$ and $p ^ { * } ( x )$ is the true density of $x$ . For a given feature map $u : \mathcal { X } \mathbb { R } ^ { m }$ and weight vectors $w _ { 1 } , \ldots , w _ { k }$ , let $p ( y = k | x ) \propto \exp ( w _ { k } ^ { ' } u ( x ) )$ for $k = 1 , \ldots , K$ and $p ( y = K + 1 | x ) \propto 1$ . Let $\mathcal { L } ^ { t r }$ satisfy $\mathcal { X } _ { k } \cap \mathcal { L } _ { t r } \neq \emptyset$ for $k = 1 , . . . K$ . Suppose that (i) $\ \mathrm { a r g m a x } _ { h } p ( y = h | x ) = y$ for $\boldsymbol { x } \in \mathcal { L } _ { t r }$ , (ii) $\mathrm { a r g m a x } _ { h } p ( y = h | x ) \le K$ for $x \in \cup _ { k = 1 } ^ { K } \mathcal { X } _ { k }$ and (iii) argmax $\dot { \mathbf { \rho } } _ { h } p ( y = h | x ) = K + 1$ for $x \in \mathcal { X } _ { K + 1 }$ . Under these three conditions, Dai et al. (2017) proves that $\mathrm { a r g m a x } _ { h } p ( y = h | x ) = y ( x )$ for all $x \in \cup _ { k = 1 } ^ { K } \mathcal { X } _ { k }$ . That is, generating large ‘good’ bad samples is helpful for classifying unlabeled data correctly only with a small amount of labeled data.
|
| 153 |
+
|
| 154 |
+
A similar result can be obtained for VAT objective function itself under mild additional conditions. For given two subsets $\mathcal { A } _ { 1 }$ and $\boldsymbol { A } _ { 2 }$ of $\mathcal { X }$ , we define $\begin{array} { r } { d ( A _ { 1 } , A _ { 2 } ) = \operatorname* { m i n } _ { x _ { 1 } \in A _ { 1 } , x _ { 2 } \in A _ { 2 } } d ( x _ { 1 } , x _ { 2 } ) } \end{array}$ for a given metric $d$ . We define a tuple $( x , x ^ { ' } )$ is $\epsilon$ -connected if $d ( x , x ^ { ' } ) < \epsilon$ . A finite subset $\mathcal { A }$ of $\mathcal { X }$ is called $\epsilon$ -connected iff for all $x , x ^ { ' } \in { \mathcal { A } }$ , there exists a finite path $( x , x _ { 1 } , . . . , x _ { q } , x ^ { ' } )$ such that $x _ { j } \in { \mathcal { A } }$ for $j = 1 , \dotsc , q$ an $1 ( x , x _ { 1 } ) , ( x _ { 1 } , x _ { 2 } ) , . . . , ( x _ { q - 1 } , x _ { q } ) , ( x _ { q } , x ^ { ' } )$ are all $\epsilon$ -connected.
|
| 155 |
+
|
| 156 |
+
Proposition 2 Assume that there exists $\epsilon > 0$ such that $\pmb { I }$ ) $\mathcal { U } _ { k } ^ { t r } = \mathcal { U } ^ { t r } \cap \mathcal { X } _ { k } , k = 1 , \ldots , K$ are $\epsilon$ -connected, 2) $d ( \mathcal { X } _ { k } , \mathcal { X } _ { k ^ { \prime } } ) \geq 2 \epsilon$ for all $k \neq k ^ { ' } \leq K$ , and 3) for each $k \leq K$ , there exists at least one $( x , k ) \in \mathcal { L } ^ { t r }$ such that $d ( \{ x \} , \mathcal { U } _ { k } ^ { t r } ) < \epsilon$ . Suppose that there exists a classifier $f : \mathcal { X } \to \{ 1 , . . . , K \}$ such that $f ( x ) = y$ for all $( x , y ) \in \mathcal { L } ^ { t r }$ and
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
f ( x ) = f ( x ^ { ' } ) f o r a l l x ^ { ' } \in \mathcal { B } ( x , \epsilon )
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
for all $\boldsymbol { x } \in \boldsymbol { U } ^ { t r }$ , where $\displaystyle B ( x , \epsilon ) = \{ x ^ { \prime } : d ( x , x ^ { \prime } ) \leq \epsilon \}$ . Then, the function $f$ classifies the unlabeled set perfectly, that is:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
f ( x ) = y ( x ) f o r a l l x \in \mathcal { U } ^ { t r } .
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
Condition 1) and 2) mean that the unlabeled data are dense enough and the supports of each class are separated sufficiently, respectively. Condition 3) assumes that at least one labeled instance exists near the supports of each class. The main condition of Proposition 2 is (6) which essentially assumes that the classifier $f$ does not change much locally. That is, $f$ is invariant with respect to all small perturbations of an input $x$ . Note that the regularization term of $V A T$ is devised to improve the invariancy of the classifier and Proposition 2 explains why improving the invariancy is helpful for semi-supervised learning.
|
| 169 |
+
|
| 170 |
+
# 5.3 INTERPRETATION OF VAT
|
| 171 |
+
|
| 172 |
+
Let $f ( x ; \theta ) = \mathrm { a r g m a x } _ { h } p ( y = h | x ; \theta )$ . Proposition 2 implies that it would be good to pursue a classifier which predicts the labeled data correctly and at the same time is invariant with respect to all local perturbations on the unlabeled data. For this purpose, a plausible candidate of the objective function is
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\begin{array} { r } { \mathbb { E } _ { ( { x } , { y } ) \sim \mathcal { L } ^ { t r } } \left[ \mathbb { I } ( { y } \neq f ( { x } ; { \theta } ) \right] + \mathbb { E } _ { { x } \sim \mathcal { U } ^ { t r } } \left[ \mathbb { I } \left( f ( { x } ; { \theta } ) \neq f ( { x } ^ { ' } ; { \theta } ) \mathrm { ~ f o r ~ } { \forall x } ^ { ' } \in \mathcal { B } ( { x } , { \epsilon } ) \right) \right] . } \end{array}
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
Note that a classifier $f$ which achieves 0 value of the objective function (7) satisfies the conditions of Proposition 2 and thus classifies all unlabeled data correctly.
|
| 179 |
+
|
| 180 |
+
The objective function (7) is not practically usable since neither optimizing the indicator function nor checking $f ( x ; \theta ) \neq f ( x ^ { ' } ; \theta )$ for all $x ^ { ' }$ in $B ( x , \epsilon )$ is possible. To resolve these problems, we replace the indicator functions in (7) with the cross-entropies, and the neighborhood $B ( x , \epsilon )$ in the second term with the adversarial direction. By doing so, we have the following alternative objective function:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
- \mathbb { E } _ { x , y \sim \mathcal { L } ^ { t r } } \left[ \log p ( y | x ; \theta ) \right] - \mathbb { E } _ { x \sim \mathcal { U } ^ { t r } } \left[ \sum _ { k = 1 } ^ { K } p ( k | x ; \theta ) \log p ( k | x + r _ { \mathrm { a d v r } } ( x , \epsilon ) ; \theta ) \right] .
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
Finally, we replace $p ( \cdot | x ; \theta )$ in the second term of (8) by $p ( \cdot | x ; \widehat { \theta } )$ to have the objective function of VAT (3).
|
| 187 |
+
|
| 188 |
+
The condition (6) in Proposition 2 means that the decision boundary is not located inside the support $\mathcal { X } _ { k }$ of each class. That is, the regularization term of VAT prevents the decision boundary from being located at the high density regions of data or equivalently pushes the decision boundary from the high density regions of data.
|
| 189 |
+
|
| 190 |
+
# 6 EXPERIMENTS
|
| 191 |
+
|
| 192 |
+
# 6.1 PREDICTION PERFORMANCES IN SEMI-SUPERVISED LEARNING
|
| 193 |
+
|
| 194 |
+
We compare prediction performances of $F A T$ over the benchmark datasets with other semi-supervised learning algorithms. We consider the most widely used datasets: MNIST (LeCun et al., 1998), SVHN (Marlin et al., 2010) and CIFAR10 (Krizhevsky & Hinton, 2009). As in done by other works, we randomly sample 100, 1000 and 4000 labeled data from the MNIST, SVHN and CIFAR10 datasets, respectively and use them as the labeled data and the rest as the unlabeled data. For fair comparison, we use the same architectures as those used in Miyato et al. (2017) for MNIST, SVHN and CIFAR10. The optimal tuning parameters $( \epsilon , \tau , \delta )$ in $F A T$ are chosen based on the validation data accuracy.
|
| 195 |
+
|
| 196 |
+
Table 1: Comparison of prediction accuracies of various semi-supervised learning algorithms for the three benchmark datasets. mod. VAT is the modified version of VAT stated in Section 4.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Method</td><td colspan="3">Test acc.(%)</td></tr><tr><td></td><td>MNIST(100)</td><td>SVHN(1000)</td><td>CIFAR10(4000)</td></tr><tr><td>DGN (Kingma et al., 2014)</td><td>96.67</td><td>63.98</td><td>-</td></tr><tr><td>Ladder (Rasmus et al., 2015)</td><td>98.94</td><td>1</td><td>79.6</td></tr><tr><td>ALI (Donahue et al., 2016)</td><td>1</td><td>92.58</td><td>82.01</td></tr><tr><td>FM-GAN (Salimans et al.,2016)</td><td>99.07</td><td>91.89</td><td>81.37</td></tr><tr><td>FM-GAN-Tan (Kumar et al., 2017)</td><td>1</td><td>95.61</td><td>83.80</td></tr><tr><td>Bad GAN (Dai et al., 2017)</td><td>99.20</td><td>95.75</td><td>85.59</td></tr><tr><td>VAT (Miyato et al., 2017)</td><td>98.64</td><td>93.17</td><td>85.13</td></tr><tr><td>CrossEnt (use all data)</td><td>98.82</td><td>96.74</td><td>90.31</td></tr><tr><td>CrossEnt (use lab. data only)</td><td>79.16</td><td>88.91</td><td>67.45</td></tr><tr><td>mod. VAT</td><td>98.70</td><td>94.69</td><td>85.18</td></tr><tr><td>FAT</td><td>98.89</td><td>95.94</td><td>85.31</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 2: Comparison of prediction accuracies with small labeled data and more complex dataset.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Test acc.(%)</td></tr><tr><td>MNIST(20)</td><td>SVHN(500)</td><td>CIFAR10(1000)</td><td>CIFAR100(8000)</td></tr><tr><td>FM-GAN (Salimans et al., 2016)</td><td>83.23</td><td>81.56</td><td>78.13</td><td>-</td></tr><tr><td>FM-GAN-Tan (Salimans et al., 2016)</td><td>-</td><td>95.13</td><td>80.48</td><td>1</td></tr><tr><td>CrossEnt(use all data)</td><td>98.82</td><td>96.74</td><td>90.31</td><td>46.72</td></tr><tr><td>CrossEnt(use lab.data only)</td><td>54.92</td><td>85.82</td><td>50.30</td><td>18.35</td></tr><tr><td>mod. VAT</td><td>89.92</td><td>92.59</td><td>75.43</td><td>34.76</td></tr><tr><td>FAT</td><td>96.32</td><td>95.21</td><td>75.96</td><td>35.52</td></tr></table>
|
| 203 |
+
|
| 204 |
+
We use Adam algorithm (Kingma & Ba, 2014) to update the parameters and do not use any data augmentation techniques. The results are summarized in Table 1, which shows that $F A T$ achieves the state-of-the-art accuracy for SVHN dataset and competitive accuracies with the state-of-the-art method (i.e. Bad GAN) for MNIST and CIFAR10.
|
| 205 |
+
|
| 206 |
+
We conduct another experiments where the numbers of labeled data are much smaller and consider a more complex dataset CIFAR100 (Krizhevsky & Hinton, 2009), whose results are summarized in Table 2. Note that FAT still dominates mod. VAT for the all datasets and the margins become larger. While $F A T$ achieves the state-of-the-art performances for MNIST and SVHN, its performance degrades much for CIFAR10 compared to the accuracy for the case of 4000 labeled data. Note that the quality of bad samples depends on the quality of the estimated classifier. For CIFAR10 which is relatively more complex than MNIST and SVHN, the quality of the estimated classifier is influenced much to the amount of labeled data and thus the accuracy of $F A T$ is more sensitive to the amount of labeled data. However, it is interesting to see that $F A T$ is superior to mod. VAT for CIFAR10 and CIFAR100, which suggests that bad samples are helpful for complex problems where the quality of bad samples might not be sufficiently good.
|
| 207 |
+
|
| 208 |
+
The other advantage of $F A T$ is its stability with respect to learning phase. With small labeled data, the test accuracies of each epoch tends to fluctuate much for VAT and mod VAT, while $F A T$ provides much more stable results. See Figure 7 in Appendix. This may be partly because ’good’ bad samples keep the classifier from fluctuation.
|
| 209 |
+
|
| 210 |
+
Table 3: Test accuracies of MNIST for various values of $\tau$ and $\delta$ . The other two parameters on each case are fixed to the optimal values.
|
| 211 |
+
|
| 212 |
+
<table><tr><td>T</td><td>0.001</td><td>0.01</td><td>0.1</td><td>0.2</td></tr><tr><td>Test acc.</td><td>98.65</td><td>98.89</td><td>98.77</td><td>98.71</td></tr></table>
|
| 213 |
+
|
| 214 |
+
<table><tr><td>8</td><td>1</td><td>2.</td><td>4.</td><td>6.</td></tr><tr><td>Test acc.</td><td>89.54</td><td>98.89</td><td>98.79</td><td>98.55</td></tr></table>
|
| 215 |
+
|
| 216 |
+
Table 4: Test accuracies for diverse objective loss functions.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Data Setting</td><td>MNIST</td><td>SVHN</td><td>CIFAR10</td></tr><tr><td>Ltrue +Lfake +LVAT</td><td>98.89</td><td>Test acc.(%) 95.94</td><td>85.15</td></tr><tr><td>Ltrue +Lfake</td><td>83.6</td><td>90.21</td><td>68.32</td></tr><tr><td>Lfake+ LVAT</td><td>98.77</td><td>95.71</td><td>85.31</td></tr></table>
|
| 219 |
+
|
| 220 |
+
# 6.2 EFFECTS OF TUNING PARAMETERS
|
| 221 |
+
|
| 222 |
+
$F A T$ introduces two additional tuning parameters $\tau$ and $\delta$ compared to VAT, where $\tau$ is used to determine whether a bad sample is ’good’ and $\delta$ is the radius to generate bad samples. We investigate the sensitivities of prediction performances with respect to the changes of the values of $\tau$ and $\delta$ with $\epsilon$ being fixed at 1.5 that is the optimal value. The results are reported in Table 3. Unless $\tau$ is too small or too large, the prediction performances are not changed much. For $\delta$ , care should be done. Too small $\delta$ , smaller than , hampers the prediction performance much. Apparently, a similar value of $\delta$ to that of $\epsilon$ (i.e. $\delta = 2$ ) gives the best result.
|
| 223 |
+
|
| 224 |
+
# 6.3 OBJECTIVE FUNCTION ANALYSIS
|
| 225 |
+
|
| 226 |
+
In this subsection, we analyze the effects of $L ^ { \mathrm { t r u e } }$ and $L ^ { \mathrm { V A T } }$ in this section. We do not consider the cross-entropy of the labeled data and $L ^ { \mathrm { f a k e } }$ since they are necessary to reflect the idea utilizing bad data. Table 4 compares the performances without one or both of these terms. Note that $L ^ { \mathrm { V A T } }$ is necessary for superior performances, which is because $L ^ { \mathrm { V A T } }$ is indispensable to generate ‘good’ bad samples as explained in Section 5.1. On the other hand, the term $L ^ { \mathrm { t r u e } }$ , which is devised to separate unlabeled data from bad samples, is not always helpful. A possible explanation is that sometimes the term $L ^ { \mathrm { t r u e } }$ would give an undesirable effect on the misclassified data.
|
| 227 |
+
|
| 228 |
+
# 6.4 COMPUTATIONAL EFFICIENCY
|
| 229 |
+
|
| 230 |
+
We investigate the computational efficiency of our method in view of learning speed and computation time per training epoch. For Bad GAN, we did not use $P i x e l C N N { + + }$ on SVHN and CIFAR10 datasets since the pre-trained $P i x e l C N N { + + }$ models are not publicly available. Figure 4 draws the bar plots about the numbers of epochs needed to achieve the prespecified test accuracies. We can clearly see that $F A T$ requires much less epochs
|
| 231 |
+
|
| 232 |
+
We also calculate the ratios of the computing time of each semi-supervised learning algorithm over the computing time of the corresponding supervised learning algorithm for CIFAR10 dataset, whose results are summarized in Table 5. These ratios are almost same for different datasets. The computation time of $F A T$ is competitive to VAT and mod. VAT, and hence we can conclude that $F A T$ arrives at the prespecified performances much efficiently. Note that $P i x e l C N N { + + }$ is not used for this experiment, and so comparison of computing time of $F A T$ and Bad GAN with $P i x e l C N N + +$ is meaningless
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 4: The number of epochs to achieve the prespecified test accuracies $9 8 \%$ , $90 \%$ and $80 \%$ ) with the four methods for (Left) MNIST, (Middle) SVHN and (Right) CIFAR10 datasets. Bad $G A N$ is operated without $P i x e l C N N + +$ for SVHN and CIFAR10 datasets.
|
| 236 |
+
|
| 237 |
+
Table 5: Learning time per training epoch ratios compared to supervised learning with cross-entropy for CIFAR10. Bad GAN is operated without $P i x e l C N N + +$ .
|
| 238 |
+
|
| 239 |
+
<table><tr><td>Method</td><td>VAT</td><td>mod. VAT</td><td>FAT</td><td>Bad GAN</td></tr><tr><td>Time ratio</td><td>1.37</td><td>1.62</td><td>2.09</td><td>3.20</td></tr></table>
|
| 240 |
+
|
| 241 |
+
# 6.5 QUALITY OF BAD SAMPLES GENERATED BY ADVERSARIAL TRAINING
|
| 242 |
+
|
| 243 |
+
We investigate how ‘good’ bad samples generated by the adversarial training are. The upper panel of Figure 5 shows the scatter plot of the synthetic data and the trace plot of prediction accuracies of $F A T$ and VAT. And the lower panel of Figure 5 draws the scatter plots with generated bad samples at various epochs. We can clearly see that bad samples move to lower density regions as the epoch increases, which amply demonstrates that the adversarial training is good at generating bad samples. We also compare bad images of the MNIST data generated by $F A T$ and Bad GAN in Figure 6. The bad images by $F A T$ do not look like real images and do not seem to be collapsed, which indicates that $F A T$ consistently generates diverse and good bad samples. Bad GAN also generates diverse bad samples but some ‘realistic’ images can be found.
|
| 244 |
+
|
| 245 |
+
# 7 CONCLUSION
|
| 246 |
+
|
| 247 |
+
In this paper, we propose a new method called FAT for semi-supervised learning which generates bad samples only with a given classifier. The objective function of $F A T$ is devised to compromise the advantages of Bad GAN and VAT together, which makes $F A T$ be faster and more accurate. In numerical experiments, we show that $F A T$ achieves almost the state-of-the-art performances with much fewer epochs. Unlike Bad GAN , $F A T$ only needs to learn a discriminator. Hence, it could be extended without much effort to other learning problems. For example, $F A T$ can be modified easily for recurrent neural networks and hence can be applied to sequential data. We will leave this extension as a future work.
|
| 248 |
+
|
| 249 |
+
It would be useful to combine $F A T$ with a generative approach such as Bad GAN, in particular when the initial classifier is bad. Since FAT uses only a classifier to generate bad samples, the initial estimate of the classifier would be important. Using the generator model learned by large unlabeled data would be helpful to find a good initial estimate of the classifier.
|
| 250 |
+
|
| 251 |
+
# ACKNOWLEDGMENTS
|
| 252 |
+
|
| 253 |
+
This work is supported by Samsung Electronics Co., Ltd.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: (Upper Left) The scatter plot of synthetic data which consist of 1000 unlabeled data (gray) and 4 labeled data for each class (red and blue with black edge). (Upper Right) Accuracies of unlabeled data for each epochs for VAT and FAT. We use 2-layered NN with 100 hidden units each. (Lower) Bad samples and classified unlabeled data by colors at the different training epochs of FAT
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 6: 100 randomly sampled bad images using (Left) FAT and (Right) Bad GAN.
|
| 260 |
+
|
| 261 |
+
# REFERENCES
|
| 262 |
+
|
| 263 |
+
Zihang Dai, Zhilin Yang, Fan Yang, William W Cohen, and Ruslan R Salakhutdinov. Good semisupervised learning that requires a bad gan. In Advances in Neural Information Processing Systems, pp. 6513–6523, 2017.
|
| 264 |
+
|
| 265 |
+
Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016.
|
| 266 |
+
|
| 267 |
+
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, 2014a.
|
| 268 |
+
|
| 269 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014b.
|
| 270 |
+
|
| 271 |
+
Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Advances in neural information processing systems, pp. 529–536, 2005.
|
| 272 |
+
|
| 273 |
+
Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012.
|
| 274 |
+
|
| 275 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 276 |
+
|
| 277 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 278 |
+
|
| 279 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 280 |
+
|
| 281 |
+
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.
|
| 282 |
+
|
| 283 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 284 |
+
|
| 285 |
+
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.
|
| 286 |
+
|
| 287 |
+
Abhishek Kumar, Prasanna Sattigeri, and Tom Fletcher. Semi-supervised learning with gans: manifold invariance with improved inference. In Advances in Neural Information Processing Systems, pp. 5534–5544, 2017.
|
| 288 |
+
|
| 289 |
+
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.
|
| 290 |
+
|
| 291 |
+
Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. arXiv preprint arXiv:1602.05473, 2016.
|
| 292 |
+
|
| 293 |
+
Benjamin Marlin, Kevin Swersky, Bo Chen, and Nando Freitas. Inductive principles for restricted boltzmann machine learning. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 509–516, 2010.
|
| 294 |
+
|
| 295 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing with virtual adversarial training. arXiv preprint arXiv:1507.00677, 2015.
|
| 296 |
+
|
| 297 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. arXiv preprint arXiv:1704.03976, 2017.
|
| 298 |
+
|
| 299 |
+
Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems, pp. 3546– 3554, 2015.
|
| 300 |
+
|
| 301 |
+
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.
|
| 302 |
+
|
| 303 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
|
| 304 |
+
|
| 305 |
+
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, 2015.
|
| 306 |
+
|
| 307 |
+
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):26–31, 2012.
|
| 308 |
+
|
| 309 |
+
Jason Weston, Frédéric Ratle, Hossein Mobahi, and Ronan Collobert. Deep learning via semisupervised embedding. In Neural Networks: Tricks of the Trade, pp. 639–655. Springer, 2012.
|
| 310 |
+
|
| 311 |
+
# A APPENDIX
|
| 312 |
+
|
| 313 |
+
# A.1 PROOF OF PROPOSITION 1
|
| 314 |
+
|
| 315 |
+
Without loss of generality, we assume that $w ^ { ' } x + b > 0$ , that is, $p ( y = 1 | x ; \eta ) > p ( y = 0 | x ; \eta )$ . We will show that there exists $\epsilon > 0$ such that $w ^ { ' } r ^ { * } ( x , \epsilon ) < 0$ . Note that
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r l r } { { \operatorname * { a r g m a x } _ { \begin{array} { l } { r , | | x | | \leq \epsilon , w ^ { \prime } r > 0 } \\ { \operatorname * { a r g m a x } _ { \begin{array} { l } { K L ( x , r ; \eta ) = - \epsilon } \\ { r , | | w | | \leq \epsilon , w ^ { \prime } r < 0 } \end{array} } } \textstyle K L ( x , r ; \eta ) = \epsilon \frac { w } { | | w | | } ( = : r _ { 1 } ^ { * } ) \quad \mathrm { a n d } } } \end{array} } \\ & { } & \operatorname * { a r g m a x } _ { \begin{array} { l } { K L ( x , r ; \eta ) = - \epsilon \frac { w } { | | w | | } ( = : r _ { 2 } ^ { * } ) . } \end{array} } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
So all we have to do is to show
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
K L ( x , r _ { 2 } ^ { * } ; \eta ) > K L ( x , r _ { 1 } ^ { * } ; \eta ) .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
By simple calculation we can get the following:
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\small \begin{array} { r } { \nabla L ( x , r _ { 2 } ^ { * } ; \eta ) - K L ( x , r _ { 1 } ^ { * } ; \eta ) = - \left[ p ( y = 1 | x ; \theta ) w ^ { ' } ( r _ { 2 } ^ { * } - r _ { 1 } ^ { * } ) - \log \frac { \exp \big ( w ^ { ' } ( x + r _ { 2 } ^ { * } ) + b \big ) + 1 } { \exp ( w ^ { ' } ( x + r _ { 1 } ^ { * } ) + b ) + 1 } \right] . } \end{array}
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Using the Taylor’s expansion up to the third-order, we obtain the following:
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
\begin{array} { r c l } { \log \Big [ \exp \Big ( w ^ { ' } ( x + r ) + b \Big ) + 1 \Big ] } & { = } & { \log \Big [ \exp \Big ( w ^ { ' } x + b \Big ) + 1 \Big ] + p ( y = 1 | x ; \eta ) w ^ { ' } r } \\ & & { } & { + \displaystyle \frac { 1 } { 2 } p ( y = 1 | x ; \eta ) p ( y = 0 | x ; \eta ) r ^ { ' } w w ^ { ' } r } \\ & & { } & { - \displaystyle \frac { 1 } { 6 } p ( y = 1 | x ; \eta ) p ( y = 0 | x ; \eta ) \left\{ p ( y = 1 | x ; \eta ) - p ( y = 0 | x ; \eta ) \right. } \\ & & { } & { \left. + o ( | | r | | ^ { 3 } ) . \right. } \end{array}
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
So,
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\begin{array} { r c l } { \frac { \ d s ^ { \prime } ( x + r _ { 2 } ^ { \ast } ) + \ d b \Big ) + 1 } { \ d y ^ { \prime } ( x + r _ { 1 } ^ { \ast } ) + \ d b ) + 1 } } & { = } & { p ( y = 1 | x ; \eta ) w ^ { ' } ( r _ { 2 } ^ { \ast } - r _ { 1 } ^ { \ast } ) } \\ & & { + \frac { 1 } { 3 } p ( y = 1 | x ; \eta ) p ( y = 0 | x ; \eta ) \left\{ p ( y = 1 | x ; \eta ) - p ( y = 0 | x ; \eta ) \right\} \epsilon ^ { 3 } | | w | | ^ { 3 } . } \end{array}
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Thus, we have the following equations:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\begin{array} { r c l } { \check { \operatorname { \tiny { C } } } L ( x , r _ { 2 } ^ { * } ; \eta ) - K L ( x , r _ { 1 } ^ { * } ; \eta ) } & { = } & { \frac { 1 } { 3 } p ( y = 1 | x ; \eta ) p ( y = 0 | x ; \eta ) \left\{ p ( y = 1 | x ; \eta ) - p ( y = 0 | x ; \eta ) \right\} \epsilon ^ { 3 } } \\ & & { = } & { C \cdot \epsilon ^ { 3 } + o ( \epsilon ^ { 3 } ) . } \end{array}
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
Therefore, there exists $\epsilon ^ { * } > 0$ such that $K L ( x , r _ { 2 } ^ { * } ; \eta ) > K L ( x , r _ { 1 } ^ { * } ; \eta )$ for $\forall 0 < \epsilon < \epsilon ^ { * }$ .
|
| 352 |
+
|
| 353 |
+
# A.2 EXTENSION OF PROPOSITION 1 FOR THE DNN CLASSIFIER
|
| 354 |
+
|
| 355 |
+
Consider a binary classification DNN model with ReLU activation function $p ( y = 1 | x ; \theta ) ~ =$ $( 1 + \exp ( - g ( x ; \theta ) ) ) ^ { - 1 }$ parameterized by $\theta$ . Since $g ( x ; \theta )$ is piecewise linear, we can write $g ( \cdot ; \theta )$ as
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
g ( \cdot ; \theta ) = \sum _ { j = 1 } ^ { N } \mathbb { I } ( \cdot \in \mathcal { A } _ { j } ) \cdot ( w _ { j } x + b _ { j } ) ,
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
where $A _ { j }$ is a linear region and $N$ is the number of linear regions.
|
| 362 |
+
|
| 363 |
+
For given $x$ , suppose $g ( x ; \theta ) > 0$ . If $g ( x : \theta )$ is estimated reasonably, we expect that $g ( x ; \theta )$ is decreasing if $x$ moves toward the decision boundary. A formal statement of this expectation would be that $x - r \nabla _ { x } g ( x ; \theta )$ can arrive at the decision boundary for a finite value of $r > 0$ , where $\nabla _ { x }$ is the gradient with respect to $x$ . Of course, for $x$ with $g ( x ; \theta ) < 0$ , we expect that $x + r \nabla _ { x } g ( x ; \theta )$ can arrive at the decision boundary for a finite value of $r > 0$ . We say that $x$ is normal if there is $r > 0$ such that $x - r \nabla _ { x } g ( x : \theta ) \mathrm { s i g n } \{ g ( x : \theta ) \}$ locates at the decision boundary. We say that a linear region $A _ { j }$ is normal if all $x$ in $A _ { j }$ are normal. We expect that most of $A _ { j }$ are normal if $g ( x ; \theta )$ is reasonably estimated so that the probability decreases or increases depending on $\operatorname { s i g n } \{ g ( x : \theta ) \}$ if $x$ is getting closer to the decision boundary.
|
| 364 |
+
|
| 365 |
+
The following proposition proves that the adversarial direction is toward the decision boundary for all xs in normal linear regions.
|
| 366 |
+
|
| 367 |
+
Proposition 3 If a linear region $A _ { j }$ is normal. Then for any $x \in i n t ( \mathcal { A } _ { j } )$ , there exists $\epsilon > 0$ and $\delta > 0$ such that $x _ { b a d } = x + \delta r _ { a d \nu r } ( x , \epsilon ) / | | r _ { a d \nu r } ( x , \epsilon ) | |$ is on the decision boundary.
|
| 368 |
+
|
| 369 |
+
Proof. Take $\tilde { \epsilon } > 0$ such that $\boldsymbol { x } + \boldsymbol { r } \in \mathcal { A } _ { \tilde { \boldsymbol { j } } }$ for $\forall r \in B ( x , \tilde { \epsilon } )$ . Then by Proposition 1, there exists $0 < \epsilon ^ { * } < \tilde { \epsilon }$ such that for $\forall 0 < \epsilon < \epsilon ^ { * }$ ,
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r c l } { r _ { \mathrm { a d v r } } ( \boldsymbol { x } , \epsilon ) } & { = } & { \epsilon \cdot \mathrm { s i g n } ( - b _ { \tilde { j } } - w _ { \tilde { j } } ^ { ' } x ) ) \cdot \frac { w _ { \tilde { j } } } { | | w _ { \tilde { j } } | | } } \\ & { \propto } & { - \nabla _ { x } g ( x ; \theta ) \mathrm { s i g n } \{ g ( x : \theta ) \} . } \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
$x$ is normal, thus there exists $\delta > 0$ such that $x _ { \mathrm { b a d } } = x + \delta r _ { \mathrm { a d v r } } ( x , \epsilon ) / | | r _ { \mathrm { a d v r } } ( x , \epsilon ) | |$ belongs to the decision boundary.
|
| 376 |
+
|
| 377 |
+
# A.3 PROOF OF PROPOSITION 2
|
| 378 |
+
|
| 379 |
+
It suffices to show that $\forall x , x ^ { ' } \in \mathcal { U } _ { k } ^ { t r } , f ( x ) = f ( x ^ { ' } )$ for all $k = 1 , . . . , K$ . For given $\mathcal { U } _ { k } ^ { t r }$ , there exists $( \tilde { x } , \tilde { y } ) \in \mathcal { L } ^ { t r }$ such that $d ( \{ \tilde { x } \} , \mathcal { U } _ { k } ^ { t r } ) < \epsilon$ . So ${ \mathcal { U } } _ { k } ^ { t r } \cup \{ { \tilde { x } } \}$ is $\epsilon$ -connected. That is, for any $x \in \mathcal { U } _ { k } ^ { t r }$ , there exists a path $( \tilde { x } , x _ { 1 } , . . . , x _ { q } , x )$ such that $( \tilde { x } , x _ { 1 } ) , . . . , ( x _ { q } , x )$ are all $\epsilon$ -connected. Therefore $y ( x ) = y ( \tilde { x } ) = \tilde { y }$ for $\forall x \in \mathcal { U } _ { k } ^ { t r }$ , and the proof is done.
|
| 380 |
+
|
| 381 |
+
A.4 FIGURE
|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
Figure 7: Trace plot of the test accuracies with the four methods for MNIST dataset. 20 randomly sampled data are used as the labeled data and the rest are used as the unlabeled data.
|
md/train/H1rRWl-Cb/H1rRWl-Cb.md
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN INFORMATION-THEORETIC ANALYSIS OF DEEP LATENT-VARIABLE MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present an information-theoretic framework for understanding trade-offs in unsupervised learning of deep latent-variables models using variational inference. This framework emphasizes the need to consider latent-variable models along two dimensions: the ability to reconstruct inputs (distortion) and the communication cost (rate). We derive the optimal frontier of generative models in the two-dimensional rate-distortion plane, and show how the standard evidence lower bound objective is insufficient to select between points along this frontier. However, by performing targeted optimization to learn generative models with different rates, we are able to learn many models that can achieve similar generative performance but make vastly different trade-offs in terms of the usage of the latent variable. Through experiments on MNIST and Omniglot with a variety of architectures, we show how our framework sheds light on many recent proposed extensions to the variational autoencoder family.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has led to tremendous advances in supervised learning (Szegedy et al., 2017; Huang et al., 2017; Vaswani et al., 2017); however, unsupervised learning remains a challenging area. Recent advances in variational inference (VI) (Kingma & Welling, 2014; Rezende et al., 2014), have led to an explosion of research in the area of deep latent-variable models and breakthroughs in our ability to model natural high-dimensional data. This class of models typically optimize a lower bound on the log-likelihood of the data known as the evidence lower bound (ELBO), and leverage the “reparameterization trick” to make large-scale training feasible.
|
| 12 |
+
|
| 13 |
+
However, a number of papers have observed that VAEs trained with powerful decoders can learn to ignore the latent variables (Chen et al., 2017; Tomczak & Welling, 2017; Bowman et al., 2016). We demonstrate this empirically and explain the issue theoretically by deriving the ELBO in terms of the mutual information between $X$ , the data, and $Z$ , the latent variables. Having done so, we show that the previously-described $\beta$ -VAE objective (Higgins et al., 2017) has a theoretical justification in terms of a Legendre-transformation of a constrained optimization of the mutual information. This leads to the core point of this paper, which is that the optimal rate of information in a model is taskdependent, and optimizing the ELBO directly makes the selection of that rate purely a function of architectural choices, whereas by using $\beta$ -VAE or other constrained optimization objectives, practitioners can learn models with optimal rates for their particular task without having to do extensive architectural search.
|
| 14 |
+
|
| 15 |
+
Mutual information provides a reparameterization-independent measure of dependence between two random variables. Computing mutual information exactly in high dimensions is problematic (Paninski, 2003; Gao et al., 2017), so we turn to recently developed tools in variational inference to approximate it. We find that a natural lower and upper bound on the mutual information between the input and latent variable can be simply related to the ELBO, and understood in terms of two terms: (1) a lower bound that depends on the distortion, or how well an input can be reconstructed through the encoder and decoder, and (2) an upper bound that measures the rate, or how much information is retained about the input. Together these terms provide a unifying perspective on the set of optimal models given a dataset, and show that there exists a continuum of models that make very different trade-offs in terms of rate and distortion.
|
| 16 |
+
|
| 17 |
+
By leveraging additional information about the amount of information contained in the latent variable, we show that we can recover the ground-truth generative model used to create the data in a toy model. We perform extensive experiments on MNIST and Omniglot using a variety of encoder, decoder, and prior architectures and demonstrate how our framework provides a simple and intuitive mechanism for understanding the trade-offs made by these models. We further show that we can control this tradeoff directly by optimizing the $\beta$ -VAE objective, rather than the ELBO. By varying $\beta$ , we can learn many models with the same architecture and comparable generative performance (in terms of marginal data log likelihood), but that exhibit qualitatively different behavior in terms of the usage of the latent variable and variability of the decoder.
|
| 18 |
+
|
| 19 |
+
# 2 FRAMEWORK
|
| 20 |
+
|
| 21 |
+
Unsupervised Representation Learning Depending on the task, there are many desiderata for a good representation. Here we focus on one aspect of a learned representation: the amount of information that the latent variable contains about the input. In the absence of additional knowledge of a “downstream” task, we focus on the ability to recover or reconstruct the input from the representation. Given a set of samples from a true data distribution $p ^ { * } ( x )$ , our goal is to learn a representation that contains a particular amount of information and from which the input can be reconstructed as well as possible.
|
| 22 |
+
|
| 23 |
+
We will convert each observed data vector $x$ into a latent representation $z$ using any stochastic encoder $e ( z | x )$ of our choosing. This then induces the joint distribution $p _ { e } ( x , z ) \bar { } = \bar { p } ^ { * } ( x ) e ( z | x )$ and the corresponding marginal $\begin{array} { r } { p _ { e } ( z ) = \int d x p ^ { * } ( x ) e ( z | \bar { x } ) } \end{array}$ (the “aggregated posterior” in Makhzani et al. (2016); Tomczak $\&$ Welling (2017)) and conditional $p _ { e } ( x | z ) \bar { = } p _ { e } ( x , \bar { z } ) / p _ { e } ( z )$ .
|
| 24 |
+
|
| 25 |
+
A good representation $Z$ must contain information about the input $X$ which we define as follows:
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\mathrm { I _ { r e p } } ( X ; Z ) = \iint d x d z p _ { e } ( x , z ) \log \frac { p _ { e } ( x , z ) } { p ^ { * } ( x ) p _ { e } ( z ) } .
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
We will call this the representational mutual information, to distinguish it from the generative mutual information we discuss in Appendix C. Equation 1 is hard to compute, since we do not have access to the true data density $p ^ { * } ( x )$ , and computing the marginal $\begin{array} { r } { p _ { e } ( \dot { z } ) = \int d x p _ { e } ( x , z ) } \end{array}$ can be challenging. As demonstrated in Barber $\&$ Agakov (2003); Agakov (2006); Alemi et al. (2017) there exist useful, tractable variational bounds on mutual information. The detailed derivation for this case is included in Appendices B.1 and B.2 for completeness. These yield the following lower and upper bounds:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { d ( x | z ) } { p ^ { * } ( x ) } \leq \mathrm { I } _ { \mathrm { r e p } } ( X ; Z ) \leq \underbrace { \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { m ( z ) } } _ { \qquad }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $d ( x | z )$ (the “decoder”) is a variational approximation to $p _ { e } ( x | z )$ , $m ( z )$ (the “marginal”) i a variational approximation to $p _ { e } ( z )$ , and all the integrals can be approximated using Monte Carl given a finite sample of data from $p ^ { * } ( x )$ , as we discuss below.
|
| 38 |
+
|
| 39 |
+
In connection with rate-distortion theory, we can interpret the upper bound as the rate $R$ of our representation (Tishby & Zaslavsky, 2015). This rate term measures the average number of additional nats necessary to encode samples from the encoder using an entropic code constructed from the marginal, being an average KL divergence. Unlike most rate-distortion work (Cover $\&$ Thomas, 2012), where the marginal is assumed a fixed property of the channel, here the marginal is a completely general distribution, which we assume is learnable. Similarly, we can interpret the lower bound as the data entropy $H$ , which measures the complexity of the dataset (a fixed but unknown constant), minus the distortion $D$ , which measures our ability to accurately reconstruct samples:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\underbrace { \left( - \int d x p ^ { * } ( x ) \log p ^ { * } ( x ) \right) } _ { \mathrm { d a t a } \ : \mathrm { e n t r o p y } ( H ) } - \underbrace { \left( - \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log d ( x | z ) \right) } _ { \mathrm { d i s t o r i o n } ( D ) } \le \mathrm { I } _ { \mathrm { r e p } } \ .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
This distortion term is defined in terms of an arbitrary decoding distribution $d ( x | z )$ , which we consider a learnable distribution. This contrasts with most of the compression literature where distortion is typically measured using a fixed perceptual loss (Balle et al., 2017). Combining these equations, ´ we get the “sandwich equation” $H - D \leq \operatorname { I } _ { \mathrm { r e p } } \leq R$ . Notice that $\mathrm { E L B O } = - D - R$ .
|
| 46 |
+
|
| 47 |
+
Phase Diagram From the sandwich equation, we see that $H - D - R \leq 0$ . This is a bound that must hold for any set of four distributions $p ^ { * } ( x ) , e ( z | x ) , d ( x | z ) , m ( z )$ . The inequality places strict limits on which values of rate and distortion are achievable, and allows us to reason about all possible solutions in a two dimensional $R D$ -plane. A sketch of this phase diagram is shown in Figure 1.
|
| 48 |
+
|
| 49 |
+
First, we consider the data entropy term. For discrete data1, all probabilities in $X$ are bounded above by one and both the data entropy and distortion are non-negative $( H \ge 0 , D \ge 0 )$ . The rate is also non-negative $R \geq 0 )$ , because it is an average KL divergence, for either continuous or discrete $Z$ . The positivity constraints and the sandwich equation separate the $R D$ -plane into feasible and infeasible regions, visualized in Figure 1. The boundary between these regions is a convex curve (thick black line). Even given complete freedom in specifying the encoder ${ \dot { \mathbf { \rho } } } _ { e } ( z | x )$ , decoder $d ( x | z )$ and marginal approximation $m ( z )$ , and infinite data, we can never cross this bounding line.
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: Schematic representation of the phase diagram in the $R D$ -plane. The distortion $( D )$ axis measures the reconstruction error of the samples in the training set. The rate $( R )$ axis measures the relative KL divergence between the encoder and our own marginal approximation. The thick black lines denote the feasible boundary in the infinite model capacity limit.
|
| 53 |
+
|
| 54 |
+
We now explain qualitatively what the different areas of this diagram correspond to. For simplicity, we will consider the infinite model family limit, where we have complete freedom in specifying $e ( z | x ) , d ( x | z )$ and $m ( z )$ but consider the data distribution $p ^ { * } ( x )$ fixed.
|
| 55 |
+
|
| 56 |
+
The bottom horizontal line corresponds to the zero distortion setting, which implies that we can perfectly encode and decode our data; we call this the auto-encoding limit. The lowest possible rate is given by $H$ , the entropy of the data. This corresponds to the point $\mathit { \Omega } ^ { \prime } R = H , D = 0 ,$ ). (In this case, our lower bound is tight, and hence $d ( x | z ) = p _ { e } ( x | z )$ .) We can obtain higher rates at fixed distortion by making the marginal approximation $m ( z )$ a weaker approximation to $p _ { e } ( z )$ , since only the rate and not the distortion depends on $m ( z )$ .
|
| 57 |
+
|
| 58 |
+
The left vertical line corresponds to the zero rate setting. Since $R = 0 \implies e ( z | x ) = m ( z )$ , we see that our encoding distribution $e ( z | x )$ must itself be independent of $x$ . Thus the latent representation is not encoding any information about the input and we have failed to create a useful learned representation. However, by using a suitably powerful decoder, $d ( x | z )$ , that is able to capture correlations between the components of $x$ (e.g., an autoregressive model, such as pixelCNN (Salimans et al., 2017), or an acausal MRF model, such as (Dai et al., 2015)), we can still reduce the distortion to the lower bound of $H$ , thus achieving the point $( R = 0 , D = H )$ ; we call this the auto-decoding limit. Hence we see that we can do density estimation without learning a good representation, as we will verify empirically in Section 4. (Note that since $R$ is an upper bound on the mutual information, in the limit that $R = 0$ , the bound must be tight, which guarantees that $m ( z ) = p _ { e } ( z )$ .) We can achieve solutions further up on the $D$ -axis, while keeping the rate fixed, simply by making the decoder worse, since only the distortion and not the rate depends on $d ( x | z )$ .
|
| 59 |
+
|
| 60 |
+
Finally, we discuss solutions along the diagonal line. Such points satisfy $D = H - R$ , and hence both of our bounds are tight, so $m ( z ) = p _ { e } ( z )$ and $d ( x | z ) = p _ { e } ( x | z )$ . (Proofs of these claims are given in Sections B.3 and B.4 respectively.)
|
| 61 |
+
|
| 62 |
+
So far, we have considered the infinite model family limit. If we have only finite parametric families for each of $d ( x | z ) , m ( z ) , e ( z | x )$ , we expect in general that our bounds will not be tight. Any failure of the approximate marginal $m ( z )$ to model the true marginal $p _ { e } ( z )$ , or the decoder $d ( x | z )$ to model the true likelihood $p _ { e } ( x | z )$ , will lead to a gap with respect to the optimal black surface. However, it will still be the case that ${ \dot { H } } - D - R \leq 0$ . This suggests that there will still be a one dimensional optimal surface, $D ( R )$ , or $R ( D )$ where optimality is defined to be the tightest achievable sandwiched bound within the parametric family. We will use the term $R D$ curve to refer to this optimal surface in the rate-distortion $( R D )$ plane. Since the data entropy $H$ is outside our control, this surface can be found by means of constrained optimization, either minimizing the distortion at some fixed rate, or minimizing the rate at some fixed distortion, as we show below. Furthermore, by the same arguments as above, this surface should be monotonic in both $R$ and $D$ , since for any solution, with only very mild assumptions on the form of the parametric families, we should always be able to make $m ( z )$ less accurate in order to increase the rate at fixed distortion (see shift from red curve to blue curve in fig. 1), or make the decoder $d ( x | z )$ less accurate to increase the distortion at fixed rate (see shift from red curve to green curve in fig. 1).
|
| 63 |
+
|
| 64 |
+
Optimization In this section, we discuss how we can find models that target a given point on the $R D$ curve. Recall that the rate $R$ and distortion $D$ are given by
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { l } { { R \equiv \displaystyle \int d x p ^ { \ast } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { m ( z ) } } } \\ { { { \cal D } \equiv \displaystyle - \int d x p ^ { \ast } ( x ) \int d z e ( z | x ) \log d ( x | z ) } } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
These can both be approximated using a Monte Carlo sample from our training set. We also require that the terms $\log d ( x | z )$ , $\log m ( z )$ and $\log e ( z | x )$ be efficient to compute, and that $e ( z | x )$ be efficient to sample from. In Section 4, we will describe the modeling choices we made for our experiments.
|
| 71 |
+
|
| 72 |
+
In order to explore the qualitatively different optimal solutions along the frontier, we need to explore different rate-distortion trade-offs. One way to do this would be to perform some form of constrained optimization at fixed rate. Alternatively, instead of considering the rate as fixed, and tracing out the optimal distortion as a function of the rate $D ( R )$ , we can perform the Legendre transformation and can find the optimal rate and distortion for a fixed $\begin{array} { r } { \beta = \frac { \partial D } { \partial R } } \end{array}$ , by minimizing $\begin{array} { r l } { \operatorname* { m i n } _ { e ( z | x ) , m ( z ) , d ( x | z ) } D + } \end{array}$ $\beta R$ . Writing this objective out in full, we get
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\operatorname* { m i n } _ { e ( z | x ) , m ( z ) , d ( x | z ) } \int d x p ^ { * } ( x ) \int d z e ( z | x ) \left[ - \log d ( x | z ) + \beta \log \frac { e ( z | x ) } { m ( z ) } \right] .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
If we set $\beta = 1$ , this matches the ELBO objective used when training a VAE (Kingma & Welling, 2014), with the distortion term matching the reconstruction loss, and the rate term matching the “KL term”. Note, however, that this objective does not distinguish between any of the points along the diagonal of the optimal $R D$ curve, all of which have $\beta = 1$ and the same ELBO. Thus the ELBO objective alone (and the marginal likelihood) cannot distinguish between models that make no use of the latent variable (autodecoders) versus models that make large use of the latent variable and learn useful representations for reconstruction (autoencoders). This is demonstrated experimentally in Section 4.
|
| 79 |
+
|
| 80 |
+
If we allow a general $\beta \geq 0$ , we get the $\beta$ -VAE objective used in (Higgins et al., 2017; Alemi et al., 2017). This allows us to smoothly interpolate between auto-encoding behavior ( $\beta = 0$ ), where the distortion is low but the rate is high, to auto-decoding behavior $\beta = \infty$ ), where the distortion is high but the rate is low, all without having to change the model architecture. However, unlike Higgins et al. (2017); Alemi et al. (2017), we additionally optimize over the marginal $m ( z )$ and compare across a variety of architectures, thus exploring a much larger solution space, which we illustrate empirically in Section 4.
|
| 81 |
+
|
| 82 |
+
# 3 RELATED WORK
|
| 83 |
+
|
| 84 |
+
Here we present an overview of the most closely related work. A more detailed treatment can be found in Appendix D.
|
| 85 |
+
|
| 86 |
+
Model families for unsupervised learning with neural networks. There are two broad areas of active research in deep latent-variable models with neural networks: methods based on the variational autoencoder (VAE), introduced by Kingma & Welling (2014); Rezende et al. (2014), and methods based on generative adversarial networks (GANs), introduced by Goodfellow et al. (2014). In this paper, we focus on the VAE family of models. In particular, we consider recent variants using inverse autoregressive flow (IAF) (Kingma et al., 2016), masked autoregressive flow (MAF) (Papamakarios et al., 2017), PixelCNN $^ { + + }$ (Salimans et al., 2017), and the VampPrior (Tomczak & Welling, 2017), as well as common Conv/Deconv encoders and decoders.
|
| 87 |
+
|
| 88 |
+
Information Theory and machine learning. Barber & Agakov (2003) was the first to introduce tractable variational bounds on mutual information, and made close analogies and comparisons to maximum likelihood learning and variational autoencoders. The information bottleneck framework (Tishby et al., 1999; Shamir et al., 2010; Tishby & Zaslavsky, 2015; Alemi et al., 2017; Achille & Soatto, 2016; 2017) allows a model to smoothly trade off the minimality of the learned representation $( Z )$ from data $( X )$ by minimizing their mutual information, $I ( X ; Z )$ , against the informativeness of the representation for the task at hand $( Y )$ by maximizing their mutual information, $I ( Z ; Y )$ . This constrained optimization problem is rephrased with the Lagrange multiplier, $\beta$ , to the unconstrained optimization of $I ( X ; Z ) - \beta I ( Z ; Y )$ . Tishby & Zaslavsky (2015) plot an RD curve similar to the one in this paper, but they only consider the supervised setting, and they do not consider the information content that is implicit in powerful stochastic decoders. Higgins et al. (2017) proposed the $\beta$ -VAE for unsupervised learning, which is a generalization of the original VAE in which the KL term is scaled by $\beta$ , similar to this paper. However, they only considered $\beta > 1$ . In this paper, we show that when using powerful autoregressive decoders, using $\beta \geq 1$ results in the model ignoring the latent code, so it is necessary to use $\beta < 1$ .
|
| 89 |
+
|
| 90 |
+
Generative Models and Compression. Much recent work has explored the use of latent-variable generative models for image compression. Balle et al. (2017) studies the problem explicitly in terms ´ of the rate/distortion plane, adjusting a Lagrange multiplier on the distortion term to explore the convex hull of a model’s optimal performance. Johnston et al. (2017) uses a recurrent VAE architecture to achieve state-of-the-art image compression rates, posing the loss as minimizing distortion at a fixed rate. Theis et al. (2017) writes the VAE loss as $R + \beta D$ . Rippel & Bourdev (2017) shows that a GAN optimization procedure can also be applied to the problem of compression. All of these efforts focus on rate/distortion tradeoffs for individual models, but don’t explore how the selection of the model itself affects the rate/distortion curve. Because we explore many combinations of modeling choices, we are able to more deeply understand how model selection impacts the rate/distortion curve, and to point out the area where all current models are lacking – the auto-encoding limit. Generative compression models also have to work with both quantized latent spaces and approximately fixed decoder model families trained with perceptual losses such as MS-SSIM (Wang et al., 2003), which constrain the form of the learned distribution. Our work does not assume either of these constraints are present for the tasks of interest.
|
| 91 |
+
|
| 92 |
+
# 4 EXPERIMENTS
|
| 93 |
+
|
| 94 |
+
Toy Model In this section, we empirically show a case where the usual ELBO objective can learn a model which perfectly captures the true data distribution, $p ^ { * } ( x )$ , but which fails to learn a useful latent representation. However, by training the same model such that we minimize the distortion, subject to achieving a desired target rate $R ^ { * }$ , we can recover a latent representation that closely matches the true generative process (up to a reparameterization), while also perfectly capturing the true data distribution.
|
| 95 |
+
|
| 96 |
+
We create a simple data generating process that consists of a true latent variable $Z ^ { * } = \{ z _ { 0 } , z _ { 1 } \} \sim$ $\mathrm { B e r } ( 0 . 7 )$ with added Gaussian noise and discretization. The magnitude of the noise was chosen so that the true generative model had $\operatorname { I } ( x ; z ^ { * } ) = 0 . 5$ nats of mutual information between the observations and the latent. We additionally choose a model family with sufficient power to perfectly autoencode or autodecode. See Appendix $\mathrm { E }$ for more detail on the data generation and model.
|
| 97 |
+
|
| 98 |
+
Figure 2 shows various distributions computed using three models. For the left column, we use a hand-engineered encoder $e ( z | x )$ , decoder $d ( x | z )$ , and marginal $m ( z )$ constructed with knowledge of the true data generating mechanism to illustrate an optimal model. For the middle and right columns, we learn $e ( z | x ) , d ( x | z )$ , and $m ( z )$ using effectively infinite data sampled from $p ^ { * } ( x )$ directly. The middle column is trained with ELBO. The right column is trained by targeting $R = 0 . 5$ while minimizing $D$ .2 In both cases, we see that $p ^ { * } ( x ) \approx g ( x ) \approx d ( x )$ for both trained models, indicating that optimization found the global optimum of the respective objectives. However, the VAE fails to learn a useful representation, only yielding a rate of $R = 0 . 0 0 0 2$ nats,3 while the Target Rate model achieves $R = 0 . 4 9 9 9$ nats. Additionally, it nearly perfectly reproduces the true generative process, as can be seen by comparing the yellow and purple regions in the z-space plots (middle row) – both the optimal model and the Target Rate model have two clusters, one with about $70 \%$ of the probability mass, corresponding to class 0 (purple shaded region), and the other with about $30 \%$ of the mass (yellow shaded region) corresponding to class 1. In contrast, the z-space of the VAE completely mixes the yellow and purple regions, only learning a single cluster. Note that we reproduced essentially identical results with dozens of different random initializations for both the VAE and the Target Rate model – these results are not cherry-picked.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: Toy Model illustrating the difference between fitting a model by maximizing ELBO (middle column) vs minimizing distortion for a fixed rate (right column). Top: Three distributions in data space: the true data distribution, $\boldsymbol { p } ^ { * } ( \boldsymbol { x } )$ , the model’s generative distribution, $\begin{array} { r } { g ( x ) { \stackrel { - } { = } } \sum _ { z } m ( z ) d ( x | z ) } \end{array}$ , and the empirical data reconstruction distribution, $\begin{array} { r } { d ( x ) = \bar { \sum _ { x ^ { \prime } } \sum _ { z } \hat { p } ( x ^ { \prime } ) e ( z | x ^ { \prime } ) \bar { d ( } \hat { x | z } ) } } \end{array}$ . Middle: Four distributions in latent space: the learned (or computed) marginal $m ( z )$ , the empirical induced marginal $\begin{array} { r } { e ( z ) = \sum _ { x } \hat { p } ( x ) e ( z | x ) } \end{array}$ , the empirical distribution over $z$ values for data vectors in the set $\mathcal { X } _ { 0 } = \{ x _ { n } : z _ { n } = 0 \}$ , which we denote by $e ( z _ { 0 } )$ in purple, and the empirical distribution over $z$ values for data vectors in the set $\mathcal { X } _ { 1 } = \{ x _ { n } : z _ { n } = 1 \}$ , which we denote by $e ( z _ { 1 } )$ in yellow. Bottom: Three $K \times K$ distributions: $e ( z | x ) , d ( x | z )$ and $\begin{array} { r } { \dot { p } ( x ^ { \prime } | x ) = \dot { \sum _ { z } } e ( z | x ) d ( x ^ { \prime } | z ) } \end{array}$ .
|
| 102 |
+
|
| 103 |
+
MNIST. In this section, we show how comparing models in terms of rate and distortion separately is more useful than simply observing marginal log likelihoods. We examine several VAE model architectures that have been proposed in the literature. We use the static binary MNIST dataset originally produced for (Larochelle & Murray, 2011)4. In appendix A, we show analogous results for the Omniglot dataset (Lake et al., 2015).
|
| 104 |
+
|
| 105 |
+
We will consider simple and complex variants for the encoder and decoder, and three different types of marginal. The simple encoder is a CNN with a fully factored 64 dimensional Gaussian for $e ( z | x )$ ; the more complex encoder is similar, but followed by 4 steps of mean-only Gaussian inverse autoregressive flow (Kingma et al., 2016), with each step implemented as a 3 hidden layer MADE (Germain et al., 2015) with 640 units in each hidden layer. The simple decoder is a multilayer deconvolutional network; the more powerful decoder is a PixelCNN $^ { + + }$ (Salimans et al., 2017) model. The simple marginal is a fixed isotropic Gaussian, as is commonly used with VAEs; the more complicated version has a 4 step 3 layer MADE (Germain et al., 2015) mean-only Gaussian autoregressive flow (Papamakarios et al., 2017). We also consider the setting in which the marginal uses the VampPrior from (Tomczak & Welling, 2017). We will denote the particular model combination by the tuple $( + / - , + / - , + / - / v )$ , depending on whether we use a simple $( - )$ or complex $( + )$ (or $( v )$ VampPrior) version for the (encoder, decoder, marginal) respectively. In total we consider $2 \times 2 \times 3 = 1 2$ models. We train them all to minimize the objective in Equation 4. Full details can be found in Appendix F. Runs were performed at various values of $\beta$ ranging from 0.1 to 10.0, both with and without KL annealing (Bowman et al., 2016).
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3: Results on MNIST. (a) The best achieved rate distortion value for each run plotted on the $R D$ - plane. We denote the particular model combination by the tuple $( + / - , + / - , + / - / v )$ , depending on whether we use a simple $( - )$ or complex $( + )$ (or $( v )$ VampPrior) version for the (encoder, decoder, marginal) respectively. (b) The same data, but on the skew axes of $\mathrm { E L B O } = R + D$ versus $R$ .
|
| 109 |
+
|
| 110 |
+
RD curve. Figure 3a show the $R D$ plot for 12 models on the MNIST dataset. Dashed lines represent the best achieved test ELBO of 80.2 nats, which then sets an upper bound on the true data entropy $H$ for the static MNIST dataset. This implies that any $R D$ value above the dashed line is in principle achievable in a powerful enough model. The stepwise black curves show the monotonic Pareto frontier of achieved $R D$ points across all model families. Points participating in this curve are denoted with a $\times$ on the right. The grey solid line shows the corresponding convex hull, which we approach closely across all rates. Strong decoder model families dominate at the lowest and highest rates. Weak decoder models dominate at intermediate rates. Strong marginal models dominate strong encoder models at most rates. Across our model families we appear to be pushing up against an approximately smooth $R D$ curve. The 12 model families we considered here, arguably a representation of the classes of models considered in the VAE literature, in general perform much worse in the auto-encoding limit (bottom right corner) of the $R D$ plane. This is likely due to a lack of power in our current marginal approximations.
|
| 111 |
+
|
| 112 |
+
Figure 3b shows the same raw data, but where we plot $\scriptstyle \mathrm { E L B O } = R + D$ versus $R$ . Here some of the differences between individual model families performances are more easily resolved. Broadly, models with a deconvolutional decoder perform well at intermediate $\sim 2 2$ nat rates, but quickly suffer large distortion penalties as they move away from that point. This is perhaps unsurprising considering we trained on the binary MNIST dataset, for which the measured pixel level sampling entropy on the test set is approximately 22 nats.
|
| 113 |
+
|
| 114 |
+
Models with a powerful autoregressive decoder perform well at low rates, but for values of $\beta \geq 1$ tend to collapse to pure autodecoding models. With the use of the VampPrior and KL annealing however, $\beta = 1$ models can exist at finite rates of around 8 nats. Our framework helps explain the observed difficulties in the literature of training a useful VAE with a powerful decoder, and the observed utility of techniques like “free bits” (Kingma et al., 2016), “soft free bits” (Chen et al., 2017) and $\mathrm { K L }$ annealing (Bowman et al., 2016). Each of these effectively trains at a reduced $\beta$ , moving up along the $R D$ curve. Without any additional modifications, simply training at reduced $\beta$ is a simpler way to achieve nonvanishing rates, without additional architectual adjustments like in the variational lossy autoencoder (Chen et al., 2017).
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 4: We can smoothly move between pure autodecoding and autoencoding behavior in a single model family by tuning $\beta$ . (a) Sampled reconstructions from the $\mathbf { - + v }$ model family trained at given $\beta$ values. Pairs of columns show a single reconstruction and the mean of 5 reconstructions. The first column shows the input samples. (b) Generated images from the same set of models. The pairs of columns are single samples and the mean of 5 samples. See text for discussion.
|
| 118 |
+
|
| 119 |
+
Analyzing model performance using the $R D$ curve gives a much more insightful comparison of relative model performance than simply comparing marginal data log likelihoods. In particular, we managed to achieve models with five-sample IWAE (Burda et al., 2015) estimates below 82 nats (a competitive rate for single layer latent variable models (Tomczak & Welling, 2017)) for rates spanning from $1 0 ^ { - 4 }$ to 30 nats. While all of those models have competitive ELBOs or marginal log likelihood, they differ substantially in the tradeoffs they make between rate and distortion, and those differences result in qualitatively different model behavior, as illustrated in Figure 4.
|
| 120 |
+
|
| 121 |
+
The interaction between latent variables and powerful decoders. Within any particular model family, we can smoothly move between and explore its performance at varying rates. An illustrative example is shown in Fig. 4, where we study the effect of changing $\beta$ (using KL annealing from low to high) on the same $\mathbf { - } + \mathbf { V }$ model, corresponding to a VAE with a simple encoder, a powerful PixelCNN++ decoder, and a powerful VampPrior marginal.
|
| 122 |
+
|
| 123 |
+
In Fig. 4a we assess how well the models do at reconstructing their inputs. We pick an image $x$ at random, encode it using $z \sim e ( z | x )$ , and then reconstruct it using $\hat { x } \sim d ( x \bar { | } z )$ . When $\beta =$ 1.10 (left column), the model obtains $R = 0 . 0 0 0 4 , D = 8 0 . 6 , { \mathrm { E L B O } } = 8 0 . 6$ nats. The tiny rate indicates that the decoder ignores its latent code, and hence the reconstructions are independent of the input $x$ . For example, when the input is $x \ = \ 8$ , the reconstruction is $\hat { x } = 3$ . However, the generated images sampled from the decoder look good (this is an example of an autodecoder). At the other extreme, when $\beta \ : = \ : 0 . 0 5$ (right column), the model obtains $R = 1 5 6 , D = 4 . 8$ , $\mathrm { E L B O } { = } 1 6 1$ nats. Here the model does an excellent job of auto-encoding, generating nearly pixel perfect reconstructions. However, samples from this model’s prior, as shown on the right, are of very poor quality, reflected in the worse ELBO and IWAE values. At intermediate values, such as $\beta = 1 . 0$ , $( R = 6 . 2 , D = 7 4 . 1$ , $\mathrm { E L B O } { = } 8 0 . 3$ ) the model seems to retain semantically meaningful information about the input, such as its class and width of the strokes, but maintains variation in the individual reconstructions. In particular, notice that the individual $" 2 "$ sent in is reconstructed as a similar “2” but with a visible loop at the bottom. This model also has very good generated samples. This intermediate rate encoding arguably typifies what we want to achieve in unsupervised learning: we have learned a highly compressed representation that retains salient features of the data. In the third column, the $\beta \ : = \ : 0 . 1 5$ model $( R = 1 2 0 . 3 , D = 8 . 1$ , $\mathrm { E L B O } { = } 1 2 8$ ) we have very good reconstructions Figure 4b one can visually inspect while still obtaining a good degree of compression. This model arguably typifies the domain most compression work is interested in, where most perceivable variations in the digit are retained in the compression. However, at these higher rates the failures of our current architectures to approach their theoretical performance becomes more apparent, as the corresponding ELBO of 128 nats is much higher than the 81 nats we obtain at low rates. This is also evident in the visual degradation in the generated samples.
|
| 124 |
+
|
| 125 |
+
While it is popular to visualize both the reconstructions and generated samples from VAEs, we suggest researchers visually compare several sampled decodings using the same sample of the latent variable, whether it be from the encoder or the prior, as done here in Figure 4. By using a single sample of the latent variable, but decoding it multiple times, one can visually inspect what features of the input are captured in the observed value for the rate. This is particularly important to do when using powerful decoders, such as autoregressive models.
|
| 126 |
+
|
| 127 |
+
# 5 DISCUSSION AND FURTHER WORK
|
| 128 |
+
|
| 129 |
+
We have motivated the $\beta$ -VAE objective on information theoretic grounds, and demonstrated that comparing model architectures in terms of the rate-distortion plot offers a much better look at their performance and tradeoffs than simply comparing their marginal log likelihoods. Additionally, we have shown a simple way to fix models that ignore the latent space due to the use of a powerful decoder: simply reduce $\beta$ and retrain. This fix is much easier to implement than other solutions that have been proposed in the literature, and comes with a clear theoretical justification. We strongly encourage future work to report rate and distortion values independently, rather than just reporting the log likelihood. If future work proposes new architectural regularization techniques, we suggest the authors train their objective at various rate distortion tradeoffs to demonstrate and quantify the region of the RD plane where their method dominates.
|
| 130 |
+
|
| 131 |
+
Through a large set of experiments we have demonstrated the performance at various rates and distortion tradeoffs for a set of representative architectures currently under study, confirming the power of autoregressive decoders, especially at low rates. We have also shown that current approaches seem to have a hard time achieving high rates at low distortion. This suggests a set of experiments with a simple encoder / decoder pair but a powerful autoregressive marginal posterior approximation, which should in principle be able to reach the autoencoding limit, with vanishing distortion and rates approaching the data entropy.
|
| 132 |
+
|
| 133 |
+
Interpreting the $\beta$ -VAE objective as a constrained optimization problem also hints at the possibility of applying more powerful constrained optimization techniques, which we hope will be able to advance the state of the art in unsupervised representation learning.
|
| 134 |
+
|
| 135 |
+
# REFERENCES
|
| 136 |
+
|
| 137 |
+
A. Achille and S. Soatto. Information Dropout: Learning Optimal Representations Through Noisy Computation. In Information Control and Learning, September 2016. URL http://arxiv. org/abs/1611.01353.
|
| 138 |
+
A. Achille and S. Soatto. Emergence of Invariance and Disentangling in Deep Representations. Proceedings of the ICML Workshop on Principled Approaches to Deep Learning, 2017. URL https://arxiv.org/abs/1706.01350.
|
| 139 |
+
Felix Vsevolodovich Agakov. Variational Information Maximization in Stochastic Environments. PhD thesis, University of Edinburgh, 2006.
|
| 140 |
+
Alexander A Alemi, Ian Fischer, Joshua V Dillon, and Kevin Murphy. Deep Variational Information Bottleneck. In ICLR, 2017. URL http://arxiv.org/abs/1612.00410.
|
| 141 |
+
J. Balle, V. Laparra, and E. P. Simoncelli. End-to-end Optimized Image Compression. In ´ ICLR, 2017. URL http://arxiv.org/abs/1611.01704.
|
| 142 |
+
David Barber and Felix V. Agakov. Information maximization in noisy channels : A variational approach. In S. Thrun, L. K. Saul, and B. Scholkopf (eds.), ¨ Advances in Neural Information Processing Systems 16, pp. 201–208. MIT Press, 2003. URL http://papers.nips.cc/paper/ 2410-information-maximization-in-noisy-channels-a-variational-approach pdf.
|
| 143 |
+
|
| 144 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. CoNLL 2016, pp. 10, 2016. URL http://arxiv.org/abs/1511.06349.
|
| 145 |
+
|
| 146 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In ICLR, 2015. URL http://arxiv.org/abs/1509.00519.
|
| 147 |
+
|
| 148 |
+
X. Chen, D. P. Kingma, T. Salimans, Y. Duan, P. Dhariwal, J. Schulman, I. Sutskever, and P. Abbeel. Variational Lossy Autoencoder. In ICLR, 2017. URL https://arxiv.org/abs/1611. 02731.
|
| 149 |
+
|
| 150 |
+
Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012.
|
| 151 |
+
|
| 152 |
+
Jifeng Dai, Yang Lu, and Ying-Nian Wu. Generative modeling of convolutional neural networks. In ICLR, 2015. URL http://arxiv.org/abs/1412.6296.
|
| 153 |
+
|
| 154 |
+
Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 933–941, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/dauphin17a.html.
|
| 155 |
+
|
| 156 |
+
Weihao Gao, Sreeram Kannan, Sewoong Oh, and Pramod Viswanath. Estimating mutual information for discrete-continuous mixtures. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 5988–5999. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7180-estimating-mutual-information-for-discrete-continuous-mixtures. pdf.
|
| 157 |
+
|
| 158 |
+
Mathieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 881–889, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings. mlr.press/v37/germain15.html.
|
| 159 |
+
|
| 160 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014. URL http://papers. nips.cc/paper/5423-generative-adversarial-nets.pdf.
|
| 161 |
+
|
| 162 |
+
I. Higgins, L. Matthey, X. Glorot, A. Pal, B. Uria, C. Blundell, S. Mohamed, and A. Lerchner. Early Visual Concept Learning with Unsupervised Deep Learning. ArXiv e-prints, June 2016. URL https://arxiv.org/abs/1606.05579.
|
| 163 |
+
|
| 164 |
+
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 ICLR, 2017. URL https://openreview.net/pdf? id=Sy2fzU9gl.
|
| 165 |
+
|
| 166 |
+
Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the sixth annual conference on Computational learning theory, pp. 5–13. ACM, 1993.
|
| 167 |
+
|
| 168 |
+
Z. Hu, Z. Yang, R. Salakhutdinov, and E. P. Xing. On Unifying Deep Generative Models. ArXiv e-prints, June 2017. URL https://arxiv.org/abs/1706.00550.
|
| 169 |
+
|
| 170 |
+
Jonathan Huang, Vivek Rathod, Chen Sun, Menglong Zhu, Anoop Korattikara, Alireza Fathi, Ian Fischer, Zbigniew Wojna, Yang Song, Sergio Guadarrama, et al. Speed/accuracy trade-offs for modern convolutional object detectors. Conference on Computer Vision and Pattern Recognition, 2017.
|
| 171 |
+
|
| 172 |
+
N. Johnston, D. Vincent, D. Minnen, M. Covell, S. Singh, T. Chinen, S. J. Hwang, J. Shor, and G. Toderici. Improved Lossy Image Compression with Priming and Spatially Adaptive Bit Rates for Recurrent Networks. ArXiv e-prints, March 2017. URL https://arxiv.org/abs/ 1703.10114.
|
| 173 |
+
|
| 174 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. URL https://arxiv.org/abs/1412.6980.
|
| 175 |
+
|
| 176 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In ICLR, 2014. URL https://arxiv.org/abs/1312.6114.
|
| 177 |
+
|
| 178 |
+
Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4743–4751. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/ 6581-improved-variational-inference-with-inverse-autoregressive-flow. pdf.
|
| 179 |
+
|
| 180 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. ISSN 0036-8075. doi: 10.1126/science.aab3050. URL http://science.sciencemag.org/content/ 350/6266/1332.
|
| 181 |
+
|
| 182 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In Geoffrey Gordon, David Dunson, and Miroslav Dudk (eds.), Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pp. 29–37, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. URL http://proceedings.mlr.press/v15/larochelle11a.html.
|
| 183 |
+
|
| 184 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, and Ian Goodfellow. Adversarial autoencoders. In ICLR, 2016. URL http://arxiv.org/abs/1511.05644.
|
| 185 |
+
|
| 186 |
+
Aaron Van Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In Maria Florina Balcan and Kilian Q. Weinberger (eds.), Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pp. 1747–1756, New York, New York, USA, 20–22 Jun 2016. PMLR. URL http: //proceedings.mlr.press/v48/oord16.html.
|
| 187 |
+
|
| 188 |
+
Liam Paninski. Estimation of entropy and mutual information. Neural Computation, 15(6):1191– 1253, 2003. doi: 10.1162/089976603321780272. URL https://doi.org/10.1162/ 089976603321780272.
|
| 189 |
+
|
| 190 |
+
George Papamakarios, Iain Murray, and Theo Pavlakou. Masked autoregressive flow for density estimation. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 2335–2344. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 6828-masked-autoregressive-flow-for-density-estimation.pdf.
|
| 191 |
+
|
| 192 |
+
Yuchen Pu, Weiyao Wang, Ricardo Henao, Liqun Chen, Zhe Gan, Chunyuan Li, and Lawrence Carin. Adversarial symmetric variational autoencoder. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 4333– 4342. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 7020-adversarial-symmetric-variational-autoencoder.pdf.
|
| 193 |
+
|
| 194 |
+
Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1530–1538, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr.press/v37/rezende15. html.
|
| 195 |
+
|
| 196 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1278–1286, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/rezende14.html.
|
| 197 |
+
|
| 198 |
+
Oren Rippel and Lubomir Bourdev. Real-time adaptive image compression. In ICML, 2017. URL https://arxiv.org/abs/1705.05823.
|
| 199 |
+
|
| 200 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. In ICLR, 2017. URL https://arxiv.org/abs/1701.05517.
|
| 201 |
+
|
| 202 |
+
Ohad Shamir, Sivan Sabato, and Naftali Tishby. Learning and generalization with the information bottleneck. Theoretical Computer Science, 411(29):2696 – 2711, 2010. ISSN 0304-3975. doi: https://doi.org/10.1016/j.tcs.2010.04.006. URL http://www.sciencedirect.com/ science/article/pii/S030439751000201X. Algorithmic Learning Theory (ALT 2008).
|
| 203 |
+
|
| 204 |
+
Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. CoRR, abs/1703.00810, 2017. URL http://arxiv.org/abs/1703.00810.
|
| 205 |
+
|
| 206 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. URL http://jmlr.org/papers/v15/ srivastava14a.html.
|
| 207 |
+
|
| 208 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander Alemi. Inception-v4, inceptionresnet and the impact of residual connections on learning, 2017. URL https://www.aaai. org/ocs/index.php/AAAI/AAAI17/paper/view/14806.
|
| 209 |
+
|
| 210 |
+
Casper Kaae Snderby, Tapani Raiko, Lars Maale, Sren Kaae Snderby, and Ole Winther. How to Train Deep Variational Autoencoders and Probabilistic Ladder Networks. 2016.
|
| 211 |
+
|
| 212 |
+
Lucas Theis, Wenzhe Shi, Andrew Cunningham, and Ferenc Huszar. Lossy image compression with ´ compressive autoencoders. In ICLR, 2017. URL https://arxiv.org/abs/1703.00395.
|
| 213 |
+
|
| 214 |
+
N. Tishby and N. Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1–5, April 2015. doi: 10.1109/ITW.2015.7133169. URL https://arxiv.org/abs/1503.02406.
|
| 215 |
+
|
| 216 |
+
N. Tishby, F.C. Pereira, and W. Biale. The information bottleneck method. In The 37th annual Allerton Conf. on Communication, Control, and Computing, pp. 368–377, 1999. URL https: //arxiv.org/abs/physics/0004057.
|
| 217 |
+
|
| 218 |
+
J. M. Tomczak and M. Welling. VAE with a VampPrior. ArXiv e-prints, May 2017. URL https: //arxiv.org/abs/1705.07120.
|
| 219 |
+
|
| 220 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, koray kavukcuoglu, Oriol Vinyals, and Alex Graves. Conditional image generation with pixelcnn decoders. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems 29, pp. 4790–4798. Curran Associates, Inc., 2016. URL http://papers.nips.cc/ paper/6527-conditional-image-generation-with-pixelcnn-decoders. pdf.
|
| 221 |
+
|
| 222 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 6000–6010. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf.
|
| 223 |
+
|
| 224 |
+
Z. Wang, E. P. Simoncelli, and A. C. Bovik. Multiscale structural similarity for image quality assessment. In The Thrity-Seventh Asilomar Conference on Signals, Systems Computers, 2003, volume 2, pp. 1398–1402 Vol.2, Nov 2003. doi: 10.1109/ACSSC.2003.1292216.
|
| 225 |
+
|
| 226 |
+
A. W. Yu, Q. Lin, R. Salakhutdinov, and J. Carbonell. Normalized Gradient with Adaptive Stepsize Method for Deep Neural Network Training. ArXiv e-prints, July 2017. URL https://arxiv. org/abs/1707.04822.
|
| 227 |
+
|
| 228 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017. URL https://arxiv.org/ abs/1611.03530.
|
| 229 |
+
|
| 230 |
+
# A RESULTS ON OMNIGLOT
|
| 231 |
+
|
| 232 |
+
Figure 5 plots the RD curve for various models fit to the Omniglot dataset (Lake et al., 2015), in the same form as the MNIST results in Figure 3. Here we explored $\beta \mathbf { s }$ for the powerful decoder models ranging from 1.1 to 0.1, and $\beta \mathfrak { s }$ of 0.9, 1.0, and 1.1 for the weaker decoder models.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 5: Results on Omniglot. Otherwise same description as Figure 3. (a) Rate-distortion curves. (b) The same data, but on the skew axes of $\mathrm { \therefore } \mathrm { B O } = R + D$ versus $R$ .
|
| 236 |
+
|
| 237 |
+
On Omniglot, the powerful decoder models dominate over the weaker decoder models. The powerful decoder models with their autoregressive form most naturally sit at very low rates. We were able to obtain finite rates by means of KL annealing. Further experiments will help to fill in the details especially as we explore differing $\beta$ values for these architectures on the Omniglot dataset. Our best achieved ELBO was at 90.37 nats, set by the $ { { \begin{array} { l } { { { \begin{array} { l } { \end{array} } } } } } } + { { \begin{array} { l } { { \begin{array} { l } { { \begin{array} { r l } } \end{array} } } } } \end{array} } \end{array} \end{array}$ model with $\beta = 1 . 0$ and KL annealing. This model obtains $R = 0 . 7 7 , D = 8 9 . 6 0 , E L B O = 9 0 . 3 7$ and is nearly auto-decoding. We found 14 models with ELBOs below 91.2 nats ranging in rates from 0.0074 nats to 10.92 nats.
|
| 238 |
+
|
| 239 |
+
Similar to Figure 4 in Figure 6 we show sample reconstruction and generated images from the same ”- $- + \mathbf { V } ^ { \dagger }$ model family trained with KL annealing but at various $\beta \mathbf { s }$ . Just like in the MNIST case, this demonstrates that we can smoothly interpolate between auto-decoding and auto-encoding behavior in a single model family, simply by adjusting the $\beta$ value.
|
| 240 |
+
|
| 241 |
+
# B PROOFS
|
| 242 |
+
|
| 243 |
+
# B.1 LOWER BOUND ON REPRESENTATIONAL MUTUAL INFORMATION
|
| 244 |
+
|
| 245 |
+
Our lower bound is established by the fact that Kullback-Leibler (KL) divergences are positive semidefinite
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\mathrm { K L } [ q ( x | z ) | | p ( x | z ) ] = \int d x q ( x | z ) \log \frac { q ( x | z ) } { p ( x | z ) } \geq 0
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
which implies for any distribution $p ( x | z )$ :
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\int d x q ( x | z ) \log q ( x | z ) \geq \int d x q ( x | z ) \log p ( x | z )
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
(a) Omniglot Reconstructions: $z \sim e ( z | x ) , \hat { x } \sim d ( x | z )$ (b) Omniglot Generations: $z \sim m ( z ) , \hat { x } \sim d ( x | z )$
|
| 259 |
+
Figure 6: We can smoothly move between pure autodecoding and autoencoding behavior in a single model family by tuning $\beta$ . (a) Sampled reconstructions from the $\mathbf { - + v }$ model family trained at given $\beta$ values. Pairs of columns show a single reconstruction and the mean of 5 reconstructions. The first column shows the input samples. (b) Generated images from the same set of models. The pairs of columns are single samples and the mean of 5 samples. See text for discussion.
|
| 260 |
+
|
| 261 |
+
$$
|
| 262 |
+
\begin{array} { r l } & { \mathrm { L } _ { \mathrm { e r f } } = \mathrm { L } _ { \mathrm { e f f } } ( X ; Z ) = \displaystyle { \int } \int d x d z \ y _ { \mathrm { g } } ( z , z ) \log \frac { \rho _ { \mathrm { g } } ( z , z ) } { \rho ^ { \prime } ( x ) | \mathcal { D } _ { \mathrm { g } } ( z ) | \mathcal { D } _ { \mathrm { g } } ( z ) | } } \\ & { \quad = \displaystyle { \int } d x \rho _ { \mathrm { g } } ( z ) \int \ d x \nu _ { \mathrm { g } } ( z | z | ) \log \frac { \rho _ { \mathrm { g } } ( x | z | ) } { \rho ^ { \prime } ( x ) | \mathcal { D } _ { \mathrm { g } } ( z ) | } } \\ & { \quad = \displaystyle { \int } d x \rho _ { \mathrm { g } } ( z ) \left[ \int d x \nu _ { \mathrm { g } } ( z | z | ) \log r _ { \mathrm { g } } ( x | z | ) - \int d x \rho _ { \mathrm { g } } ( x | z | ) \log r ^ { \ast } ( x ) \right] } \\ & { \quad > \displaystyle { \int } d x \rho _ { \mathrm { g } } ( z ) \left[ \int d x \nu _ { \mathrm { g } } ( z | z | ) | \mathrm { g } _ { \mathrm { g } } ( x | z | ) - \int d x \rho _ { \mathrm { g } } ( x | z | ) | \mathrm { g } _ { \mathrm { g } } \rho ^ { \prime \prime } ( x ) \right] } \\ & { \quad = \displaystyle { \int } \int d x d z \nu _ { \mathrm { g } } ( x , z ) \log \frac { \rho _ { \mathrm { g } } ( z | x | ) } { \rho ^ { \prime } ( x ) | \mathcal { D } _ { \mathrm { g } } ( z ) | } } \\ & { \quad = \displaystyle { \int } d x \nu ^ { \ast } ( x ) \int d x \mathrm { e } ( z | \ s | ) \log r ^ { \ast } ( x ) } \\ & { \quad = \displaystyle { \int } \ d x \rho ^ { \ast } ( x | z | ) \log r ^ { \ast } ( x ) \ - \left( - \int d x p ^ { \ast } ( x ) \int d x \mathrm { e } ( z | s | ) \log b ( x | z | ) \right) } \\ & { \quad = \displaystyle { \int } \ d x \rho ^ { \ast } ( x | z | ) \log r ^ { \ast } ( x ) \ . } \end{array}
|
| 263 |
+
$$
|
| 264 |
+
|
| 265 |
+
# B.2 UPPER BOUND ON REPRESENTATIONAL MUTUAL INFORMATION
|
| 266 |
+
|
| 267 |
+
The upper bound is established again by the positive semidefinite quality of KL divergence.
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
\mathrm { K L } [ q ( z | x ) \mid \mid p ( z ) ] \ge 0 \implies \int d z q ( z | x ) \log q ( z | x ) \ge \int d z q ( z | x ) \log p ( z )
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
\begin{array} { r l } { { \| _ { \infty } - \| _ { \infty } ( X _ { + } ; \zeta ) - ( \int \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \mathrm { l e g } \frac { - \beta ( x , z ) } { \beta ^ { 2 } } \mathrm { l e g } ( x , z ) ) } } \\ & { = \int \displaystyle \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \frac { \beta ( z ) ( z ) } { \beta ^ { 2 } } } } \\ & { = \int \displaystyle \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \frac { \zeta ( z ) ( z ) ( z ) } { \beta ^ { 2 } } } - \int \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \beta ( z ) } \mathrm { l e g } _ { \beta ( z ) } } \\ & { = \int \displaystyle \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \alpha } \mathrm { e } ^ { \zeta \cdot \zeta } ( z ) - \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z ) \log _ { \beta ( z ) } \mathrm { l e g } _ { \beta ( z ) } } \\ & { \le \displaystyle \int \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \alpha } \mathrm { e } ^ { \zeta \cdot \zeta } ( z ) - \int \mathrm { d } z \mathrm { e } ^ { \zeta \cdot \zeta } ( z ) \log _ { \alpha } \mathrm { e } ^ { \zeta \cdot \zeta } ) } \\ & { = \int \displaystyle \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \frac { \zeta ( z ) ( z ) ( z ) } { \beta ^ { 2 } } } - \int \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \frac { \zeta ( z ) } { \beta ^ { 2 } } } } \\ & { - \displaystyle \int \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( z , z ) \log _ { \frac { \zeta ( z ) ( z ) ( z ) } { \beta ^ { 2 } } } } \\ & { = \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( x , z ) \log _ { \frac { \zeta ( z ) ( z ) } { \beta ^ { 2 } } } } \\ & = \int \mathrm { d } x \mathrm { e } ^ { \zeta \cdot \zeta } ( x , z ) \log _ \frac { \zeta ( z ) ( z ) } \ \end{array}
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
B.3 OPTIMAL MARGINAL FOR FIXED ENCODER
|
| 278 |
+
|
| 279 |
+
Here we establish that the optimal marginal approximation $p ( z )$ , is precisely the marginal distribution of the encoder.
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
{ \cal R } \equiv \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { m ( z ) }
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
Consider the variational derivative of the rate with respect to the marginal approximation:
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
m ( z ) m ( z ) + \delta m ( z ) \quad \int d z \delta m ( z ) = 0
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { l } { { \delta R = \displaystyle \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { m ( z ) + \delta m ( z ) } - R } } \\ { { { } ~ = \displaystyle \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \left( 1 + \frac { \delta m ( z ) } { m ( z ) } \right) } } \\ { { { } ~ \sim \displaystyle \int d x p ^ { * } ( x ) \int d z e ( z | x ) \frac { \delta m ( z ) } { m ( z ) } } } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
Where in the last line we have taken the first order variation, which must vanish if the total variation is to vanish. In particular, in order for this variation to vanish, since we are considering an arbitrary $\delta m ( z )$ , except for the fact that the integral of this variation must vanish, in order for the first order variation in the rate to vanish it must be true that for every value of $x , z$ we have that:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
m ( z ) \propto p ^ { * } ( x ) e ( z | x ) ,
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
which when normalized gives:
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
m ( z ) = \int d x p ^ { * } ( x ) e ( z | x ) ,
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
or that the marginal approximation is the true encoder marginal.
|
| 308 |
+
|
| 309 |
+
# B.4 OPTIMAL DECODER FOR FIXED ENCODER
|
| 310 |
+
|
| 311 |
+
Next consider the variation in the distortion in terms of the decoding distribution with a fixed encoding distribution.
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
d ( x | z ) d ( x | z ) + \delta d ( x | z ) \quad \int d x d ( x | z ) = 0
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { l } { { \displaystyle \delta D = - \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log ( d ( x | z ) + \delta d ( x | z ) ) - D } } \\ { { \displaystyle ~ = - \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \Big ( 1 + \frac { \delta d ( x | z ) } { d ( x | z ) } \Big ) } } \\ { { \displaystyle ~ \sim - \int d x p ^ { * } ( x ) \int d z e ( z | x ) \frac { \delta d ( x | z ) } { d ( x | z ) } } } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Similar to the section above, we took only the leading variation into account, which itself must vanish for the full variation to vanish. Since our variation in the decoder must integrate to 0, this term will vanish for every $x , z$ we have that:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
d ( x | z ) \propto p ^ { * } ( x ) e ( z | x ) ,
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
when normalized this gives:
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
d ( x | z ) = e ( z | x ) \frac { p ^ { * } ( x ) } { \int d x p ^ { * } ( x ) e ( z | x ) }
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
which ensures that our decoding distribution is the correct posterior induced by our data and encoder.
|
| 334 |
+
|
| 335 |
+
# B.5 LOWER BOUND ON GENERATIVE MUTUAL INFORMATION
|
| 336 |
+
|
| 337 |
+
The lower bound is established as all other bounds have been established, with the positive semidefiniteness of $\mathrm { K L }$ divergences.
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\mathrm { K L } [ d ( z | x ) \mid \mid q ( z | x ) ] = \int d z d ( z | x ) \log \frac { d ( z | x ) } { q ( z | x ) } \geq 0
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
which implies for any distribution $q ( z | x )$
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\int d z d ( z | x ) \log d ( z | x ) \geq \int d z d ( z | x ) \log q ( z | x )
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { r l } & { I _ { \mathrm { S t m } } = I _ { \mathrm { S t m } } ( X ; Z ) = \displaystyle \iint \displaystyle d x d z \ y _ { \mathrm { p o t } } ( x , z ) \log \frac { p _ { \mathrm { g o t } } ( x , z ) } { p _ { \mathrm { g o t } } ( x ) p _ { \mathrm { g r o t } } ( z ) } } \\ & { \quad = \displaystyle \iint d x p _ { \mathrm { g a t } } ( x ) \int d z p _ { \mathrm { g a t } } ( z | x ) \log \frac { p _ { \mathrm { g a t } } ( z | x ) } { m ( z ) } } \\ & { \quad = \displaystyle \int d x p _ { \mathrm { p a t } } ( x ) \left[ \int d z p _ { \mathrm { g a t } } ( z | x ) \log p _ { \mathrm { g r o t } } ( z | x ) - \int d z p _ { \mathrm { g a t } } ( z | x ) \log m ( z ) \right] } \\ & { \quad \ge \displaystyle \int d x p _ { \mathrm { g a t } } ( x ) \left[ \int d z p _ { \mathrm { g a t } } ( z | x ) \log e ( z | x ) - \int d z p _ { \mathrm { g a t } } ( z | x ) \log m ( z ) \right] } \\ & { \quad = \displaystyle \iint d x d z p _ { \mathrm { g a t } } ( x , z ) \log \frac { e ( z | x ) } { m ( z ) } } \\ & { \quad = \displaystyle \int d x d z p _ { \mathrm { f o t } } ( x , z ) \log \frac { e ( z | x ) } { m ( z ) } } \\ & { \quad = \displaystyle \int d x \left( z \right) \int d x d ( x | z ) \log \frac { e ( z | x ) } { m ( z ) } } \\ & { \quad = \displaystyle E } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
B.6 UPPER BOUND ON GENERATIVE MUTUAL INFORMATION
|
| 354 |
+
|
| 355 |
+
The upper bound is establish again by the positive semidefinite quality of KL divergence.
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\mathrm { K L } [ p ( x | z ) \mid \mid r ( x ) ] \ge 0 \implies \int d x p ( x | z ) \log p ( x | z ) \ge \int d x p ( x | z ) \log r ( x )
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { r l } & { I _ { \mathcal { G } ^ { \alpha } } = - f _ { \Phi ^ { \alpha } } ( X ; z ) = \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \mathrm { l o g } \frac { \partial f _ { \Phi ^ { \alpha } } ( x , z ) } { \partial x _ { \Phi ^ { \alpha } } ( x , z ) m _ { \Phi ^ { \alpha } } ( x , z ) m _ { \Phi ^ { \alpha } } ( x , z ) } } \\ & { \quad = \displaystyle \int \int d x d z \mathrm { s p } _ { \Phi ^ { \alpha } ( z , z ) } \mathrm { l o g } \frac { \partial f _ { \Phi ^ { \alpha } } ( x , z ) } { \partial x _ { \Phi ^ { \alpha } } ( x , z ) } } \\ & { \quad - \displaystyle \int \int d x d z \mathrm { s p } _ { \alpha _ { \Phi ^ { \alpha } } ( z , z ) } \mathrm { l o g } \mathrm { l o g } \mathrm { l o g } ( z ) - \displaystyle \int \int d x d z \mathrm { s p } _ { \alpha _ { \Phi ^ { \alpha } } ( x , z ) } \mathrm { l o g } n _ { \Phi ^ { \alpha } } ( x , z ) } \\ & { \quad = \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \mathrm { l o g } \mathrm { l o g } ( x , z ) - \displaystyle \int d x d z p _ { \Phi ^ { \alpha } } ( x ) \mathrm { l o g } y _ { \Phi ^ { \alpha } } ( x ) } \\ & { \quad \le \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( z , z ) \mathrm { l o g } \mathrm { d } z ( z ) - \displaystyle \int d x d z p _ { \Phi ^ { \alpha } } ( x ) \mathrm { l o g } \mathrm { q } ( x ) } \\ & { \quad - \displaystyle \iint d x d z p _ { \Phi ^ { \alpha } } ( z , z ) \mathrm { l o g } \mathrm { d } z ( z ) - \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \mathrm { l o g } ( z ) } \\ & { \quad = \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( z , z ) \mathrm { l o g } \frac { d ( x , z ) } { \partial x _ { \Phi ^ { \alpha } } ( x , z ) } } \\ & { \quad = \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \mathrm { l o g } \frac { d ( x , z ) } { \partial x _ { \Phi ^ { \alpha } } ( x , z ) } = \displaystyle \int \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \mathrm { l o g } ( z ) } \\ & \quad = \displaystyle \int d x d z p _ { \Phi ^ { \alpha } } ( x , z ) \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
# C GENERATIVE MUTUAL INFORMATION
|
| 366 |
+
|
| 367 |
+
Given any four distributions: $p ^ { * } ( x )$ – a density over some data space $X$ , $e ( z | x ) - \mathbf { a }$ stochastic map from that data to a new representational space $Z$ , $d ( x | z )$ – a stochastic map in the reverse direction from $Z$ to $X$ , and $m ( z )$ – some density in the $Z$ space; we were able to find an inequality relating three functionals of these densities that must always hold. We found this inequality by deriving upper and lower bounds on the mutual information in the joint density defined by the natural representational path through the four distributions, $p _ { e } ( x , z ) \ = \ p ^ { * } ( x ) e ( z | x )$ . Doing so naturally made us consider the existence of two other distributions $d ( x | z )$ and $m ( z )$ . Let’s consider the mutual information along this new generative path.
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
p _ { \mathrm { g e n } } ( x , z ) = m ( z ) d ( x | z )
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
I _ { \mathrm { g e n } } ( X ; Z ) = \iint d x d z p _ { \mathrm { g e n } } ( x , z ) \log \frac { p _ { \mathrm { g e n } } ( x , z ) } { p _ { \mathrm { g e n } } ( x ) p _ { \mathrm { g e n } } ( z ) }
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Just as before we can easily establish both a variational lower and upper bound on this mutual information. For the lower bound (proved in Section B.5), we have:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
E \equiv \int d z p ( z ) \int d x p ( x | z ) \log \frac { q ( z | x ) } { p ( z ) } \leq { \cal I } _ { \mathrm { g e n } }
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Where we need to make a variational approximation to the decoder posterior, itself a distribution mapping $X$ to $Z$ . Since we already have such a distribution from our other considerations, we can certainly use the encoding distribution $q ( z | x )$ for this purpose, and since the bound holds for any choice it will hold with this choice. We will call this bound $E$ since it gives the distortion as measured through the encoder as it attempts to encode the generated samples back to their latent representation.
|
| 384 |
+
|
| 385 |
+
We can also find a variational upper bound on the generative mutual information (proved in Section B.6):
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
G \equiv \int d z m ( z ) \int d x d ( x | z ) \log \frac { d ( x | z ) } { q ( x ) } \geq I _ { \mathrm { g e n } }
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
This time we need a variational approximation to the marginal density of our generative model, which we denote as $q ( x )$ . We call this bound $G$ for the rate in the generative model.
|
| 392 |
+
|
| 393 |
+
Together these establish both lower and upper bounds on the generative mutual information:
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
E \leq I _ { \mathrm { g e n } } \leq G .
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
In our early experiments, it appears as though additionally constraining or targeting values for these generative mutual information bounds is important to ensure consistency in the underlying joint distributions. In particular, we notice a tendency of models trained with the $\beta$ -VAE objective to have loose bounds on the generative mutual information when $\beta$ varies away from 1.
|
| 400 |
+
|
| 401 |
+
# C.1 REARRANGING THE REPRESENTATIONAL LOWER BOUND
|
| 402 |
+
|
| 403 |
+
In light of the appearance of a new independent density estimate $q ( x )$ in deriving our variational upper bound on the mutual information in the generative model, let’s actually use that to rearrange our variational lower bound on the representational mutual information.
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { p ^ { * } ( x ) } = \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { e ( z | x ) } { q ( x ) } - \int d x p ^ { * } ( x ) \log \frac { p ^ { * } ( x ) } { q ( x ) }
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Doing this, we can express our lower bound in terms of two reparameterization independent functionals:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { l } { { U \equiv \displaystyle \int d x p ^ { * } ( x ) \int d z e ( z | x ) \log \frac { d ( x | z ) } { q ( x ) } } } \\ { { S \equiv \displaystyle \int d x p ^ { * } ( x ) \log \frac { p ^ { * } ( x ) } { q ( x ) } = - \int d x p ^ { * } ( x ) \log q ( x ) - H } } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
This new reparameterization couples together the bounds we derived both the representational mutual information and the generative mutual information, using $q ( x )$ in both. The new function $S$ we’ve described is intractable on its own, but when split into the data entropy and a cross entropy term, suggests we set a target cross entropy on our own density estimate $q ( x )$ with respect to the empirical data distribution that might be finite in the case of finite data.
|
| 416 |
+
|
| 417 |
+
Together we have an equivalent way to formulate our original bounds on the representaional mutual information
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
U - S = H - D \leq I _ { \mathrm { r e p } } \leq R
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
We believe this reparameterization offers and important and potential way to directly control for overfitting. In particular, given that we compute our objectives using a finite sample from the true data distribution, it will generically be true that $\mathrm { K L } [ \hat { p } ( x ) \bar { | | } p ^ { * } ( x ) ] \geq \bar { 0 }$ . In particular, the usual mode we operate in is one in which we only ever observe each example once in the training set, suggesting that in particular an estimate for this divergence would be:
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\operatorname { K L } [ { \hat { p } } ( x ) \mid \mid p ^ { * } ( x ) ] \sim H ( X ) - \log N .
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
Early experiments suggest this offers a useful target for $S$ in the reparameterized objective that can prevent overfitting, at least in our toy problems.
|
| 430 |
+
|
| 431 |
+
# D DETAILED RELATED WORK
|
| 432 |
+
|
| 433 |
+
Here we expand on the brief related work in Section 3.
|
| 434 |
+
|
| 435 |
+
# D.1 INFORMATION THEORY AND MACHINE LEARNING
|
| 436 |
+
|
| 437 |
+
Much recent work has leveraged information theory to improve our understanding of machine learning in general, and unsupervised learning specifically. In Tishby & Zaslavsky (2015), the authors present theory for the success of supervised deep learning as approximately optimizing the information bottleneck objective, and also theoretically predict a supervised variant of the rate/distortion plane we describe here. Shwartz-Ziv & Tishby (2017) further proposes that training of deep learning models proceeds in two phases: error minimization followed by compression. They suggest that the compression phase diffuses the conditional entropy of the individual layers of the model, and when the model has converged, it lies near the information bottleneck optimal frontier on the proposed rate/distortion plane. In Higgins et al. (2016) the authors motivate the $\beta$ -VAE objective from a combined neuroscience and information theoretic perspective. The Higgins et al. (2017) propose that $\beta$ should be greater than 1 to properly learn disentangled representations in an unsupervised manner.
|
| 438 |
+
|
| 439 |
+
Chen et al. (2017) described the issue of the too-powerful decoder when training standard VAEs, where $\beta = 1$ . They proposed a bits-back (Hinton & Van Camp, 1993) model to understand this phenomenon, as well as a noise-injection technique to combat it. Our approach removes the need for an additional noise source in the decoder, and concisely rephrases the problem as finding the optimal $\beta$ for the chosen model family, which can now be as powerful as we like, without risk of ignoring the latent space and collapsing to an autodecoding model.
|
| 440 |
+
|
| 441 |
+
Bowman et al. (2016) suggested annealing the weight of the KL term of the ELBO $( \mathrm { K L } [ q ( \boldsymbol { z } | \boldsymbol { x } ) \mid | \boldsymbol { p } ( \boldsymbol { z } ) ] )$ from 0 to 1 to make it possible to train an RNN decoder without ignoring the latent space. Snderby et al. (2016) applies the same idea to ladder network decoders. We relate this idea of KL annealing to our optimal rate/distortion curve, and show empirically that KL annealing does not in general attain the performance possible when setting a fixed $\beta$ or a fixed target rate.
|
| 442 |
+
|
| 443 |
+
In Achille & Soatto (2016), the authors proposed an information bottleneck approach to the activations of a network, termed Information Dropout, as a form of regularization that explains and generalizes Dropout (Srivastava et al., 2014). They suggest that, without such a form of regularization, standard SGD training only provides a sufficient statistic, but does not in general provide two other desiderata: minimality and invariance to nuisance factors. Both of these would be provided by a procedure that directly optimized the information bottleneck. They propose that simply injecting noise adaptively into the otherwise deterministic function computed by the deep network is sufficient to cause SGD to optimize toward disentangled and invariant representations. Achille & Soatto (2017) expands on this exploration of sufficiency, minimality, and invariance in deep networks. In particular they propose that architectural bottlenecks and depth both promote invariance directly, and they decompose the standard cross entropy loss used in supervised learning into four terms, including one which they name ‘overfitting’, and which, without other regularization, an optimization procedure can easily increase in order to reduce the total loss.
|
| 444 |
+
|
| 445 |
+
Other recent work explores related theoretical frameworks for unsupervised learning, including Pu et al. (2017); Hu et al. (2017); Zhang et al. (2017).
|
| 446 |
+
|
| 447 |
+
# D.2 MODEL FAMILIES FOR UNSUPERVISED LEARNING WITH NEURAL NETWORKS
|
| 448 |
+
|
| 449 |
+
Burda et al. (2015) presented an importance-weighted variant of the VAE objective. By increasing the number of samples taken from the encoder during training, they are able to tighten the variational lower bound and improve the test log likelihood.
|
| 450 |
+
|
| 451 |
+
Rezende & Mohamed (2015) proposed to use normalizing flows to approximate the true posterior during inference, in order to overcome the problem of the standard mean-field posterior approximation used in VAEs lacking sufficient representational power to model complex posterior distributions. Normalizing flow permits the use of a deep network to compute a differentiable function with a computable determinant of a random variable and have the resulting function be a valid normalized distribution. Kingma et al. (2016) expanded on this idea by introducing inverse autoregressive flow (IAF). IAF takes advantage of properties of current autoregressive models, including their expressive power and particulars of their Jacobians when inverted, and used them to learn expressive, parallelizeable normalizing flows that are efficient to compute when using high dimensional latent spaces for the posterior.
|
| 452 |
+
|
| 453 |
+
Autoregressive models have also been applied successfully to the density estimation problem, as well as high quality sample generation. MADE (Germain et al., 2015) proposed directly masking the parameters of an autoencoder during generation such that a given unit makes its predictions based solely on the first $d$ activations of the layer below. This enforces that the autoencoder maintains the “autoregressive” property. In Oord et al. (2016), the authors presented a recurrent neural network that can autoregressively predict the pixels of an image, as well as provide tractable density estimation. This work was expanded to a convolutional model called PixelCNN (van den Oord et al., 2016), which enforced the autoregressive property by masking the convolutional filters. In Salimans et al. (2017), the authors further improved the performance with $\mathrm { P i x e l C N N + + }$ with a collection of architecture changes that allow for much faster training. Finally, Papamakarios et al. (2017) proposed another unification of normalizing flow models with autoregressive models for density estimation. The authors observe that the conditional ordering constraints required for valid autoregressive modeling enforces a choice which may be arbitrarily incorrect for any particular problem. In their proposal, Masked Autoregressive Flow (MAF), they explicitly model the random number generation process with stacked MADE layers. This particular choice means that MAF is fast at density estimation, whereas the nearly identical IAF architecture is fast at sampling.
|
| 454 |
+
|
| 455 |
+
Tomczak & Welling (2017) proposed a novel method for learning the marginal posterior, $m ( z )$ (written $q ( z )$ in that work): learn $k$ pseudo-inputs that can be mixed to approximate any of the true samples $x \sim p ^ { * } ( x )$ .
|
| 456 |
+
|
| 457 |
+
# E TOY MODEL DETAILS
|
| 458 |
+
|
| 459 |
+
Data generation. The true data generating distribution is as follows. We first sample a latent binary variable, $z \sim \mathrm { B e r } ( 0 . 7 )$ , then sample a latent 1d continuous value from that variable, $h | z \sim$ $\mathcal { N } ( h | \mu _ { z } , \sigma _ { z } )$ , and finally we observe a discretized value, $\boldsymbol { x } = \mathrm { d i s c r e t i z e } ( \boldsymbol { h } ; \boldsymbol { B } )$ , where $\boldsymbol { B }$ is a set of 30 equally spaced bins. We set $\mu _ { z }$ and $\sigma _ { z }$ such that $R ^ { * } \equiv \mathrm { I } ( x ; z ) = 0 . 5$ nats, in the true generative process, representing the ideal rate target for a latent variable model.
|
| 460 |
+
|
| 461 |
+
Model details. We choose to use a discrete latent representation with $K = 3 0$ values, with an encoder of the form $e ( z _ { i } | x _ { j } ) \propto - \exp [ ( w _ { i } ^ { e } x _ { j } - b _ { i } ^ { e } ) ^ { 2 } ]$ , where $z$ is the one-hot encoding of the latent categorical variable, and $x$ is the one-hot encoding of the observed categorical variable. Thus the encoder has $2 K = 6 0$ parameters. We use a decoder of the same form, but with different parameters: $d ( x _ { j } | z _ { i } ) \propto - \exp [ ( w _ { i } ^ { \dot { d } } x _ { j } - b _ { i } ^ { d } ) ^ { 2 } ]$ . Finally, we use a variational marginal, $m ( z _ { i } ) = \pi _ { i }$ . Given this, the true joint distribution has the form $p _ { e } ( x , z ) = p ^ { * } ( x ) e ( z | x )$ , with marginal $\begin{array} { r } { m ( z ) = \sum _ { x } p _ { e } ( x , z ) } \end{array}$ and conditional $p _ { e } ( x | z ) = p _ { e } ( x , z ) / p _ { e } ( z )$ .
|
| 462 |
+
|
| 463 |
+
# F DETAILS FOR MNIST AND OMNIGLOT EXPERIMENTS
|
| 464 |
+
|
| 465 |
+
We used the static binary MNIST dataset originally produced for (Larochelle & Murray, 2011)5, and the Omniglot dataset from Lake et al. (2015); Burda et al. (2015).
|
| 466 |
+
|
| 467 |
+
As stated in the main text, for our experiments we considered twelve different model families corresponding to a simple and complex choice for the encoder and decoder and three different choices for the marginal.
|
| 468 |
+
|
| 469 |
+
Unless otherwise specified, all layers used a linearly gated activation function activation function (Dauphin et al., 2017), $h ( x ) \stackrel { . } { = } ( W _ { 1 } x + b _ { 2 } ) \sigma ( W _ { 2 } \stackrel { . } { x } + b _ { 2 } )$ .
|
| 470 |
+
|
| 471 |
+
# F.1 ENCODER ARCHITECTURES
|
| 472 |
+
|
| 473 |
+
For the encoder, the simple encoder was a convolutional encoder outputting parameters to a diagonal Gaussian distribution. The inputs were first transformed to be between $^ { - 1 }$ and 1. The architecture contained 5 convolutional layers, summarized in the format Conv (depth, kernel size, stride, padding), followed by a linear layer to read out the mean and a linear layer with softplus nonlinearity to read out the variance of the diagonal Gaussiann distribution.
|
| 474 |
+
|
| 475 |
+
• Input (28, 28, 1)
|
| 476 |
+
• Conv (32, 5, 1, same)
|
| 477 |
+
• Conv (32, 5, 2, same)
|
| 478 |
+
• Conv (64, 5, 1, same)
|
| 479 |
+
• Conv (64, 5, 2, same)
|
| 480 |
+
• Conv (256, 7, 1, valid)
|
| 481 |
+
• Gauss (Linear (64), Softplus (Linear (64)))
|
| 482 |
+
|
| 483 |
+
For the more complicated encoder, the same 5 convolutional layer architecture was used, followed by 4 steps of mean-only Gaussian inverse autoregressive flow, with each step’s location parameters computed using a 3 layer MADE style masked network with 640 units in the hidden layers and ReLU activations.
|
| 484 |
+
|
| 485 |
+
# F.2 DECODER ARCHITECTURES
|
| 486 |
+
|
| 487 |
+
The simple decoder was a transposed convolutional network, with 6 layers of transposed convolution, denoted as Deconv (depth, kernel size, stride, padding) followed by a linear convolutional layer parameterizing an independent Bernoulli distribution over all of the pixels:
|
| 488 |
+
|
| 489 |
+
• Input (1, 1, 64)
|
| 490 |
+
• Deconv (64, 7, 1, valid)
|
| 491 |
+
• Deconv (64, 5, 1, same)
|
| 492 |
+
• Deconv (64, 5, 2, same)
|
| 493 |
+
• Deconv (32, 5, 1, same)
|
| 494 |
+
• Deconv (32, 5, 2, same)
|
| 495 |
+
• Deconv (32, 4, 1, same)
|
| 496 |
+
• Bernoulli (Linear Conv (1, 5, 1, same))
|
| 497 |
+
|
| 498 |
+
The complicated decoder was a slightly modified $\mathrm { P i x e l C N N + + }$ style network (Salimans et al., $2 0 1 7 ) ^ { 6 }$ . However in place of the original RELU activation functions we used linearly gated activation functions and used six blocks (with sizes $( 2 8 \times 2 8 ) - ( 1 4 \times 1 4 ) - ( 7 \times 7 ) - ( 7 \times 7 ) - ( 1 4 \times 1 4 )$ $- ( 2 8 \times 2 8 ) ,$ ) of two resnet layers in each block. All internal layers had a feature depth of 64. Shortcut connections were used throughout between matching sized featured maps. The 64-dimensional latent representation was sent through a dense lineary gated layer to produce a 784-dimensional representation that was reshaped to $( 2 8 \times 2 8 \times 1 )$ and concatenated with the target image to produce a $( 2 8 \times 2 8 \times 2 )$ dimensional input. The final output (of size $( 2 8 \times 2 8 \times 6 4 )$ ) was sent through a $( 1 \times 1 )$ convolution down to depth 1. These were interpreted as the logits for a Bernoulli distribution defined on each pixel.
|
| 499 |
+
|
| 500 |
+
# F.3 MARGINAL ARCHITECTURES
|
| 501 |
+
|
| 502 |
+
We used three different types of marginals. The simplest architecture (denoted (-)), was just a fixed isotropic gaussian distribution in 64 dimensions with means fixed at 0 and variance fixed at 1.
|
| 503 |
+
|
| 504 |
+
The complicated marginal $( + )$ was created by transforming the isotropic Gaussian base distribution with 4 layers of mean-only Gaussian autoregressive flow, with each steps location parameters computed using a 3 layer MADE style masked network with 640 units in the hidden layers and relu activations. This network resembles the architecture used in Papamakarios et al. (2017).
|
| 505 |
+
|
| 506 |
+
The last choice of marginal was based on VampPrior and denoted with (v), which uses a mixture of the encoder distributions computed on a set of pseudo-inputs to parameterize the prior (Tomczak & Welling, 2017). We add an additional learned set of weights on the mixture distributions that are constrained to sum to one using a softmax function: $\begin{array} { r } { m ( z ) = \sum _ { i = 1 } ^ { N } w _ { i } e ( z | \phi _ { i } ) } \end{array}$ where $N$ are the number of pseudo-inputs, are the weights, is the encoder, and $\phi$ are the pseudo-inputs that have the same dimensionality as the inputs.
|
| 507 |
+
|
| 508 |
+
# F.4 OPTIMIZATION
|
| 509 |
+
|
| 510 |
+
The models were all trained using the $\beta$ -VAE objective (Higgins et al., 2017) at various values of $\beta$ . No form of explicit regularization was used. The models were trained with Adam (Kingma & Ba, 2015) with normalized gradients (Yu et al., 2017) for 200 epochs to get good convergence on the training set, with a fixed learning rate of $3 \times 1 0 ^ { - 4 }$ for the first 100 epochs and a linearly decreasing learning rate towards 0 at the $2 0 0 \mathrm { { t h } }$ epoch.
|
md/train/HShLSEcVZJ4/HShLSEcVZJ4.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Do Different Tracking Tasks Require Different Appearance Models?
|
| 2 |
+
|
| 3 |
+
Zhongdao Wang1,2
|
| 4 |
+
|
| 5 |
+
Hengshuang Zhao3,4
|
| 6 |
+
|
| 7 |
+
Ya-Li Li1,2
|
| 8 |
+
|
| 9 |
+
Shengjin Wang1,2∗
|
| 10 |
+
|
| 11 |
+
Philip H.S. Torr3
|
| 12 |
+
|
| 13 |
+
Luca Bertinetto5
|
| 14 |
+
|
| 15 |
+
1Beijing National Research Center for Information Science and Technology (BNRist) 2Department of Electronic Engineering, Tsinghua University 3Torr Vision Group, University of Oxford 4The University of Hong Kong 5Five AI
|
| 16 |
+
|
| 17 |
+
https://zhongdao.github.io/UniTrack
|
| 18 |
+
|
| 19 |
+
# Abstract
|
| 20 |
+
|
| 21 |
+
Tracking objects of interest in a video is one of the most popular and widely applicable problems in computer vision. However, with the years, a Cambrian explosion of use cases and benchmarks has fragmented the problem in a multitude of different experimental setups. As a consequence, the literature has fragmented too, and now novel approaches proposed by the community are usually specialised to fit only one specific setup. To understand to what extent this specialisation is necessary, in this work we present UniTrack, a solution to address five different tasks within the same framework. UniTrack consists of a single and task-agnostic appearance model, which can be learned in a supervised or self-supervised fashion, and multiple “heads” that address individual tasks and do not require training. We show how most tracking tasks can be solved within this framework, and that the same appearance model can be successfully used to obtain results that are competitive against specialised methods for most of the tasks considered. The framework also allows us to analyse appearance models obtained with the most recent self-supervised methods, thus extending their evaluation and comparison to a larger variety of important problems.
|
| 22 |
+
|
| 23 |
+
# 1 Introduction
|
| 24 |
+
|
| 25 |
+
Unlike popular image-based computer vision tasks such as classification and object detection, which are (for the most part) unambiguous and clearly defined, the problem of object tracking has been considered under different setups and scenarios, each motivating the design of a separate set of benchmarks and methods. For instance, for the Single Object Tracking (SOT) and Video Object Segmentation (VOS) communities [70, 29, 48], tracking means estimating the location of an arbitrary user-annotated target object throughout a video, where the location of the object is represented by a bounding box in SOT and by a pixel-wise mask in VOS. Instead, in multiple object tracking settings (MOT [41], MOTS [57] and PoseTrack [2]), tracking means connecting sets of (often given) detections across video frames to address the problem of identity association and forming trajectories. Despite these tasks only differing in the number of objects per frame to consider and observation format (bounding boxes, keypoints or masks), the best practices developed by the methods tackling them vary significantly.
|
| 26 |
+
|
| 27 |
+
Though the proliferation of setups, benchmarks and methods is positive in that it allows specific use cases to be thoroughly studied, we argue it makes increasingly harder to effectively study one of the fundamental problems that all these tasks have in common, i.e. what constitutes a good representation to track objects throughout a video? Recent advancements in large-scale models for language [15, 6] and vision [24, 10] have suggested that a strong representation can help addressing multiple downstream tasks. Similarly, we speculate that a good representation is likely to benefit many different tracking tasks, regardless of their specific setup. In order to validate our speculation, in this paper we present a framework that allows to adopt the same appearance model to address five different tracking tasks (Figure 2). In our taxonomy (Figure 4), we consider existing tracking tasks as problems that have either propagation or association at their core. When the core problem is propagation (as in SOT and VOS), one has to localise a target object in the current frame given its location in the previous one. Instead, in association problems (MOT, MOTS, and PoseTrack), target states in both previous and current frames are given, and the goal is to determine the correspondence between the two sets of observations. We show how most tracking tasks currently considered by the community can be simply expressed starting from the primitives of propagation or association. For propagation tasks, we employ existing box and mask propagation algorithms [5, 61, 58]. For association tasks, we propose a novel reconstruction-based metric that leverages fine-grained correspondence to measure similarities between observations. In the proposed framework, each individual task is assigned to a dedicated “head” that allows to represent the object(s) in the appropriate format to compare against prior arts on the relevant benchmarks.
|
| 28 |
+
|
| 29 |
+
Note that, in our framework, only the appearance model contains parameters that can be learned via back-propagation, and that we do not experiment with appearance models that have been trained on specific tracking tasks. Instead, we adopt models trained via recent self-supervised learning (SSL) techniques and that have already demonstrated their effectiveness on a variety of image-based tasks. Our motivation is twofold. First, SSL models are particularly interesting for our use-case, as they are explicitly conceived to be of general purpose. As a byproduct, our work also serves the purpose of evaluating and comparing appearance models obtained from self-supervised learning approaches (see Figure 1). Second, we hope to facilitate the tracking community in directly benefiting from the rapid advancements of the self-supervised learning literature.
|
| 30 |
+
|
| 31 |
+
To summarise, the contributions of our work are as follows:
|
| 32 |
+
|
| 33 |
+
• We propose UniTrack, a framework that supports five tracking tasks: SOT [70], VOS [48], MOT [41], MOTS [57], and PoseTrack [2]; and that can be easily extended to new ones. • We show how UniTrack can leverage many existing general-purpose appearance models to achieve a performance that is competitive with the state-of-the-art on several tracking tasks. • We propose a novel reconstruction-based similarity metric for association that preserves fine-grained visual features and supports multiple observation formats (box, mask and pose). • We perform an extensive evaluation of self-supervised models, significantly extending the empirical analysis of prior literature to video-based tasks.
|
| 34 |
+
|
| 35 |
+
# 2 The UniTrack Framework
|
| 36 |
+
|
| 37 |
+
# 2.1 Overview
|
| 38 |
+
|
| 39 |
+
Inspecting existing tracking tasks and benchmarks, we noticed that their differences can be roughly categorised across four axes, illustrated in Figure 2 and detailed below.
|
| 40 |
+
|
| 41 |
+
1. Whether the requirement is to track a single object (SOT [70, 29], VOS [48]), or multiple objects (MOT [48], MOTS [57], PoseTrack [2]).
|
| 42 |
+
2. Whether the targets are specified by a user in the first frame only (SOT, VOS), or instead are given in every frame, e.g. by a pre-trained detector (MOT, MOTS, PoseTrack).
|
| 43 |
+
3. Whether the target objects are represented by bounding-boxes (SOT, MOT), pixel-wise masks (VOS, MOTS) or pose annotations (PoseTrack).
|
| 44 |
+
4. Whether the task is class-agnostic, i.e. the target objects can be of any class (SOT, VOS); or if instead they are from a predefined set of classes (MOT, MOTS, PoseTrack).
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 1: High-level overview of the performance of sixteen self-supervised learning models on five tracking tasks: SOT, VOS, MOT, PoseTracking and MOTS. A higher rank (better performance) corresponds to a vertex nearer to the outer circle. A larger area of the pentagon signifies better overall performance of its respective appearance model. Results of a vanilla ImageNet-supervised model are indicated with a gray dashed line as reference. Notice how the best model VFS [74] dominates on four out of the five tasks considered.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 2: Existing tracking problems and their respective benchmarks differ from each other under several aspects: the assumption could be that there is a single or multiple objects to track; targets can be specified by the user in the first frame only, or assumed to be given at every frame (e.g. provided by a detector); the classes of the targets can be known (classspecific) or unknown (class-agnostic); the representation of the targets can be bounding boxes, pixel-wise masks, or pose annotations.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 3: Overview of UniTrack. The framework can be divided in three levels. Level-1: a trainable appearance model. Level-2: the fundamental primitives of propagation and association. Level-3: task-specific heads.
|
| 54 |
+
|
| 55 |
+
Typically, in single-object tasks the target is specified by the user in the first frame, and it can be of any class. Instead, for multi-object tasks detections are generally considered as given for every frame, and the main challenge is to solve identity association for the several objects. Moreover, in multi-object tasks the set of classes to address is generally known (e.g. pedestrians or cars).
|
| 56 |
+
|
| 57 |
+
Figure 3 depicts a schematic overview of the proposed UniTrack framework, which can be understood as conceptually divided in three “levels”. The first level is represented by the appearance model, responsible for extracting high-resolution feature maps from the input frame (Section 2.2). The second level consists of the algorithmic primitives addressing propagation (Section 2.3) and association (Section 2.4). Finally, the last level comprises multiple task-specific algorithms that make direct use of the primitives of the second level. In this work, we illustrate how UniTrack can be used to obtain competitive performance on all of the five tracking tasks of level-3 from Figure 3. Moreover, new tracking tasks can be easily integrated.
|
| 58 |
+
|
| 59 |
+
Importantly, note that the appearance model is the only component containing trainable parameters. The reason we opted for a shared and non task-specific representation is twofold. Firstly, the large amount of different setups motivated us to investigate whether having separately-trained models for each setup is necessary. Since training on specific datasets can bias the representation towards a limited set of visual concepts (e.g. animals or vehicles) and limit its applicability to “open-world” settings, we wanted to understand how far can a shared representation go. Second, we wanted to provide the community with multiple baselines that can be used to better assess newly proposed contributions, and that can be immediately used on new datasets and tasks without the need of retraining.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 4: Propagation v.s. Association. In the propagation problem, the goal is to estimate the target state at the current frame given the observation in the previous one. This is typically addressed for one object at the time. In the association problem, observations in both previous and current frames are given, and the goal is to determine correspondences between the two sets.
|
| 63 |
+
|
| 64 |
+
# 2.2 Base appearance model
|
| 65 |
+
|
| 66 |
+
The base appearance model $\phi$ takes as input a 2D image $I$ and outputs a feature map $X = \phi ( I ) \in$ $\mathbb { R } ^ { H \times W \times C }$ . Since ideally an appearance model used for object propagation and association should be able to leverage fine-grained semantic correspondences between images, we choose a network with a small stride of $r = 8$ , so that its output in feature space can have a relatively large resolution.
|
| 67 |
+
|
| 68 |
+
We refer to the vector (along the channel dimension) of a single point in the feature map as a point vector. We expect a point vector $x _ { 1 } ^ { i } \in \mathbb { R } ^ { C }$ from the feature map $X _ { 1 }$ to have a high similarity with its “true match” point vector $x _ { 2 } ^ { \hat { i } }$ in $X _ { 2 }$ , while being far apart from all the other point vectors $x _ { 2 } ^ { j }$ in $X _ { 2 }$ ; i.e. we expect $s ( x _ { 1 } ^ { i } , x _ { 2 } ^ { \hat { i } } ) > s ( x _ { 1 } ^ { i } , x _ { 2 } ^ { j } ) , \forall j \neq \hat { i }$ , where $s ( \cdot , \cdot )$ represents a similarity function.
|
| 69 |
+
|
| 70 |
+
In order to learn fine-grained correspondences, fully-supervised methods are only amenable for synthetic datasets (e.g. Flying Chairs for optical flow [16]). With real-world data, it is intractable to label pixel-level correspondences and train models in a fully-supervised fashion. To overcome this obstacle, in this paper we adopt representations obtained with self-supervision. We experiment both with models trained with approaches that leverage pixel-wise pretext tasks [27, 58] and, inspired by prior works that have pointed out how fine-grained correspondences emerge in middle-level features [39, 74], with models obtained from image-level tasks (e.g. MoCo [24], SimCLR [10]).
|
| 71 |
+
|
| 72 |
+
# 2.3 Propagation
|
| 73 |
+
|
| 74 |
+
Problem definition. Figure 4a schematically illustrates the problem of propagation, which we use as a primitive to address SOT and VOS tasks. Considering the single-object case, given video frames $\{ I _ { t } \} _ { t = 1 } ^ { T }$ and an initial ground truth observation $z _ { 1 }$ as input, the goal is to predict object states $\{ \hat { z } _ { t } \} _ { t = 2 } ^ { T }$ for each time-step $t$ . In this work we consider three formats to represent objects: bounding boxes, segmentation masks and pose skeletons.
|
| 75 |
+
|
| 76 |
+
Mask propagation. In order to propagate masks, we rely on the approach popularised by recent video self-supervised methods [27, 58, 35, 31]. Consider the feature maps of a pair of consecutive frames $X _ { t - 1 }$ and $X _ { t }$ , both $\in \mathbb { R } ^ { s \times C }$ , and the label mask $z _ { t - 1 } \in [ 0 , 1 ] ^ { s }$ of the previous frame 2, where $s = H \times W$ indicates its spatial resolution. We compute the matrix of transitions $K _ { t - 1 } ^ { t } = [ k _ { i , j } ] _ { s \times s }$ as the affinity matrix between $X _ { t - 1 }$ and $X _ { t }$ . Each element $k _ { i , j }$ is defined as
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
k _ { i , j } = \mathrm { S o f t m a x } ( X _ { t - 1 } , X _ { t } ^ { \top } ; \tau ) _ { i j } = \frac { \exp ( \left. x _ { t - 1 } ^ { i } , x _ { t } ^ { j } \right. / \tau ) } { \sum _ { k } ^ { s } \exp ( \left. x _ { t - 1 } ^ { i } , x _ { t } ^ { k } \right. / \tau ) } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\langle \cdot , \cdot \rangle$ indicates inner product, and $\tau$ is a temperature hyperparameter. As in [27], we only keep the top $K$ values for each row and set other values to zero. Then, the mask for the current frame at time $t$ is predicted by propagating the previous prediction: $z _ { t } = K _ { t - 1 } ^ { t } z _ { t - 1 }$ . Mask propagation proceeds in a recurrent fashion: the output mask of the current frame is used as input for the next one.
|
| 83 |
+
|
| 84 |
+
Pose propagation. In order to represent pose keypoints, we use the widely adopted Gaussian belief maps [66]. For a keypoint $p$ , we obtain a belief map $z ^ { p } \in [ 0 , 1 ] ^ { s }$ by using a Gaussian with mean equal to the keypoint’s location and variance proportional to the subject’s body size. In order to propagate a pose, we can then individually propagate each belief map in the same manner as mask propagation, again as $z _ { t } ^ { p } = K _ { t - 1 } ^ { t } z _ { t - 1 } ^ { p }$ .
|
| 85 |
+
|
| 86 |
+
Box propagation. The position of an object can also be more simply expressed with a fourdimensional vector ${ z = ( u , v , w , h ) }$ , where $( u , v )$ are the coordinates of the bounding-box center, and $( w , h )$ are its width and height. While one could reuse the strategy adopted above by simply converting the bounding-box to a pixel-wise mask, we observed that using this strategy leads to inaccurate predictions. Instead, we use the approach of SiamFC [5], which consists in performing cross-correlation (XCORR) between the target template $z _ { t - 1 }$ and the frame $X _ { t }$ to find the new location of the target in frame $t$ . Cross-correlation is performed at different scales, so that the bounding-box representation can be resized accordingly. We also provide a Correlation Filter-based alternative (DCF) [54, 61] (see Appendix B.1).
|
| 87 |
+
|
| 88 |
+
# 2.4 Association
|
| 89 |
+
|
| 90 |
+
Problem definition. Figure 4b schematically illustrates the association problem, which we use as primitive to address the tasks of MOT, MOTS and PoseTrack. In this case, observations for object states $\{ \hat { \mathcal { Z } } _ { t } \} _ { t = 1 } ^ { T }$ are given for all the frames $\{ I _ { t } \} _ { t = 1 } ^ { T }$ , typically via the output of a pre-trained detector. The goal here is to form trajectories by connecting observations across adjacent frames according to their identity.
|
| 91 |
+
|
| 92 |
+
Association algorithm. We adopt the association algorithm proposed in JDE [65] for MOT, MOTS and PoseTrack tasks, of which detailed description can be found in Appendix C.1. In summary, we compute an $N \times M$ distance matrix between $N$ already-existing tracklets and $M$ “new” detections from the last processed frame. We then use the Hungarian algorithm [30] to determine pairs of matches between tracklets and detections, using the distance matrix as input. To obtain the matrix of distances used by the algorithm, we compute the linear combination of two terms accounting for motion and appearance cues. For the former, we compute a matrix indicating how likely a detection corresponds to the object state predicted by a Kalman Filter [28]. Instead, the appearance component is directly computed by using feature-map representations obtained by processing individual frames with the appearance model (Section 2.2). While object-level features for box and mask observations can be directly obtained by cropping frame-level feature maps, when an object is represented via a pose it first needs to be converted to a mask (via a procedure described in Appendix C.2).
|
| 93 |
+
|
| 94 |
+
A key issue of this scenario is how to measure similarities between object-level features. We find existing methods limited. First, objects are often compared by computing the cosine similarity of average-pooled object-level feature maps [84, 51]. However, the operation of average inherently discards local information, which is important for fine-grained recognition. Approaches [18, 52] that instead to some extent do preserve fine-grained information, such as those computing the cosine similarity of (flattened) feature maps, do not support objects with differently-sized representation (situation that occurs for instance with pixel-level masks). To cope with the above limitations, we propose a reconstruction-based similarity metric that is able to deal with different observation formats, while still preserving fine-grained information.
|
| 95 |
+
|
| 96 |
+
Reconstruction Similarity Metric (RSM). Let $\{ t _ { i } \} _ { i = 1 } ^ { N }$ denote the object-level features of $N$ existing tracklets, $t _ { i } \in \mathbb { R } ^ { s _ { t _ { i } } \times C }$ and $s _ { t _ { i } }$ indicates the spatial size of the object, i.e. the area of the box or the mask representing it. Similarly, $\{ d _ { j } \} _ { j = 1 } ^ { M }$ denotes the object-level features of $M$ new detections. With the goal of computing similarities to obtain an $N \times M$ affinity matrix to feed to the Hungarian algorithm, we propose a novel reconstruction-based similarity metric (RSM) between pairs $( i , j )$ , which is obtained as
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathrm { R S M } ( i , j ) = \frac { 1 } { 2 } ( \cos ( t _ { i } , \hat { t } _ { i j } ) + \cos ( d _ { j } , \hat { d } _ { j i } ) ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $\hat { t } _ { i j }$ represents $t _ { i }$ reconstructed from $d _ { j }$ and $\hat { d } _ { j i }$ represents $d _ { j }$ reconstructed from $t _ { i }$ . In multi-object tracking scenarios, observations are often incomplete due to frequent occlusions. As such, directly comparing features between incomplete and complete observations often fails because of misalignment between local features. Suppose $d _ { j }$ is a detection feature representing a severely occluded pedestrian, while $t _ { i }$ a tracklet feature representing the same person, but unoccluded. Likely, directly computing the cosine similarity between the two will not be very telling. RSM addresses this issue by introducing a step of reconstruction after which the co-occurring parts of point features will be better aligned, thus making the final similarity more likely to be meaningful.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 5: Reconstruction Similarity Metric (RSM): First, object-level features of existing tracklets and current detections are flattened and concatenated. Then, an affinity matrix between the two feature sets is computed. For a pair of tracklet $t _ { i }$ and detection $d _ { j }$ , we “extract” the corresponding sub-matrix from the entire affinity matrix as linear weights and reconstruct $t _ { i }$ from $d _ { j }$ using these linear weights. The similarity between the original object-level feature and its reconstructed version is finally taken as the RSM. We want the metric to be symmetric, so we perform reconstruction both forward $( t _ { i } d _ { j }$ ) and backward $( t _ { i } \to d _ { j }$ ).
|
| 106 |
+
|
| 107 |
+
The reconstructed object-level feature map $\hat { t } _ { i j }$ is a simple linear transformation of $d _ { j }$ , i.e. $\hat { t } _ { i j } = R _ { i j } d _ { j }$ , where $R _ { i j } \in \mathbb { R } ^ { s _ { t _ { i } } \times s _ { d _ { j } } }$ is a transformation matrix obtained as follows. We first flatten and concatenate all object-level features belonging to a tracklet (i.e. the set of observations corresponding to an object) into a single feature matrix $\begin{array} { r } { { \cal T } ~ \in ~ \mathbb { R } ^ { ( \sum _ { i } s _ { t _ { i } } ) \times C } } \end{array}$ . Similarly, we obtain all the object-level feature maps of a new set of detections $\begin{array} { r } { D \in \mathbb { R } ^ { ( \sum _ { j } s _ { d _ { j } } ) \times C } } \end{array}$ . Then, we compute the affinity matrix $A = \mathrm { S o f f m a x } ( T D ^ { \top } )$ and “extract” individual $R _ { i j }$ map$A$ propriate . For a sc $( i , j )$ tracklet-detection pair: tic representation of the p $R _ { i j } =$ $\begin{array} { r } { A \left[ \sum _ { i ^ { \prime } = 1 } ^ { i - 1 } s _ { i ^ { \prime } } : \sum _ { i ^ { \prime } = 1 } ^ { i } s _ { i ^ { \prime } } , \sum _ { j ^ { \prime } = 1 } ^ { j - 1 } s _ { j ^ { \prime } } : \sum _ { j ^ { \prime } = 1 } ^ { j } s _ { j ^ { \prime } } \right] } \end{array}$
|
| 108 |
+
just described, see Figure 5.
|
| 109 |
+
|
| 110 |
+
RSM can be interpreted from an attention [55] perspective. The feature map of a tracklet $t _ { i }$ being reconstructed can be seen as a set of queries, and the “source” detection feature $d _ { j }$ can be interpreted both as keys and values. The goal is to reconstruct the queries by linear combination of the values. The linear combination (attention) weights are computed using the affinity between queries and keys. Specifically, we first compute a global affinity matrix between $t _ { i }$ and all the $d _ { j ^ { \prime } }$ for $j ^ { \prime } = 1 , . . . , M$ , and then extract the corresponding sub-matrix for $t _ { i }$ and $d _ { j ^ { \prime } }$ as the attention weights. Our formulation leads to a desired property: if the attention weights approach zero, the corresponding reconstructed point vectors will approach zero and so the RSM between $t _ { i }$ and $d _ { j }$ .
|
| 111 |
+
|
| 112 |
+
Measuring similarity by reconstruction is popular in problems such as few-shot learning [67, 80], self-supervised learning [38], and person re-identification [26]. However, reconstruction is typically framed as a ridge regression or optimal transport problem. With $O ( n ^ { 2 } )$ complexity, RSM is more efficient than ridge regression and it has a similar computation cost to calculating the Earth Moving Distance for the optimal transport problem. Appendix D shows a series of ablation studies illustrating the importance of the proposed RSM for the effectiveness of UniTrack on association-type tasks.
|
| 113 |
+
|
| 114 |
+
# 3 Experiments
|
| 115 |
+
|
| 116 |
+
Since UniTrack does not require task-specific training, we were able to experiment with many alternative appearance models (see Figure 3) with little computational cost. In Section 3.1 we perform an extensive evaluation to benchmark a wide variety of off-the-shelf, modern self-supervised models, showing their strengths and weaknesses on all five tasks considered. In this section we also conduct a correlation study with the so-called “linear probe” strategy [81], which became a popular way to evaluate representations obtained with self-supervised learning. Then, in Section 3.2 we compare UniTrack (equipped with supervised or unsupervised appearance models) against recent and task-specific tracking methods.
|
| 117 |
+
|
| 118 |
+
Implementation details. We use ResNet-18 [25] or ResNet-50 as the default architecture. With ImageNet-supervised appearance model, we refer to the ImageNet pre-trained weights made available in PyTorch’s “Model Zoo”. To prevent excessive downsampling, we modify the spatial stride of layer3 and layer4 to 1, achieving a total stride of $r = 8$ . We extract features from both layer3 and layer4. We report results with layer3 features when comparing against task-specific methods (Section 3.2), and with both layer3 and layer4 when evaluating multiple different representations (Section 3.1). Further implementation details are deferred to Appendix B and C.
|
| 119 |
+
|
| 120 |
+
Datasets and evaluation metrics. For fair comparison with existing methods, we report results on standard benchmarks with conventional metrics for each task. Please refer to Appendix A for details.
|
| 121 |
+
|
| 122 |
+
# 3.1 UniTrack as evaluation platform of previously-learned representations
|
| 123 |
+
|
| 124 |
+
The process of evaluating representations obtained via self-supervised learning (SSL) often involves additional training [17, 24, 10], for instance via the use of linear probes [81], which require to fix the pre-trained model and train an additional linear classifier on top of it. In contrast, using UniTrack as evaluation platform (1) does not require any additional training and (2) enables the evaluation on a battery of important video tasks, which have generally been neglected in self-supervised-learning papers in favour of more established image-level tasks such as classification.
|
| 125 |
+
|
| 126 |
+
In this section, we evaluate three types of SSL representations: (a) Image-level representations learned from images, e.g. MoCo [24] and BYOL [21]; (b) Pixel-level representations learned from images (such as DetCo [72] and PixPro [73]) and (c) videos (such as UVC [35] and CRW [27]). For all methods considered, we use the pre-trained weights provided by the authors.
|
| 127 |
+
|
| 128 |
+
Results are shown in Table 1 and 2, where we report the results obtained by using features from either layer3 or layer4 of the pre-trained ResNet backbone. We report both results and separate them by a $\cdot / { \cdot }$ in the table. Note that, for this analysis only, for association-type tasks motion cues are discarded to better highlight distinctions between different representations and avoid potential confounding factors. Figure 1 provides a high-level summary of the results by focusing on the ranking obtained by different SSL methods on the five tasks considered (each represented by a vertex in the radar-style plot). Several observations can be made:
|
| 129 |
+
|
| 130 |
+
(1) There is no significant correlation between “linear probe accuracy” on ImageNet and overall tracking performance. The linear probe approach [81] has become a standard way to compare SSL representations. In Figure 6, we plot tracking performance on five tasks (y-axes) against ImageNet top-1 accuracy of 16 different models ( $\mathbf { \dot { X } }$ -axes), and report Pearson and Spearman (rank) correlation coefficients. We observe that the correlation between ImageNet accuracy and tracking performance is small, i.e. the Pearson’s $r$ ranges from $- 0 . 3 8$ to $+ 0 . 2 0$ , and Spearman’s $\rho$ ranges from $- 0 . 3 6$ to $+ 0 . 2 6$ . For most tasks, there is almost no correlation, while for VOS the two measures are mildly inversely correlated. The result suggests that evaluating SSL models on five extra tasks with UniTrack could constitute a useful complement to ImageNet linear probe evaluation, and encourage the SSL community to pursue the design of even more general purpose representations.
|
| 131 |
+
|
| 132 |
+
(2) A vanilla ImageNet-trained supervised representation is surprisingly effective across the board. On most tasks, it reports a performance competitive with the best representation for that task. This is particularly evident from Figure 1, where its performance is outlined as a gray dashed line. This result suggests that results obtained with vanilla ImageNet features should be reported when investigating new tracking methods.
|
| 133 |
+
|
| 134 |
+
(3) The best self-supervised representation ranks first on most tasks. Recently, it has been shown how SSL-trained representations can match or surpass their supervised counterparts on ImageNet classification (e.g. [21]) and many downstream tasks [17, 72]. Within UniTrack, although no individual SSL representation is able to beat the vanilla ImageNet-trained representation on every single task, we observe that the recently proposed VFS [74] ranks first on every task, except for single-object tracking. This suggests that advancements of the self-supervised learning literature can directly benefit the tracking community: it is reasonable to expect that newly-proposed representations will further improve performance across the board.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Representation</td><td colspan="2">SOT [70]</td><td>VOS [48]</td><td colspan="2">MOT [41]</td><td colspan="2">MOTS [57]</td><td colspan="2">PoseTrack [2]</td></tr><tr><td>AUCxCorr ↑</td><td>AUCDCF ↑</td><td>J-mean↑</td><td>IDF1个</td><td>HOTA↑</td><td>IDF1个</td><td>HOTA↑</td><td>IDF1个</td><td>IDs↓</td></tr><tr><td>Random Init.</td><td>10.3 /9.0</td><td>28.0 /20.0</td><td>29.3 /33.9</td><td>8.4/8.9</td><td>8.4/8.5</td><td>20.8 / 23.1</td><td>25.9 / 28.7</td><td>40.2 /38.5</td><td>88792/90963</td></tr><tr><td>ImageNet-sup.</td><td>58.6/49.5</td><td>62.0 / 53.9</td><td>62.3/57.9</td><td>75.6/73.2</td><td>63.3/ 61.8</td><td>68.4 /69.4</td><td>70.2/71.0</td><td>73.7/73.3</td><td>6969/7103</td></tr><tr><td>InsDis [71]</td><td>47.6 /47.3</td><td>61.8 / 51.1</td><td>62.6/ 60.1</td><td>66.7 /73.9</td><td>57.9 / 61.9</td><td>68.4 /68.0</td><td>69.6 /70.3</td><td>72.4 /73.9</td><td>7106 /7015</td></tr><tr><td>MoCoV1 [24]</td><td>50.9 /47.9</td><td>62.2/53.7</td><td>61.5 / 57.9</td><td>69.2 /74.1</td><td>59.4 / 61.9</td><td>70.6/ 69.3</td><td>71.6/70.9</td><td>72.8 / 739</td><td>6872/7092</td></tr><tr><td>PCLV1[34]</td><td>56.8/31.5</td><td>61.3/35.0</td><td>60.4/38.8</td><td>74.8/68.8</td><td>62.8 / 59.1</td><td>67.6 / 65.2</td><td>69.7 / 67.3</td><td>73.3 / 71.1</td><td>6855/10694</td></tr><tr><td>PIRL [42]</td><td>43.8 / 51.0</td><td>61.2 / 53.4</td><td>60.8/57.7</td><td>62.0 /73.4</td><td>54.6 / 61.9</td><td>66.0 / 67.4</td><td>66.7 /69.9</td><td>72.1/73.0</td><td>7235/7173</td></tr><tr><td>PCLV2 [34]</td><td>54.9/50.3</td><td>62.5 /51.6</td><td>61.2/52.5</td><td>74.9 /72.9</td><td>62.7/ 61.8</td><td>68.3/66.6</td><td>70.5/69.0</td><td>73.5/73.4</td><td>6859/ 8489</td></tr><tr><td>SimCLRV1[10]</td><td>47.3 / 51.9</td><td>61.3 / 50.7</td><td>60.5 /56.5</td><td>66.9 / 75.6</td><td>57.7 / 63.2</td><td>65.8 / 67.6</td><td>67.7 /69.5</td><td>72.3 /73.5</td><td>7084 /7367</td></tr><tr><td>MoCoV2 [12]</td><td>53.7 /47.2</td><td>61.5 /53.3</td><td>61.2 /54.0</td><td>72.0 / 74.9</td><td>61.2 / 62.8</td><td>67.5 /67.3</td><td>69.6 / 69.6</td><td>73.0 /73.7</td><td>6932 /7702</td></tr><tr><td>SimCLRV2[11]</td><td>50.0 / 54.7</td><td>61.7 /56.8</td><td>61.6 /58.4</td><td>67.6/75.7</td><td>58.1/ 63.3</td><td>69.1 / 67.4</td><td>70.4 / 69.4</td><td>72.5 /73.6</td><td>7228/7856</td></tr><tr><td>SeLaV2 [3]</td><td>51.0/9.6</td><td>63.1/14.2</td><td>60.2/40.2</td><td>68.8/68.9</td><td>59.0 / 59.3</td><td>66.8/66.1</td><td>68.7/ 68.5</td><td>72.9 /72.3</td><td>6983/7815</td></tr><tr><td>Infomin [53]</td><td>48.5/46.8</td><td>61.2 / 51.9</td><td>58.4/51.1</td><td>66.7 /73.4</td><td>57.6/61.9</td><td>66.7/66.3</td><td>68.5/68.8</td><td>72.5 /74.0</td><td>7066/7901</td></tr><tr><td>BarLow [79]</td><td>44.5/55.5</td><td>60.5 /60.1</td><td>61.7 / 57.8</td><td>63.7/74.5</td><td>55.4/62.4</td><td>68.7/67.4</td><td>69.5/ 69.8</td><td>72.3 /74.3</td><td>7131/7456</td></tr><tr><td>BYOL [21]</td><td>48.3/55.5</td><td>58.9 /56.8</td><td>58.8 / 54.3</td><td>65.3 /74.9</td><td>56.8 / 62.9</td><td>70.1/ 66.8</td><td>70.8 /69.3</td><td>72.4 / 73.8</td><td>7213/8032</td></tr><tr><td>DeepCluster [7]</td><td>51.5 / 52.9</td><td>61.2/61.2</td><td>59.3/53.4</td><td>66.9 /75.1</td><td>57.8 / 63.5</td><td>67.7 /67.4</td><td>69.4 /69.8</td><td>72.7 /73.7</td><td>7018/7283</td></tr><tr><td>SwAV [8]</td><td>49.2/52.4 51.1/45.3</td><td>61.5 /59.4 60.3/43.8</td><td>59.4/57.0</td><td>65.6/74.4</td><td>56.9 / 62.3</td><td>68.8/67.0</td><td>69.9 /69.5</td><td>72.7 /73.6</td><td>7025 /7377</td></tr><tr><td>VFS [74]</td><td></td><td></td><td>62.8/56.8</td><td>74.1/ 77.0</td><td>62.6 / 63.9</td><td>71.0/ 68.0</td><td>72.1/70.4</td><td>73.3/74.2</td><td>6731/7091</td></tr><tr><td>PixPro [73]</td><td>40.5 /49.2</td><td>57.4 /49.3</td><td>56.4/52.2</td><td>61.7 /67.7</td><td>54.3/58.6</td><td>64.2/66.2</td><td>65.1/67.6</td><td>72.4 / 73.1</td><td>7163 /6953</td></tr><tr><td>DetCo [72]</td><td>55.0/47.1</td><td>59.0/53.2</td><td>62.3/56.1</td><td>75.3 /72.9</td><td>62.8/61.6</td><td>67.8/66.8</td><td>70.0 /69.4</td><td>73.9/73.3</td><td>7357/8009</td></tr><tr><td>TimeCycle [64]</td><td>43.8 / 24.2</td><td>57.5/48.7</td><td>51.8 / 48.9</td><td>68.7 / 28.2</td><td>59.3 /25.5</td><td>69.9 / 47.1</td><td>71.3 /49.3</td><td>72.0 / 62.3</td><td>7837 /27884</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 1: Tracking performance of pre-trained image-based SSL models. All methods employ a ResNet-50.
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="3">Representation</td><td colspan="2">SOT [70]</td><td>vOS [48]</td><td colspan="2">MOT [41]</td><td colspan="2">MOTS [57]</td><td colspan="2">PoseTrack [2]</td></tr><tr><td>AUCxcorr 个</td><td>AUCDcF ↑</td><td>J-mean↑</td><td>IDF1↑</td><td>HOTA↑</td><td>IDF1个</td><td>HOTA↑</td><td>IDF1个</td><td>IDs↓</td></tr><tr><td>Random Init.</td><td>16.0 /18.2</td><td>36.1/ 32.1</td><td>33.0 /36.7</td><td>18.4 / 14.6</td><td>20.2 / 12.9</td><td>34.5 /33.1</td><td>39.9 /37.6</td><td>52.8 / 50.5</td><td>65317 /66230</td></tr><tr><td>ImageNet-sup.</td><td>55.0/46.2</td><td>61.8 / 52.6</td><td>58.4/46.7</td><td>74.8 / 74.5</td><td>62.7 / 62.1</td><td>67.6/ 68.6</td><td>69.8 / 70.5</td><td>72.7 / 73.2</td><td>6808 /7024</td></tr><tr><td>Color.[58]+mem.</td><td>41.6 /43.4</td><td>56.7 /58.7</td><td>53.6 / 59.7</td><td>64.9 / 62.8</td><td>56.8/55.5</td><td>68.8/66.1</td><td>69.4 / 66.3</td><td>72.4 / 72.6</td><td>6850/6778</td></tr><tr><td>UVC [35]</td><td>46.0/38.7</td><td>58.1/59.9</td><td>56.5 / 53.9</td><td>66.9/64.5</td><td>57.7/54.1</td><td>69.9 / 68.7</td><td>69.6 / 69.4</td><td>72.6/72.8</td><td>6843/ 6972</td></tr><tr><td>CRW [27]</td><td>46.3/49.1</td><td>58.9 / 54.9</td><td>63.2/60.7</td><td>67.8/73.0</td><td>58.4 / 61.7</td><td>69.0/71.3</td><td>69.2/71.9</td><td>72.7 /73.0</td><td>6799/6761</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 2: Tracking performance of pre-trained video-based SSL models. All methods employ a ResNet-18. In the above two tables, we report results with [layer3 / layer4] features in each cell, and the best performance between the two is bolded. We use the bolded values to rank the models in each column, and visualise (column-wise) better performance with darker cell colors. Best results in each column are underlined.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: Tracking performance is poorly correlated with ImageNet accuracy. On the $\mathbf { X }$ -axes we plot ImageNet linear probe top-1 accuracy and on the y-axes the tracking performance on five tracking datasets. Correlation coefficients (Spearman’s $\rho$ and Pearson’s $r$ ) are shown in the left bottom of each plot.
|
| 146 |
+
|
| 147 |
+
(4) Pixel-level SSL representations do not seem to have a consistent advantage in pixel-level tasks. In Table 2 and at the bottom of Table 1 we compare recent SSL representations trained with pixellevel proxy tasks: PixPro [73], DetCo [72], TimeCycle [64], Colorization [58], UVC [35] and Contrastive Random Walk (CRW) [27]. Considering that pixel-level models leverage more finegrained information during training, one may expect them to outperform image-based models in the tracking tasks where this is important. It is not straightforward to compare pixel-level SSL models with image-level ones, as the two types employ different default backbone networks. However, note how good image-based models (MoCo-v1, SimCLR-v2) are on par with their supervised counterpart in all tasks, while good pixel-level models (DetCo, CRW) still have gaps with respect to their supervised counterparts in tasks like SOT and MOT. Moreover, from Table 1, one can notice how the last three rows, despite representing methods leveraging pixel-level information during training, are actually outperformed by image-level representations on the pixel-level tasks of VOS, MOTS and PoseTrack.
|
| 148 |
+
|
| 149 |
+
(5) Video data can benefit representation learning for video tasks. The top-ranking VFS is similar to MoCo, SimCLR and BYOL in terms of learning scheme: they all perform contrastive learning on image level features. The most important distinction is the training data. Previous SSL methods mostly train on still-image based datasets (typically ImageNet), while VFS employs a large-scale video dataset Kinetics [9]. Clearly, this is not very surprising, as training on video data can help closing the domain gap with the (video-based) downstream tasks considered in this paper.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Methods</td><td>IDF1个</td><td>IDs↓</td><td>MOTA↑</td><td>HOTA↑</td></tr><tr><td>JDE [65]</td><td>55.8</td><td>1544</td><td>64.4</td><td>-</td></tr><tr><td>CTracker [47]</td><td>57.2</td><td>1897</td><td>67.6</td><td>48.8</td></tr><tr><td>TubeTK[46]</td><td>62.2</td><td>1236</td><td>66.9</td><td>50.8</td></tr><tr><td>MAT [23]</td><td>63.8</td><td>928</td><td>73.5</td><td>56.3</td></tr><tr><td>TraDes [69]</td><td>64.7</td><td>1144</td><td>70.1</td><td>53.2</td></tr><tr><td>CSTrack [36]</td><td>71.8</td><td>1071</td><td>70.7</td><td>59.8</td></tr><tr><td>FairMOT† [82]</td><td>72.8</td><td>1074</td><td>74.9</td><td>61.6</td></tr><tr><td>UniTrack_ImageNet†</td><td>71.8</td><td>683</td><td>74.7</td><td>59.1</td></tr><tr><td>UniTrack_VFS†</td><td>70.3</td><td>829</td><td>72.7</td><td>58.6</td></tr></table>
|
| 152 |
+
|
| 153 |
+
(a) MOT@MOT-16 [41] test split, private detection.
|
| 154 |
+
|
| 155 |
+
(b) MOTS@MOTS [57] test split.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Methods</td><td>IDF1个</td><td>IDs↓</td><td>sMOTA↑</td></tr><tr><td>TrackRCNN [57]</td><td>42.4</td><td>567</td><td>40.6</td></tr><tr><td>SORTS [68]</td><td>57.3</td><td>577</td><td>55.0</td></tr><tr><td>PointTrack [76]</td><td>42.9</td><td>868</td><td>62.3</td></tr><tr><td>GMPHD [50]</td><td>65.6</td><td>566</td><td>69.0</td></tr><tr><td>COSTAt [1]</td><td>70.3</td><td>421</td><td>69.5</td></tr><tr><td>UniTrack_ImageNet†</td><td>67.2</td><td>622</td><td>68.9</td></tr><tr><td>UniTrack_VFSt</td><td>68.2</td><td>342</td><td>69.7</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 3: Comparison with task-tailored unsupervised and supervised methods on five typical tracking tasks. $\dagger$ indicates methods using identical observations.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Methods</td><td>IDF1个</td><td>IDs↓</td><td>MOTA↑</td></tr><tr><td>MDPN [22]</td><td>=</td><td>-</td><td>50.6</td></tr><tr><td>OpenSVAI [44]</td><td></td><td>-</td><td>62.4</td></tr><tr><td>Miracle [78]</td><td></td><td>=</td><td>64.0</td></tr><tr><td>KeyTrack [49]</td><td></td><td>-</td><td>66.6</td></tr><tr><td>TWVA [19]</td><td>=</td><td>=</td><td>64.7</td></tr><tr><td>LightTrack† [43]</td><td>52.2</td><td>3024</td><td>64.8</td></tr><tr><td>UniTrack_ImageNet†</td><td>73.2</td><td>6760</td><td>63.5</td></tr><tr><td>UniTrack_VFS†</td><td>74.2</td><td>7091</td><td>63.3</td></tr></table>
|
| 162 |
+
|
| 163 |
+
(c) PoseTrack@PoseTrack2018 [2] val split.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Methods</td><td>J-mean↑</td></tr><tr><td>Supervised:</td><td></td></tr><tr><td>SiamMask [62]</td><td>54.3</td></tr><tr><td>FEELVOS [56]</td><td>63.7</td></tr><tr><td>STM [45]</td><td>79.2</td></tr><tr><td>Unsupervised:</td><td></td></tr><tr><td>Colorization [58]</td><td>34.6</td></tr><tr><td>TimeCylce [64]</td><td>40.1</td></tr><tr><td>UVC [35]</td><td>56.7</td></tr><tr><td>CRW [27]</td><td>64.8</td></tr><tr><td>UniTrack_ImageNet</td><td>58.4</td></tr><tr><td>UniTrack_VFS</td><td>62.8</td></tr></table>
|
| 166 |
+
|
| 167 |
+
(d) VOS@DAVIS-2017 [48].
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Methods</td><td>AUC↑</td></tr><tr><td>Supervised:</td><td></td></tr><tr><td>SiamFC[5]</td><td>58.2</td></tr><tr><td>SiamRPN [33]</td><td>63.7</td></tr><tr><td>SiamRPN++ [32]</td><td>69.6</td></tr><tr><td>Unsupervised:</td><td></td></tr><tr><td>UDT [59]</td><td>59.4</td></tr><tr><td>UDT+[59]</td><td>63.2</td></tr><tr><td>LUDT [60]</td><td>60.2</td></tr><tr><td>LUDT+ [60]</td><td>63.9</td></tr><tr><td>UniTrack_ImageNet_XCorr</td><td>55.5</td></tr><tr><td>UniTrack_ImageNet_DCF</td><td>61.8</td></tr><tr><td>UniTrack_VFS_DCF</td><td>60.3</td></tr></table>
|
| 170 |
+
|
| 171 |
+
(e) SOT@OTB-2015 [70].
|
| 172 |
+
|
| 173 |
+
# 3.2 Comparison with task-specific tracking methods
|
| 174 |
+
|
| 175 |
+
Unsupervised methods. We observe that UniTrack performs competitively against unsupervised state-of-the-art methods in both the propagation-type tasks we considered (Table 3d and 3e). For SOT, UniTrack with a DCF head [61] outperforms UDT [59] (a strong recent method) by 2.4 AUC points, while it is surpassed by LUDT $^ +$ [60] by 2.1 points. Considering that LUDT $^ +$ adopts an additional online template update mechanism [13] while ours does not, we believe the gap could be closed. In VOS, existing unsupervised methods are usually trained on video datasets [35, 27], and some of the most recent outperform UniTrack (with an ImageNet-trained representation). Nonetheless, when we use a VFS-trained representation, this performance difference is reduced to $2 \%$ . Finally, note that for association-type tasks we are not aware of any existing unsupervised learning method, and thus in this case we limit the comparison to supervised methods.
|
| 176 |
+
|
| 177 |
+
Comparison with supervised methods. In general, UniTrack with a ResNet-18 appearance model already performs on par with several existing task-specific supervised methods, and in several tasks it even shows superior accuracy, especially for identity-related metrics. (1) For SOT, UniTrack with a DCF head outperforms SiamFC [5] by 3.6 AUC points. This is a significant margin considering that SiamFC is trained with a large amount of crops from video datasets with annotated bounding boxes. (2) For VOS, UniTrack surpasses SiamMask [62] by 4.1 $\mathcal { I }$ -mean points, despite this being trained on the joint set of three large-scale video datasets [37, 14, 75]. (3) For MOT, we employ the same detections used by the state-of-the-art tracker FairMOT [82]. The appearance embedding in FairMOT is trained with 270K bounding boxes of 8.7K labeled identities, from a MOT-specific dataset. In contrast, despite our appearance model not being trained with any MOT-specific data, our IDF1 score is quite competitive (71.8 v.s. 72.8 of FairMOT), and the ID switches are considerably reduced by $3 6 . { \overset { - } { 4 } } \%$ , from 1074 to 683. (4) For MOTS, we start from the same segmentation masks used by the COSTA [1] tracker, and observe a degradation in terms of ID switches (622 vs the 421 of the state of the art), and also a gap in IDF1 and sMOTA. (5) Finally, for pose tracking, we employ the same pose estimator used by LightTrack [43]. Compared with LightTrack, the MOTA of UniTrack degrades of 1.3 points because of an increased amount of ID switches. However, the IDF-1 score is improved by a significant margin $( + 2 1 . 0 $ points). This shows UniTrack preserves identity more accurately for long tracklets: even if ID switches occur more frequently, after a short period UniTrack is able to correct the wrong association, leading to a higher IDF-1.
|
| 178 |
+
|
| 179 |
+
Notice how, overall, UniTrack obtains more competitive performance on tasks that have association at their core, i.e. MOT, MOTS and PoseTrack. Upon inspection, we observed that most failure cases in propagation-type tasks regard the “drift” occurring when the scale of the object is improperly estimated. In future work, this could be addressed for instance by a bounding-box regression module to refine predictions, or by carefully designing a motion model. For association-type tasks, the consequences of any type of inaccuracy are isolated to individual pairs of frames, and thus much less catastrophic by nature.
|
| 180 |
+
|
| 181 |
+
# 4 Related Work
|
| 182 |
+
|
| 183 |
+
To the best of our knowledge, sharing the appearance model across multiple tracking tasks has not been extensively studied in the computer vision literature, and especially not in the context of SSL representations. Some existing methods do share a common backbone architecture across tasks. For instance, STEm-Seg [4] addresses VIS [77] and MOTS; while TraDeS [69] addresses MOT, MOTS and VIS. However, both methods need to be trained separately and on different datasets for every task. Conversely, we reuse the same representation across five tasks. A promising direction for future work would be to use UniTrack to train a shared representation in a multi-task fashion. Only a few relevant works do adopt a multi-task approach [62, 83, 40], and they usually consider SOT and VOS tasks only. In general, despite the multi-task direction being surely interesting, it requires the availability of large-scale datasets with annotations in multiple formats, and costly training. These are two of the main reasons for which we believe that having a framework that allows to achieve competitive performance on multiple tasks with previously-trained models is a worthwhile endeavour.
|
| 184 |
+
|
| 185 |
+
Self-supervised model evaluation. Given the difference between the pretext tasks used to train self-supervised models and the downstream tasks used to evaluate them, the comparison between self-supervised approaches has always been a delicate matter. Existing evaluation strategies typically require additional training once a general-purpose representation has been obtained. One strategy keeps the representation fixed, and then trains additional task-specific heads with very limited capacity (e.g. a linear classifier [20, 10, 24] or a regression head for object detection [20]). A second strategy, instead, leverages SSL to obtain particularly effective initializations, and then proceeds to fine-tune such initialized models on the downstream task of interest. A wider range of tasks can be tested using this setup, such as semantic segmentation [17, 20] and surface normal estimation [20, 63]. In contrast, UniTrack provides a simpler way to evaluate SSL models, one that does not require additional training or fine-tuning. Also, this work is the first to extend SSL evaluation to a set of diverse video tasks. We believe this contribution will allow the study of self-supervised learning methods with a broader scope of applicability. Our work is also related to a line of self-supervised learning methods [27, 58, 35, 31] that learn their representations in a task-agnostic fashion, and then test it on propagation tasks (SOT and VOS). The design of UniTrack is inspired by their task-agnostic philosophy, while significantly extending their scope to a new set of tasks.
|
| 186 |
+
|
| 187 |
+
# 5 Conclusion
|
| 188 |
+
|
| 189 |
+
Do different tracking tasks require different appearance models? In order to address this question, the proposed UniTrack framework has been instrumental, as it has allowed to easily experiment with alternative representations on a wide variety of downstream problems. Although the answer is not a resounding “no”, as only sometimes a single shared appearance model can outperform dedicated methods, we argue that a unified framework is an appealing alternative to task-specific methods. The main reason is that it allows us to make the most of the progress made in the representation learning literature at no extra cost. With the rapid development of self-supervised learning, and the large amount of computational resources dedicated to it, we believe it is reasonable to expect that, in the future, a general-purpose representation will be able to outperform task-specific methods across the board. Until then, UniTrack could still serve as a useful evaluation tool for novel representations, especially considering the lack of correlation with the standard linear-probe approach. We believe this will encourage the community to develop self-supervised representations that are of “general purpose” in a broader sense.
|
| 190 |
+
|
| 191 |
+
Broader impact. Upon reflection, we believe that progress in tracking applications and selfsupervised learning is beneficial for society, as it can significantly impact (for instance) the development of autonomous vehicles, which we consider a net positive for society. We also recognise that the same technologies could constitute a threat if deployed for surveillance by entities hostile to civil liberties.
|
| 192 |
+
|
| 193 |
+
# 6 Funding Transparency Statement
|
| 194 |
+
|
| 195 |
+
This work was supported by the National Natural Science Foundation of China under Grant No. 61771288, Cross-Media Intelligent Technology Project of Beijing National Research Center for Information Science and Technology (BNRist) under Grant No. BNR2019TD01022 and the research fund under Grant No. 2019GQG0001 from the Institute for Guo Qiang, Tsinghua University.
|
| 196 |
+
|
| 197 |
+
This work was also supported by the EPSRC grant: Turing AI Fellowship: EP/W002981/1, EPSRC/MURI grant EP/N019474/1. We would also like to thank the Royal Academy of Engineering and FiveAI.
|
| 198 |
+
|
| 199 |
+
# References
|
| 200 |
+
|
| 201 |
+
[1] Costa_st tracker. https://motchallenge.net/method/MOTS 87&chl=17.
|
| 202 |
+
[2] Mykhaylo Andriluka, Umar Iqbal, Eldar Insafutdinov, Leonid Pishchulin, Anton Milan, Juergen Gall, and Bernt Schiele. Posetrack: A benchmark for human pose estimation and tracking. In CVPR, 2018.
|
| 203 |
+
[3] Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. In ICLR, 2020.
|
| 204 |
+
[4] Ali Athar, Sabarinath Mahadevan, Aljoša Ošep, Laura Leal-Taixé, and Bastian Leibe. Stem-seg: Spatiotemporal embeddings for instance segmentation in videos. In ECCV, 2020.
|
| 205 |
+
[5] Luca Bertinetto, Jack Valmadre, Joao F Henriques, Andrea Vedaldi, and Philip HS Torr. Fully-convolutional siamese networks for object tracking. In ECCV workshops, 2016.
|
| 206 |
+
[6] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv:2005.14165, 2020.
|
| 207 |
+
[7] Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In ECCV, 2018.
|
| 208 |
+
[8] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2018.
|
| 209 |
+
[9] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In CVPR, 2017.
|
| 210 |
+
[10] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. 2020.
|
| 211 |
+
[11] Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv:2006.10029, 2020.
|
| 212 |
+
[12] Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv:2003.04297, 2020.
|
| 213 |
+
[13] Martin Danelljan, Goutam Bhat, Fahad Shahbaz Khan, and Michael Felsberg. Eco: Efficient convolution operators for tracking. In CVPR, 2017.
|
| 214 |
+
[14] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 215 |
+
[15] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. 2018.
|
| 216 |
+
[16] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In ICCV, 2015.
|
| 217 |
+
[17] Linus Ericsson, Henry Gouk, and Timothy M Hospedales. How well do self-supervised models transfer? In CVPR, 2021.
|
| 218 |
+
[18] Masoud Faraki, Xiang Yu, Yi-Hsuan Tsai, Yumin Suh, and Manmohan Chandraker. Cross-domain similarity learning for face recognition in unseen domains. arXiv:2103.07503, 2021.
|
| 219 |
+
[19] Yang Fu, Sifei Liu, Umar Iqbal, Shalini De Mello, Humphrey Shi, and Jan Kautz. Learning to track instances without video annotations. In CVPR, 2021.
|
| 220 |
+
[20] Priya Goyal, Dhruv Mahajan, Abhinav Gupta, and Ishan Misra. Scaling and benchmarking self-supervised visual representation learning. arXiv:1905.01235, 2019.
|
| 221 |
+
[21] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv:2006.07733, 2020.
|
| 222 |
+
[22] Hengkai Guo, Tang Tang, Guozhong Luo, Riwei Chen, Yongchen Lu, and Linfu Wen. Multi-domain pose network for multi-person pose estimation and tracking. In ECCV, workshop, 2018.
|
| 223 |
+
[23] Shoudong Han, Piao Huang, Hongwei Wang, En Yu, Donghaisheng Liu, Xiaofeng Pan, and Jun Zhao. Mat: Motion-aware multi-object tracking. arXiv:2009.04794, 2020. visual representation learning. In CVPR, 2020.
|
| 224 |
+
[25] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 225 |
+
[26] Lingxiao He, Jian Liang, Haiqing Li, and Zhenan Sun. Deep spatial feature reconstruction for partial person re-identification: Alignment-free approach. In CVPR, 2018.
|
| 226 |
+
[27] Allan Jabri, Andrew Owens, and Alexei A Efros. Space-time correspondence as a contrastive random walk. In NeurIPS, 2020.
|
| 227 |
+
[28] Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. 1960.
|
| 228 |
+
[29] Matej Kristan, Jiri Matas, Aleš Leonardis, Tomáš Vojíˇr, Roman Pflugfelder, Gustavo Fernandez, Georg Nebehay, Fatih Porikli, and Luka Cehovin. A novel performance evaluation methodology for single-target ˇ trackers. IEEE TPAMI, 2016.
|
| 229 |
+
[30] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
|
| 230 |
+
[31] Zihang Lai, Erika Lu, and Weidi Xie. Mast: A memory-augmented self-supervised tracker. In CVPR, 2020.
|
| 231 |
+
[32] Bo Li, Wei Wu, Qiang Wang, Fangyi Zhang, Junliang Xing, and Junjie Yan. Siamrpn $^ { + + }$ : Evolution of siamese visual tracking with very deep networks. In CVPR, 2019.
|
| 232 |
+
[33] Bo Li, Junjie Yan, Wei Wu, Zheng Zhu, and Xiaolin Hu. High performance visual tracking with siamese region proposal network. In CVPR, 2018.
|
| 233 |
+
[34] Junnan Li, Pan Zhou, Caiming Xiong, Richard Socher, and Steven CH Hoi. Prototypical contrastive learning of unsupervised representations. In ICLR, 2021.
|
| 234 |
+
[35] Xueting Li, Sifei Liu, Shalini De Mello, Xiaolong Wang, Jan Kautz, and Ming-Hsuan Yang. Joint-task self-supervised learning for temporal correspondence. In NeurIPS, 2019.
|
| 235 |
+
[36] Chao Liang, Zhipeng Zhang, Yi Lu, Xue Zhou, Bing Li, Xiyong Ye, and Jianxiao Zou. Rethinking the competition between detection and reid in multi-object tracking. arXiv:2010.12138, 2020.
|
| 236 |
+
[37] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
|
| 237 |
+
[38] Songtao Liu, Zeming Li, and Jian Sun. Self-emd: Self-supervised object detection without imagenet. arXiv:2011.13677, 2020.
|
| 238 |
+
[39] Jonathan Long, Ning Zhang, and Trevor Darrell. Do convnets learn correspondence? In NeurIPS, 2014.
|
| 239 |
+
[40] Alan Lukezic, Jiri Matas, and Matej Kristan. D3s-a discriminative single shot segmentation tracker. In CVPR, 2020.
|
| 240 |
+
[41] Anton Milan, Laura Leal-Taixé, Ian Reid, Stefan Roth, and Konrad Schindler. Mot16: A benchmark for multi-object tracking. arXiv:1603.00831, 2016.
|
| 241 |
+
[42] Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. In CVPR, 2020.
|
| 242 |
+
[43] Guanghan Ning and Heng Huang. Lighttrack: A generic framework for online top-down human pose tracking. In CVPR, workshop, 2020.
|
| 243 |
+
[44] Guanghan Ning, Ping Liu, Xiaochuan Fan, and Chi Zhang. A top-down approach to articulated human pose estimation and tracking. In ECCV, workshop, 2018.
|
| 244 |
+
[45] Seoung Wug Oh, Joon-Young Lee, Ning Xu, and Seon Joo Kim. Video object segmentation using space-time memory networks. In ICCV, 2019.
|
| 245 |
+
[46] Bo Pang, Yizhuo Li, Yifan Zhang, Muchen Li, and Cewu Lu. Tubetk: Adopting tubes to track multi-object in a one-step training model. In CVPR, 2020.
|
| 246 |
+
[47] Jinlong Peng, Changan Wang, Fangbin Wan, Yang Wu, Yabiao Wang, Ying Tai, Chengjie Wang, Jilin Li, Feiyue Huang, and Yanwei Fu. Chained-tracker: Chaining paired attentive regression results for end-to-end joint multiple-object detection and tracking. In ECCV, 2020.
|
| 247 |
+
[48] F. Perazzi, J. Pont-Tuset, B. McWilliams, L. Van Gool, M. Gross, and A. Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In CVPR, 2016.
|
| 248 |
+
[49] Michael Snower, Asim Kadav, Farley Lai, and Hans Peter Graf. 15 keypoints is all you need. In CVPR, 2020.
|
| 249 |
+
[50] Young-min Song and Moongu Jeon. Online multi-object tracking and segmentation with gmphd filter and simple affinity fusion. arXiv:2009.00100, 2020.
|
| 250 |
+
[51] Yifan Sun, Qin Xu, Yali Li, Chi Zhang, Yikang Li, Shengjin Wang, and Jian Sun. Perceive where to focus: Learning visibility-aware part-level features for partial person re-identification. In CVPR, 2019.
|
| 251 |
+
[52] Yifan Sun, Liang Zheng, Yi Yang, Qi Tian, and Shengjin Wang. Beyond part models: Person retrieval with refined part pooling (and a strong convolutional baseline). In ECCV, 2018.
|
| 252 |
+
[53] Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. In NeurIPS, 2020.
|
| 253 |
+
[54] Jack Valmadre, Luca Bertinetto, Joao Henriques, Andrea Vedaldi, and Philip HS Torr. End-to-end representation learning for correlation filter based tracking. In CVPR, 2017.
|
| 254 |
+
[55] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 255 |
+
[56] Paul Voigtlaender, Yuning Chai, Florian Schroff, Hartwig Adam, Bastian Leibe, and Liang-Chieh Chen. Feelvos: Fast end-to-end embedding learning for video object segmentation. In CVPR, 2019.
|
| 256 |
+
[57] Paul Voigtlaender, Michael Krause, Aljosa Osep, Jonathon Luiten, Berin Balachandar Gnana Sekar, Andreas Geiger, and Bastian Leibe. Mots: Multi-object tracking and segmentation. In CVPR, 2019.
|
| 257 |
+
[58] Carl Vondrick, Abhinav Shrivastava, Alireza Fathi, Sergio Guadarrama, and Kevin Murphy. Tracking emerges by colorizing videos. In ECCV, 2018.
|
| 258 |
+
[59] Ning Wang, Yibing Song, Chao Ma, Wengang Zhou, Wei Liu, and Houqiang Li. Unsupervised deep tracking. In CVPR, 2019.
|
| 259 |
+
[60] Ning Wang, Wengang Zhou, Yibing Song, Chao Ma, Wei Liu, and Houqiang Li. Unsupervised deep representation learning for real-time tracking. IJCV, 2020.
|
| 260 |
+
[61] Qiang Wang, Jin Gao, Junliang Xing, Mengdan Zhang, and Weiming Hu. Dcfnet: Discriminant correlation filters network for visual tracking. arXiv:1704.04057, 2017.
|
| 261 |
+
[62] Qiang Wang, Li Zhang, Luca Bertinetto, Weiming Hu, and Philip HS Torr. Fast online object tracking and segmentation: A unifying approach. In CVPR, 2019.
|
| 262 |
+
[63] Xiaolong Wang and Abhinav Gupta. Unsupervised learning of visual representations using videos. In ICCV, 2015.
|
| 263 |
+
[64] Xiaolong Wang, Allan Jabri, and Alexei A Efros. Learning correspondence from the cycle-consistency of time. In CVPR, 2019.
|
| 264 |
+
[65] Zhongdao Wang, Liang Zheng, Yixuan Liu, and Shengjin Wang. Towards real-time multi-object tracking. In ECCV, 2020.
|
| 265 |
+
[66] Shih-En Wei, Varun Ramakrishna, Takeo Kanade, and Yaser Sheikh. Convolutional pose machines. In CVPR, 2016.
|
| 266 |
+
[67] Davis Wertheimer, Luming Tang, and Bharath Hariharan. Fine-grained few-shot classification with feature map reconstruction networks. CVPR, 2021.
|
| 267 |
+
[68] Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In ICIP, 2017.
|
| 268 |
+
[69] Jialian Wu, Jiale Cao, Liangchen Song, Yu Wang, Ming Yang, and Junsong Yuan. Track to detect and segment: An online multi-object tracker. In CVPR, 2021.
|
| 269 |
+
[70] Yi Wu, Jongwoo Lim, and Ming-Hsuan Yang. Online object tracking: A benchmark. In CVPR, 2013.
|
| 270 |
+
[71] Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via non-parametric instance discrimination. In CVPR, 2018.
|
| 271 |
+
[72] Enze Xie, Jian Ding, Wenhai Wang, Xiaohang Zhan, Hang Xu, Zhenguo Li, and Ping Luo. Detco: Unsupervised contrastive learning for object detection. arXiv:2102.04803, 2021.
|
| 272 |
+
[73] Zhenda Xie, Yutong Lin, Zheng Zhang, Yue Cao, Stephen Lin, and Han Hu. Propagate yourself: Exploring pixel-level consistency for unsupervised visual representation learning. In CVPR, 2021.
|
| 273 |
+
[74] Jiarui Xu and Xiaolong Wang. Rethinking self-supervised correspondence learning: A video frame-level similarity perspective. arXiv:2103.17263, 2021.
|
| 274 |
+
[75] Ning Xu, Linjie Yang, Yuchen Fan, Jianchao Yang, Dingcheng Yue, Yuchen Liang, Brian Price, Scott Cohen, and Thomas Huang. Youtube-vos: Sequence-to-sequence video object segmentation. In ECCV, 2018.
|
| 275 |
+
[76] Zhenbo Xu, Wei Zhang, Xiao Tan, Wei Yang, Huan Huang, Shilei Wen, Errui Ding, and Liusheng Huang. Segment as points for efficient online multi-object tracking and segmentation. In ECCV, 2020.
|
| 276 |
+
[77] Linjie Yang, Yuchen Fan, and Ning Xu. Video instance segmentation. In ICCV, 2019.
|
| 277 |
+
[78] Dongdong Yu, Kai Su, Jia Sun, and Changhu Wang. Multi-person pose estimation for pose tracking with enhanced cascaded pyramid network. In ECCV, workshop, 2018.
|
| 278 |
+
[79] Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stéphane Deny. Barlow twins: Self-supervised learning via redundancy reduction. arXiv:2103.03230, 2021.
|
| 279 |
+
[80] 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.
|
| 280 |
+
[81] Richard Zhang, Phillip Isola, and Alexei A Efros. Split-brain autoencoders: Unsupervised learning by cross-channel prediction. In CVPR, 2017.
|
| 281 |
+
[82] Yifu Zhang, Chunyu Wang, Xinggang Wang, Wenjun Zeng, and Wenyu Liu. Fairmot: On the fairness of detection and re-identification in multiple object tracking. arXiv:2004.01888, 2020.
|
| 282 |
+
[83] Zhipeng Zhang, Bing Li, Weiming Hu, and Houweng Peng. Towards accurate pixel-wise object tracking by attention retrieval. arXiv:2008.02745, 2020.
|
| 283 |
+
[84] Kuan Zhu, Haiyun Guo, Zhiwei Liu, Ming Tang, and Jinqiao Wang. Identity-guided human semantic parsing for person re-identification. In ECCV, 2020.
|
md/train/HkIQH7qel/HkIQH7qel.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING RECURRENT SPAN REPRESENTATIONS FOR EXTRACTIVE QUESTION ANSWERING
|
| 2 |
+
|
| 3 |
+
Kenton Lee∗
|
| 4 |
+
University of Washington
|
| 5 |
+
Seattle, WA
|
| 6 |
+
kentonl@cs.washington.edu
|
| 7 |
+
Tom Kwiatkowski Ankur Parikh Dipanjan Das
|
| 8 |
+
Google
|
| 9 |
+
New York, NY
|
| 10 |
+
{tomkwiat, aparikh, dipanjand}@google.com
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
The reading comprehension task, that asks questions about a given evidence document, is a central problem in natural language understanding. Recent formulations of this task have typically focused on answer selection from a set of candidates pre-defined manually or through the use of an external NLP pipeline. However, Rajpurkar et al. (2016) recently released the SQUAD dataset in which the answers can be arbitrary strings from the supplied text. In this paper, we focus on this answer extraction task, presenting a novel model architecture that efficiently builds fixed length representations of all spans in the evidence document with a recurrent network. We show that scoring explicit span representations significantly improves performance over other approaches that factor the prediction into separate predictions about words or start and end markers. Our approach improves upon the best published results of Wang & Jiang (2016) by $5 \%$ and decreases the error of Rajpurkar et al.’s baseline by $\bar { > } 5 0 \%$ .
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
A primary goal of natural language processing is to develop systems that can answer questions about the contents of documents. The reading comprehension task is of practical interest – we want computers to be able to read the world’s text and then answer our questions – and, since we believe it requires deep language understanding, it has also become a flagship task in NLP research.
|
| 19 |
+
|
| 20 |
+
A number of reading comprehension datasets have been developed that focus on answer selection from a small set of alternatives defined by annotators (Richardson et al., 2013) or existing NLP pipelines that cannot be trained end-to-end (Hill et al., 2016; Hermann et al., 2015). Subsequently, the models proposed for this task have tended to make use of the limited set of candidates, basing their predictions on mention-level attention weights (Hermann et al., 2015), or centering classifiers (Chen et al., 2016), or network memories (Hill et al., 2016) on candidate locations.
|
| 21 |
+
|
| 22 |
+
Recently, Rajpurkar et al. (2016) released the less restricted SQUAD dataset1 that does not place any constraints on the set of allowed answers, other than that they should be drawn from the evidence document. Rajpurkar et al. proposed a baseline system that chooses answers from the constituents identified by an existing syntactic parser. This allows them to prune the $O ( N ^ { 2 } )$ answer candidates in each document of length $N$ , but it also effectively renders $2 0 . 7 \%$ of all questions unanswerable.
|
| 23 |
+
|
| 24 |
+
Subsequent work by Wang & Jiang (2016) significantly improve upon this baseline by using an endto-end neural network architecture to identify answer spans by labeling either individual words, or the start and end of the answer span. Both of these methods do not make independence assumptions about substructures, but they are susceptible to search errors due to greedy training and decoding.
|
| 25 |
+
|
| 26 |
+
In contrast, here we argue that it is beneficial to simplify the decoding procedure by enumerating all possible answer spans. By explicitly representing each answer span, our model can be globally normalized during training and decoded exactly during evaluation. A naive approach to building the $O ( N ^ { 2 } )$ spans of up to length $N$ would require a network that is cubic in size with respect to the passage length, and such a network would be untrainable. To overcome this, we present a novel neural architecture called RASOR that builds fixed-length span representations, reusing recurrent computations for shared substructures. We demonstrate that directly classifying each of the competing spans, and training with global normalization over all possible spans, leads to a significant increase in performance. In our experiments, we show an increase in performance over Wang & Jiang (2016) of $5 \%$ in terms of exact match to a reference answer, and $3 . 6 \%$ in terms of predicted answer F1 with respect to the reference. On both of these metrics, we close the gap between Rajpurkar et al.’s baseline and the human-performance upper-bound by $> 5 0 \%$ .
|
| 27 |
+
|
| 28 |
+
# 2 EXTRACTIVE QUESTION ANSWERING
|
| 29 |
+
|
| 30 |
+
# 2.1 TASK DEFINITION
|
| 31 |
+
|
| 32 |
+
Extractive question answering systems take as input a question $\mathbf { q } = \{ q _ { 0 } , \dots , q _ { n } \}$ and a passage of text $\mathbf { p } = \{ p _ { 0 } , \dots , p _ { m } \}$ from which they predict a single answer span $\mathbf { a } = \langle a _ { s t a r t } , a _ { e n d } \rangle$ , represented as a pair of indices into p. Machine learned extractive question answering systems, such as the one presented here, learn a predictor function $f ( \mathbf { q } , \mathbf { p } ) \mathbf { a }$ from a training dataset of $\langle \mathbf { q } , \mathbf { p } , \mathbf { a } \rangle$ triples.
|
| 33 |
+
|
| 34 |
+
# 2.2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
For the SQUAD dataset, the original paper from Rajpurkar et al. (2016) implemented a linear model with sparse features based on $n$ -grams and part-of-speech tags present in the question and the candidate answer. Other than lexical features, they also used syntactic information in the form of dependency paths to extract more general features. They set a strong baseline for following work and also presented an in depth analysis, showing that lexical and syntactic features contribute most strongly to their model’s performance. Subsequent work by Wang & Jiang (2016) use an end-to-end neural network method that uses a Match-LSTM to model the question and the passage, and uses pointer networks (Vinyals et al., 2015) to extract the answer span from the passage. This model resorts to greedy decoding and falls short in terms of performance compared to our model (see Section 5 for more detail). While we only compare to published baselines, there are other unpublished competitive systems on the SQUAD leaderboard, as listed in footnote 5.
|
| 37 |
+
|
| 38 |
+
A task that is closely related to extractive question answering is the Cloze task (Taylor, 1953), in which the goal is to predict a concealed span from a declarative sentence given a passage of supporting text. Recently, Hermann et al. (2015) presented a Cloze dataset in which the task is to predict the correct entity in an incomplete sentence given an abstractive summary of a news article. Hermann et al. also present various neural architectures to solve the problem. Although this dataset is large and varied in domain, recent analysis by Chen et al. (2016) shows that simple models can achieve close to the human upper bound. As noted by the authors of the SQUAD paper, the annotated answers in the SQUAD dataset are often spans that include non-entities and can be longer phrases, unlike the Cloze datasets, thus making the task more challenging.
|
| 39 |
+
|
| 40 |
+
Another, more traditional line of work has focused on extractive question answering on sentences, where the task is to extract a sentence from a document, given a question. Relevant datasets include datasets from the annual TREC evaluations (Voorhees & Tice, 2000) and WikiQA (Yang et al., 2015), where the latter dataset specifically focused on Wikipedia passages. There has been a line of interesting recent publications using neural architectures, focused on this variety of extractive question answering (Tymoshenko et al., 2016; Wang et al., 2016, inter alia). These methods model the question and a candidate answer sentence, but do not focus on possible candidate answer spans that may contain the answer to the given question. In this work, we focus on the more challenging problem of extracting the precise answer span.
|
| 41 |
+
|
| 42 |
+
# 3 MODEL
|
| 43 |
+
|
| 44 |
+
We propose a model architecture called RASOR2 illustrated in Figure 1, that explicitly computes embedding representations for candidate answer spans. In most structured prediction problems (e.g. sequence labeling or parsing), the number of possible output structures is exponential in the input length, and computing representations for every candidate is prohibitively expensive. However, we exploit the simplicity of our task, where we can trivially and tractably enumerate all candidates. This facilitates an expressive model that computes joint representations of every answer span, that can be globally normalized during learning.
|
| 45 |
+
|
| 46 |
+
In order to compute these span representations, we must aggregate information from the passage and the question for every answer candidate. For the example in Figure 1, RASOR computes an embedding for the candidate answer spans: fixed to, fixed to the, to the, etc. A naive approach for these aggregations would require a network that is cubic in size with respect to the passage length. Instead, our model reduces this to a quadratic size by reusing recurrent computations for shared substructures (i.e. common passage words) from different spans.
|
| 47 |
+
|
| 48 |
+
Since the choice of answer span depends on the original question, we must incorporate this information into the computation of the span representation. We model this by augmenting the passage word embeddings with additional embedding representations of the question.
|
| 49 |
+
|
| 50 |
+
In this section, we motivate and describe the architecture for RASOR in a top-down manner.
|
| 51 |
+
|
| 52 |
+
# 3.1 SCORING ANSWER SPANS
|
| 53 |
+
|
| 54 |
+
The goal of our extractive question answering system is to predict the single best answer span among all candidates from the passage $\mathbf { p }$ , denoted as $\mathbf { A } ( \mathbf { p } )$ . Therefore, we define a probability distribution over all possible answer spans given the question $\mathbf { q }$ and passage $\mathbf { p }$ , and the predictor function finds the answer span with the maximum likelihood:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
f ( \mathbf { q } , \mathbf { p } ) : = \underset { \mathbf { a } \in \mathbf { A } ( \mathbf { p } ) } { \operatorname { a r g m a x } } P ( \mathbf { a } \mid \mathbf { q } , \mathbf { p } )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
One might be tempted to introduce independence assumptions that would enable cheaper decoding. For example, this distribution can be modeled as (1) a product of conditionally independent distributions (binary) for every word or (2) a product of conditionally independent distributions (over words) for the start and end indices of the answer span. However, we show in Section 5.2 that such independence assumptions hurt the accuracy of the model, and instead we only assume a fixed-length representation $h _ { \mathbf { a } }$ of each candidate span that is scored and normalized with a softmax layer (Span score and Softmax in Figure 1):
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
{ \begin{array} { r } { s _ { \mathbf { a } } = w _ { a } \cdot { \mathrm { F F N N } } ( h _ { \mathbf { a } } ) \qquad { \mathrm { ~ } } \mathbf { a } \in \mathbf { A } ( \mathbf { p } ) } \\ { P ( \mathbf { a } \mid \mathbf { q } , \mathbf { p } ) = { \frac { \exp \left( s _ { \mathbf { a } } \right) } { \sum _ { \mathbf { a ^ { \prime } } \in \mathbf { A } ( \mathbf { p } ) } \exp \left( s _ { \mathbf { a ^ { \prime } } } \right) } } \qquad \mathbf { a } \in \mathbf { A } ( \mathbf { p } ) } \end{array} }
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\mathrm { F F N N } ( \cdot )$ denotes a fully connected feed-forward neural network that provides a non-linear mapping of its input embedding, and $w _ { a }$ denotes a learned vector for scoring the last layer of the feed-forward neural network.
|
| 67 |
+
|
| 68 |
+
# 3.2 RASOR: RECURRENT SPAN REPRESENTATION
|
| 69 |
+
|
| 70 |
+
The previously defined probability distribution depends on the answer span representations, $h _ { \mathbf { a } }$ . When computing $h _ { \mathbf { a } }$ , we assume access to representations of individual passage words that have been augmented with a representation of the question. We denote these question-focused passage word embeddings as $\{ p _ { 1 } ^ { * } , \ldots , p _ { m } ^ { * } \}$ and describe their creation in Section 3.3. In order to reuse computation for shared substructures, we use a bidirectional LSTM (Hochreiter & Schmidhuber, 1997) to encode the left and right context of every $p _ { i } ^ { * }$ (Passage-level BiLSTM in Figure 1). This allows us to simply concatenate the bidirectional LSTM (BiLSTM) outputs at the endpoints of a span to jointly encode its inside and outside information (Span embedding in Figure 1):
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { r l } { { \{ p _ { 1 } ^ { * { \prime } } , \ldots , p _ { m } ^ { * { \prime } } \} } = \mathrm { { B I L S T M } } ( \{ p _ { 1 } ^ { * } , \ldots , p _ { m } ^ { * } \} ) } \\ { { h _ { \mathbf { a } } } = [ p _ { a _ { s t a r t } } ^ { * { \prime } } , p _ { a _ { e n d } } ^ { * { \prime } } ] ~ } & { { } \qquad \langle a _ { s t a r t } , a _ { e n d } \rangle \in \mathbf { A } ( \mathbf { p } ) } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where BILSTM $( \cdot )$ denotes a BiLSTM over its input embedding sequence and $p _ { i } ^ { * \prime }$ is the concatenation of forward and backward outputs at time-step $i$ . While the visualization in Figure 1 shows a single layer BiLSTM for simplicity, we use a multi-layer BiLSTM in our experiments. The concatenated output of each layer is used as input for the subsequent layer, allowing the upper layers to depend on the entire passage.
|
| 77 |
+
|
| 78 |
+
# 3.3 QUESTION-FOCUSED PASSAGE WORD EMBEDDING
|
| 79 |
+
|
| 80 |
+
Computing the question-focused passage word embeddings $\{ p _ { 1 } ^ { * } , \ldots , p _ { m } ^ { * } \}$ requires integrating question information into the passage. The architecture for this integration is flexible and likely depends on the nature of the dataset. For the SQUAD dataset, we find that both passage-aligned and passageindependent question representations are effective at incorporating this contextual information, and experiments will show that their benefits are complementary. To incorporate these question representations, we simply concatenate them with the passage word embeddings (Question-focused passage word embedding in Figure 1).
|
| 81 |
+
|
| 82 |
+
We use fixed pretrained embeddings to represent question and passage words. Therefore, in the following discussion, notation for the words are interchangeable with their embedding representations.
|
| 83 |
+
|
| 84 |
+
Question-independent passage word embedding The first component simply looks up the pretrained word embedding for the passage word, $p _ { i }$ .
|
| 85 |
+
|
| 86 |
+
Passage-aligned question representation In this dataset, the question-passage pairs often contain large lexical overlap or similarity near the correct answer span. To encourage the model to exploit these similarities, we include a fixed-length representation of the question based on soft alignments with the passage word. The alignments are computed via neural attention (Bahdanau et al., 2014), and we use the variant proposed by Parikh et al. (2016), where attention scores are dot products between non-linear mappings of word embeddings.
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
{ \begin{array} { r l r l } & { s _ { i j } = { \mathrm { F F N N } } ( p _ { i } ) \cdot { \mathrm { F F N N } } ( q _ { j } ) } & & { 1 \leq j \leq n } \\ & { a _ { i j } = { \frac { \exp \left( s _ { i j } \right) } { \displaystyle \sum _ { k = 1 } ^ { n } \exp \left( s _ { i k } \right) } } } & & { 1 \leq j \leq n } \\ & { q _ { i } ^ { a l i g n } = { \displaystyle \sum _ { j = 1 } ^ { n } a _ { i j } q _ { j } } } & & { } \end{array} }
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Passage-independent question representation We also include a representation of the question that does not depend on the passage and is shared for all passage words.
|
| 93 |
+
|
| 94 |
+
Similar to the previous question representation, an attention score is computed via a dot-product, except the question word is compared to a universal learned embedding rather any particular passage word. Additionally, we incorporate contextual information with a BiLSTM before aggregating the outputs using this attention mechanism.
|
| 95 |
+
|
| 96 |
+
The goal is to generate a coarse-grained summary of the question that depends on word order. Formally, the passage-independent question representation $q ^ { i \bar { n } d e p }$ is computed as follows:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { c } { { \{ q _ { 1 } ^ { \prime } , \dots , q _ { n } ^ { \prime } \} = { \bf B I L S T M ( q ) } } } \\ { { \displaystyle s _ { j } = w _ { q } \cdot \mathrm { F F N N } ( q _ { j } ^ { \prime } ) } } \\ { { \displaystyle a _ { j } = \frac { \exp ( s _ { j } ) } { \sum _ { k = 1 } ^ { n } \exp ( s _ { k } ) } } } \\ { { \displaystyle q ^ { i n d e p } = \sum _ { j = 1 } ^ { n } a _ { j } q _ { j } ^ { \prime } } } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
1 \leq j \leq n
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $w _ { q }$ denotes a learned vector for scoring the last layer of the feed-forward neural network.
|
| 107 |
+
|
| 108 |
+
This representation is a bidirectional generalization of the question representation recently proposed by Li et al. (2016) for a different question-answering task.
|
| 109 |
+
|
| 110 |
+
Given the above three components, the complete question-focused passage word embedding for is their concatenation: $p _ { i } ^ { * } = [ p _ { i } , q _ { i } ^ { a l i g n } , q ^ { i n d e p } ]$ . $p _ { i }$
|
| 111 |
+
|
| 112 |
+
# 3.4 LEARNING
|
| 113 |
+
|
| 114 |
+
Given the above model specification, learning is straightforward. We simply maximize the loglikelihood of the correct answer candidates and backpropagate the errors end-to-end.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 1: A visualization of RASOR, where the question is “What are the stators attached to?” and the passage is “. . . fixed to the turbine . . . ”. The model constructs question-focused passage word embeddings by concatenating (1) the original passage word embedding, (2) a passage-aligned representation of the question, and (3) a passage-independent representation of the question shared across all passage words. We use a BiLSTM over these concatenated embeddings to efficiently recover embedding representations of all possible spans, which are then scored by the final layer of the model.
|
| 118 |
+
|
| 119 |
+
# 4 EXPERIMENTAL SETUP
|
| 120 |
+
|
| 121 |
+
We represent each of the words in the question and document using 300 dimensional GloVe embeddings trained on a corpus of $8 4 0 \mathrm { b n }$ words (Pennington et al., 2014). These embeddings cover $2 0 0 \mathrm { k }$ words and all out of vocabulary (OOV) words are projected onto one of $1 \mathrm { m }$ randomly initialized 300d embeddings. We couple the input and forget gates in our LSTMs, as described in Greff et al. (2016), and we use a single dropout mask to apply dropout across all LSTM time-steps as proposed by Gal & Ghahramani (2016). Hidden layers in the feed-forward neural networks use rectified linear units (Nair & Hinton, 2010). Answer candidates are limited to spans with at most 30 words.
|
| 122 |
+
|
| 123 |
+
To choose the final model configuration, we ran grid searches over: the dimensionality of the LSTM hidden states (25, 50, 100, 200); the number of stacked LSTM layers $( 1 , 2 , 3 )$ ; the width (50, 100, 150, 200) and depth $( 1 , 2 )$ of the feed-forward neural networks; the dropout rate $( 0 , 0 . 1 , \mathrm { { 0 . 2 } ) }$ ; and the decay multiplier $( 0 . 9 , 0 . 9 5 , 1 . 0 )$ with which we multiply the learning rate every 10k steps. The best model uses a single 150d hidden layer in all feed-forward neural networks; 50d LSTM states; two-layer BiLSTMs for the span encoder and the passage-independent question representation; dropout of 0.1 throughout; and a learning rate decay of $5 \%$ every $1 0 \mathrm { k }$ steps.
|
| 124 |
+
|
| 125 |
+
All models are implemented using TensorFlow3 and trained on the SQUAD training set using the ADAM (Kingma & Ba, 2015) optimizer with a mini-batch size of 4 and trained using 10 asynchronous training threads on a single machine.
|
| 126 |
+
|
| 127 |
+
# 5 RESULTS
|
| 128 |
+
|
| 129 |
+
We train on the 80k (question, passage, answer span) triples in the SQUAD training set and report results on the 10k examples in the SQUAD development set. Due to copyright restrictions, we are currently not able to upload our models to Codalab4, which is required to run on the blind SQUAD test set, but we are working with Rajpurkar et al. to remedy this, and this paper will be updated with test numbers as soon as possible.
|
| 130 |
+
|
| 131 |
+
All results are calculated using the official SQUAD evaluation script, which reports exact answer match and F1 overlap of the unigrams between the predicted answer and the closest labeled answer from the 3 reference answers given in the SQUAD development set.
|
| 132 |
+
|
| 133 |
+
# 5.1 COMPARISONS TO OTHER WORK
|
| 134 |
+
|
| 135 |
+
Our model with recurrent span representations (RASOR) is compared to all previously published systems 5. Rajpurkar et al. (2016) published a logistic regression baseline as well as human performance on the SQUAD task. The logistic regression baseline uses the output of an existing syntactic parser both as a constraint on the set of allowed answer spans, and as a method of creating sparse features for an answer-centric scoring model. Despite not having access to any external representation of linguistic structure, RASOR achieves an error reduction of more than $5 \dot { 0 } \%$ over this baseline, both in terms of exact match and F1, relative to the human performance upper bound.
|
| 136 |
+
|
| 137 |
+
<table><tr><td></td><td colspan="2">Dev</td><td colspan="2">Test</td></tr><tr><td>System</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td>Logistic regression baseline</td><td>39.8</td><td>51.0</td><td>40.4</td><td>51.0</td></tr><tr><td>Match-LSTM (Sequence)</td><td>54.5</td><td>67.7</td><td>54.8</td><td>68.0</td></tr><tr><td>Match-LSTM (Boundary)</td><td>60.5</td><td>70.7</td><td>59.4</td><td>70.0</td></tr><tr><td>RASOR</td><td>66.4</td><td>74.9</td><td>1</td><td>1</td></tr><tr><td>RASoR (Ensemble)</td><td>68.2</td><td>76.7</td><td>一</td><td>一</td></tr><tr><td>Human</td><td>81.4</td><td>91.0</td><td>82.3</td><td>91.2</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 1: Exact match (EM) and span F1 on SQUAD. We are currently unable to evaluate on the blind SQUAD test set due to copyright restrictions. We confirm that we did not overfit the development set via 5-fold cross validation of the hyper-parameters, resulting in $6 6 . 0 \pm 1 . 0$ exact match and $7 4 . 5 \pm \bar { 0 } . 9 \ : \mathrm { F 1 }$ .
|
| 140 |
+
|
| 141 |
+
More closely related to RASOR is the boundary model with Match-LSTMs and Pointer Networks by Wang & Jiang (2016). Their model similarly uses recurrent networks to learn embeddings of each passage word in the context of the question, and it can also capture interactions between endpoints, since the end index probability distribution is conditioned on the start index. However, both training and evaluation are greedy, making their system susceptible to search errors when decoding. In contrast, RASOR can efficiently and explicitly model the quadratic number of possible answers, which leads to a $1 4 \%$ error reduction over the best performing Match-LSTM model.
|
| 142 |
+
|
| 143 |
+
We also ensemble RASOR with a baseline model described in Section 5.2 that independently predicts endpoints rather than spans (Endpoints prediction in Table 2b). By simply computing the product of the output probabilities, this ensemble further increases performance to $6 8 . 2 \%$ exact-match. We examine the causes of this improvement in Section 6.
|
| 144 |
+
|
| 145 |
+
Since we do not have access to the test set, we also present 5-fold cross validation experiments to demonstrate that our dev-set results are not an outcome of overfitting through hyper-parameter selection. In this 5-fold setting, we create 5 pseudo dev/test splits from the SQUAD development set.6 We choose hyper-parameters on the basis of the pseudo dev set, and report performance on the disjoint pseudo test set. Each of the pseudo dev sets led us to choose the same optimal model hyper-parameters from a grid of 59 settings, as well as very similar training stopping points. We compute the mean and standard deviation of both evaluation metrics for these optimal models on the pseudo test set, resulting in a $6 6 . 0 \pm 1 . 0$ exact match and $7 4 . 5 \pm 0 . 9 \operatorname { F } 1$ . These results show that our hyper-parameter selection procedure is not overfitting on the 10k SQUAD development set, and we subsequently expect that our model’s performance will translate to the SQUAD test set.
|
| 146 |
+
|
| 147 |
+
# 5.2 MODEL VARIATIONS
|
| 148 |
+
|
| 149 |
+
We investigate two main questions in the following ablations and comparisons. (1) How important are the two methods of representing the question described in Section 3.3? (2) What is the impact of learning a loss function that accurately reflects the span prediction task?
|
| 150 |
+
|
| 151 |
+
Question representations Table 2a shows the performance of RASOR when either of the two question representations described in Section 3.3 is removed. The passage-aligned question representation is crucial, since lexically similar regions of the passage provide strong signal for relevant answer spans. If the question is only integrated through the inclusion of a passage-independent representation, performance drops drastically. The passage-independent question representation over the BiLSTM is less important, but it still accounts for over $3 \%$ exact match and F1. The input of both of these components is analyzed qualitatively in Section 6.
|
| 152 |
+
|
| 153 |
+
Table 2: Results for variations of the model architecture presented in Section 3.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Question representation</td><td>EM</td><td>F1</td></tr><tr><td>Only passage-independent</td><td>48.7</td><td>56.6</td></tr><tr><td>Only passage-aligned</td><td>63.1</td><td>71.3</td></tr><tr><td>RASOR</td><td>66.4</td><td>74.9</td></tr></table>
|
| 156 |
+
|
| 157 |
+
(a) Ablation of question representations.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Learning objective</td><td>EM</td><td>F1</td></tr><tr><td>Membership prediction</td><td>57.9</td><td>69.7</td></tr><tr><td>BIO sequence prediction</td><td>63.9</td><td>73.0</td></tr><tr><td>Endpoints prediction</td><td>65.3</td><td>75.1</td></tr><tr><td>Span prediction w/log loss</td><td>65.2</td><td>73.6</td></tr></table>
|
| 160 |
+
|
| 161 |
+
(b) Comparisons for different learning objectives given the same passage-level BiLSTM.
|
| 162 |
+
|
| 163 |
+
Learning objectives Given a fixed architecture that is capable of encoding the input questionpassage pairs, there are many ways of setting up a learning objective to encourage the model to predict the correct span. In Table 2b, we provide comparisons of some alternatives (learned end-toend) given only the passage-level BiLSTM from RASOR. In order to provide clean comparisons, we restrict the alternatives to objectives that are trained and evaluated with exact decoding.
|
| 164 |
+
|
| 165 |
+
The simplest alternative is to consider this task as binary classification for every word (Membership prediction in Table 2b). In this baseline, we optimize the logistic loss for binary labels indicating whether passage words belong to the correct answer span. At prediction time, a valid span can be recovered in linear time by finding the maximum contiguous sum of scores.
|
| 166 |
+
|
| 167 |
+
Li et al. (2016) proposed a sequence-labeling scheme that is similar to the above baseline (BIO sequence prediction in Table 2b). We follow their proposed model and learn a conditional random field (CRF) layer after the passage-level BiLSTM to model transitions between the different labels. At prediction time, a valid span can be recovered in linear time using Viterbi decoding, with hard transition constraints to enforce a single contiguous output.
|
| 168 |
+
|
| 169 |
+
We also consider a model that independently predicts the two endpoints of the answer span (Endpoints prediction in Table 2b). This model uses the softmax loss over passage words during learning. When decoding, we only need to enforce the constraint that the start index is no greater than the end index. Without the interactions between the endpoints, this can be computed in linear time. Note that this model has the same expressivity as RASOR if the span-level FFNN were removed.
|
| 170 |
+
|
| 171 |
+
Lastly, we compare with a model using the same architecture as RASOR but is trained with a binary logistic loss rather than a softmax loss over spans (Span prediction w/ logistic loss in Table 2b).
|
| 172 |
+
|
| 173 |
+
The trend in Table 2b shows that the model is better at leveraging the supervision as the learning objective more accurately reflects the fundamental task at hand: determining the best answer span.
|
| 174 |
+
|
| 175 |
+
First, we observe general improvements when using labels that closely align with the task. For example, the labels for membership prediction simply happens to provide single contiguous spans in the supervision. The model must consider far more possible answers than it needs to (the power set of all words). The same problem holds for BIO sequence prediction– the model must do additional work to learn the semantics of the BIO tags. On the other hand, in RASOR, the semantics of an answer span is naturally encoded by the set of labels.
|
| 176 |
+
|
| 177 |
+
Second, we observe the importance of allowing interactions between the endpoints using the spanlevel FFNN. RASOR outperforms the endpoint prediction model by 1.1 in exact match, The interaction between endpoints enables RASOR to enforce consistency across its two substructures. While this does not provide improvements for predicting the correct region of the answer (captured by the F1 metric, which drops by 0.2), it is more likely to predict a clean answer span that matches human judgment exactly (captured by the exact-match metric).
|
| 178 |
+
|
| 179 |
+
# 6 ANALYSIS
|
| 180 |
+
|
| 181 |
+
Figure 2 shows how the performances of RASOR and the endpoint predictor introduced in Section 5.2 degrade as the lengths of their predictions increase. The endpoint predictor underpredicts single word answer spans, while overpredicting answer spans with more than 8 words.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 2: F1 and Exact Match accuracy of RASOR and the endpoint predictor over different predictions lengths, along with the distribution of both models’ prediction lengths and the gold answer lengths.
|
| 185 |
+
|
| 186 |
+
Since the endpoints predictor does not explicitly model the interaction between the start and end of any given answer span, it is susceptible to choosing the span start and end points from separate answer candidates. For example, consider the following endpoints prediction that is most different in length from a correct span classification. Here, the span classifier correctly answers the question ‘Where did the Meuse flow before the flood?’ with ‘North Sea’ but the endpoints prediction is:
|
| 187 |
+
|
| 188 |
+
‘south of today’s line Merwede-Oude Maas to the North Sea and formed an archipelago-like estuary with Waal and Lek. This system of numerous bays, estuary-like extended rivers, many islands and constant changes of the coastline, is hard to imagine today. From 1421 to 1904, the Meuse and Waal merged further upstream at Gorinchem to form Merwede. For flood protection reasons, the Meuse was separated from the Waal through a lock and diverted into a new outlet called ”Bergse Maas”, then Amer and then flows into the former bay Hollands Diep
|
| 189 |
+
|
| 190 |
+
In this prediction, we can see that both the start ‘south of . . . ’ and the end ‘. . . Hollands Diep’ have a reasonable answer type. However, the endpoints predictor has failed to model the fact that they cannot resonably be part of the same answer, a common error case. The endpoints predictor predicts 514 answers with $> 2 5$ more words than the gold answer, but the span classifier never does this.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 3: Attention masks from RASOR. Top predictions are ‘Egyptians’, ‘Egyptians against the British’, and ‘British’ in the first example and ‘unjust laws’, ‘what they deem to be unjust laws’, and ‘laws’ in the second.
|
| 194 |
+
|
| 195 |
+
Table 3: Example questions and their most attended words in the passage-independent question representation (Equation 11). These examples have the greatest attention (normalized by the question length) in the development set. The attention mechanism typically seeks words in the question that indicate the answer type.
|
| 196 |
+
|
| 197 |
+
<table><tr><td rowspan=1 colspan=1>Most attended</td><td rowspan=1 colspan=1>Question</td></tr><tr><td rowspan=1 colspan=1>conditions</td><td rowspan=1 colspan=1>In Gebhard v Consiglio..Milano,the requirements to be registered in Milan beforebeing able to practice law would be allowed under what conditions?</td></tr><tr><td rowspan=1 colspan=1>Were</td><td rowspan=1 colspan=1>Were the restored tapes able to have color added to them to enhance the picture ordid they remain black and white?</td></tr><tr><td rowspan=1 colspan=1>Did</td><td rowspan=1 colspan=1>Did the European Court of Justice rule the defendant in the case of Commission v.Edith Cresson broke any laws?</td></tr><tr><td rowspan=1 colspan=1>whom</td><td rowspan=1 colspan=1>The church holds that they are equally bound to respect the sacredness of the lifeand well-being of whom?</td></tr><tr><td rowspan=1 colspan=1>Whose</td><td rowspan=1 colspan=1>Whose thesis states that the solution to a problem is solvable with reasonable re-sources assuming it allows for a polynomial time algorithm ?</td></tr><tr><td rowspan=1 colspan=1>language</td><td rowspan=1 colspan=1>What language did the Court of Justice accept to be required to teach in a Dublincollege in Groner v Minister for Education?</td></tr><tr><td rowspan=1 colspan=1>term</td><td rowspan=1 colspan=1>Income not from the creation of wealth but by grabbing a larger share of it is knowto economists by what term?</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Figure 3 shows attention masks for both of RASOR’s question representations. The passageindependent question representation pays most attention to the words that could attach to the answer in the passage (‘brought’, ‘against’) or describe the answer category (‘people’). Meanwhile, the passage-aligned question representation pays attention to similar words. The top predictions for both examples are all valid syntactic constituents, and they all have the correct semantic category. However, RASOR assigns almost as much probability mass to it’s incorrect third prediction ‘British’ as it does to the top scoring correct prediction ‘Egyptian’. This showcases a common failure case for RASOR, where it can find an answer of the correct type close to a phrase that overlaps with the question – but it cannot accurately represent the semantic dependency on that phrase.
|
| 200 |
+
|
| 201 |
+
A significant architectural difference from other neural models for the SQUAD dataset, such as Wang & Jiang (2016), is the use of the question-independent passage representation (Equation 12). Table 3 shows examples in the development set where the model paid the most attention to a single word in the question. The attention mechanism tends to seek words in the question that indicate the answer type, e.g. ‘language’ from the question: ‘What language did the Court of Justic accept ...’ This pattern provides insight for the necessity of using both question representations, since the answer type information is orthogonal to passage alignment information.
|
| 202 |
+
|
| 203 |
+
# 7 CONCLUSION
|
| 204 |
+
|
| 205 |
+
We have shown a novel approach for perform extractive question answering on the SQUAD dataset by explicitly representing and scoring answer span candidates. The core of our model relies on a recurrent network that enables shared computation for the shared substructure across span candidates. We explore different methods of encoding the passage and question, showing the benefits of including both passage-independent and passage-aligned question representations. While we show that this encoding method is beneficial for the task, this is orthogonal to the core contribution of efficiently computing span representation. In future work, we plan to explore alternate architectures that provide input to the recurrent span representations.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
Dzmitry Bahdanau, KyungHyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 210 |
+
|
| 211 |
+
Danqi Chen, Jason Bolton, and Christopher D. Manning. A thorough examination of the cnn/daily mail reading comprehension task. In Proceedings of ACL, 2016.
|
| 212 |
+
|
| 213 |
+
Yarin Gal and Zoubin Ghahramani. A theoretically grounded application of dropout in recurrent neural networks. Proceedings of NIPS, 2016.
|
| 214 |
+
|
| 215 |
+
Klaus Greff, Rupesh Kumar Srivastava, Jan Koutn´ık, Bas R. Steunebrink, and Jurgen Schmidhuber. ¨ LSTM: A search space odyssey. IEEE Transactions on Neural Networks and Learning Systems, PP:1–11, 2016.
|
| 216 |
+
|
| 217 |
+
Karl Moritz Hermann, Tomas Kocisky, Edward Grefenstette, Lasse Espeholt, Will Kay, Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Proceedings of NIPS, 2015.
|
| 218 |
+
|
| 219 |
+
Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. In Proceedings of ICLR, 2016.
|
| 220 |
+
|
| 221 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long Short-term Memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 222 |
+
|
| 223 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. Proceedings of ICLR, 2015.
|
| 224 |
+
|
| 225 |
+
Peng Li, Wei Li, Zhengyan He, Xuguang Wang, Ying Cao, Jie Zhou, and Wei Xu. Dataset and neural recurrent sequence labeling model for open-domain factoid question answering. CoRR, abs/1607.06275, 2016.
|
| 226 |
+
|
| 227 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of ICML, 2010.
|
| 228 |
+
|
| 229 |
+
Ankur P Parikh, Oscar Tackstr ¨ om, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention ¨ model for natural language inference. In Proceedings of EMNLP, 2016.
|
| 230 |
+
|
| 231 |
+
Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of EMNLP, 2014.
|
| 232 |
+
|
| 233 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100, $0 0 0 +$ questions for machine comprehension of text. In Proceedings of EMNLP, 2016.
|
| 234 |
+
|
| 235 |
+
Matthew Richardson, Christopher JC Burges, and Erin Renshaw. Mctest: A challenge dataset for the open-domain machine comprehension of text. In Proceedings of EMNLP, 2013.
|
| 236 |
+
|
| 237 |
+
Wilson Taylor. Cloze procedure: A new tool for measuring readability. Journalism Quarterly, 30: 415–433, 1953.
|
| 238 |
+
|
| 239 |
+
Kateryna Tymoshenko, Daniele Bonadiman, and Alessandro Moschitti. Convolutional neural networks vs. convolution kernels: Feature engineering for answer sentence reranking. In Proceedings of NAACL, 2016.
|
| 240 |
+
|
| 241 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Proceedings of NIPS, 2015.
|
| 242 |
+
|
| 243 |
+
Ellen M. Voorhees and Dawn M. Tice. Building a question answering test collection. In Proceedings of SIGIR, 2000.
|
| 244 |
+
|
| 245 |
+
Bingning Wang, Kang Liu, and Jun Zhao. Inner attention based recurrent neural networks for answer selection. In Proceedings of ACL, 2016.
|
| 246 |
+
|
| 247 |
+
Shuohang Wang and Jing Jiang. Machine comprehension using match-lstm and answer pointer. arXiv preprint arXiv:1608.07905, 2016.
|
| 248 |
+
|
| 249 |
+
Yi Yang, Wen-tau Yih, and Christopher Meek. Wikiqa: A challenge dataset for open-domain question answering. In Proceedings of EMNLP, 2015.
|
md/train/HkfPSh05K7/HkfPSh05K7.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-STEP RETRIEVER-READER INTERACTION FOR SCALABLE OPEN-DOMAIN QUESTION ANSWERING
|
| 2 |
+
|
| 3 |
+
Rajarshi Das1, Shehzaad Dhuliawala2, Manzil Zaheer3 & Andrew McCallum1
|
| 4 |
+
|
| 5 |
+
{rajarshi,mccallum}@cs.umass.edu
|
| 6 |
+
shehzaad.dhuliawala@microsoft.com, manzil@zaheer.ml
|
| 7 |
+
1 University of Massachusetts, Amherst, 2 Microsoft Research, Montreal ´
|
| 8 |
+
3 Google AI, Mountain View
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
This paper introduces a new framework for open-domain question answering in which the retriever and the reader iteratively interact with each other. The framework is agnostic to the architecture of the machine reading model, only requiring access to the token-level hidden representations of the reader. The retriever uses fast nearest neighbor search to scale to corpora containing millions of paragraphs. A gated recurrent unit updates the query at each step conditioned on the state of the reader and the reformulated query is used to re-rank the paragraphs by the retriever. We conduct analysis and show that iterative interaction helps in retrieving informative paragraphs from the corpus. Finally, we show that our multistep-reasoning framework brings consistent improvement when applied to two widely used reader architectures (DR.QA and BIDAF) on various large open-domain datasets — TRIVIAQA-unfiltered, QUASAR-T, SEARCHQA, and SQUAD-open1.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Open-domain question answering (QA) (Voorhees et al., 1999) involves a retriever for selecting relevant context from a large corpora of text (e.g. Wikipedia) and a machine reading comprehension (MRC) model for ‘reasoning’ on the retrieved context. A lot of effort has been put into designing sophisticated neural MRC architectures for reading short context (e.g. a single paragraph), with much success (Wang & Jiang, 2017; Seo et al., 2017; Xiong et al., 2017; Wang et al., 2018c; Yu et al., 2018, inter alia). However, the performance of such systems degrades significantly when combined with a retriever in open domain settings. For example, the exact match accuracy of $\mathrm { D r Q A }$ (Chen et al., 2017), on the SQUAD dataset (Rajpurkar et al., 2016) degrades from $6 9 . 5 \%$ to $2 8 . 4 \%$ in open-domain settings. The primary reason for this degradation in performance is due to the retriever’s failure to find the relevant paragraphs for the machine reading model (Htut et al., 2018).
|
| 17 |
+
|
| 18 |
+
We propose the following two desiderata for a general purpose open-domain QA system - (a) The retriever model should be fast, since it has to find the relevant context from a very large text corpora and give it to the more sophisticated and computationally expensive MRC model (b) Secondly, the retriever and reader models should be interactive, i.e. if the reader model is unable to find the answer from the initial retrieved context, the retriever should be able to learn to provide more relevant context to the reader. Open-domain QA systems such as $\mathbb { R } ^ { 3 }$ (Wang et al., 2018a) and DS-QA (Lin et al., 2018) have sophisticated retriever models where the reader and retriever are jointly trained. However, their retriever computes question-dependent paragraph representation which is then encoded by running an expensive recurrent neural network over the tokens in the paragraph. Since the retriever has to rank a lot of paragraphs, this design does not scale to large corporas. One the other hand, the retriever model of QA systems such as DrQA (Chen et al., 2017) is based on a tf-idf retriever, but they lack trainable parameters and are consequently unable to recover from mistakes.
|
| 19 |
+
|
| 20 |
+
This paper introduces an open domain architecture in which the retriever and reader iteratively interact with each other. Our model first pre-computes and caches representation of context (paragraph). These representations are independent of the query unlike recent architectures (Wang et al., 2018a;
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Our framework unrolled for two steps. The initial query is encoded and the retriever sends the top- $k$ paragraphs to the reader. The multi-step-reasoner component of our model takes in the internal state of the reader model and the previous query vector and does a gated update to produce a reformulated query. This new query vector is used by the retriever to re-rank the paragraphs and send different paragraphs to the reader. Thus the multi-step-reasoner facilitates iterative interaction between the retriever (search engine) and the reader (QA model)
|
| 24 |
+
|
| 25 |
+
Lin et al., 2018) and hence can be computed and stored offline. Given an input question, the retriever performs fast inner product search to find the most relevant contexts. The highest ranked contexts are then passed to the neural MRC model. Our architecture is agnostic to the choice of the reader architecture and we show that multi-step-reasoning increases performance of two state-of-the-art MRC architectures - DrQA (Chen et al., 2017) and BiDAF (Seo et al., 2017).
|
| 26 |
+
|
| 27 |
+
It is possible that the answer might not exist in the initial retrieved paragraphs or that the model would need to combine information across multiple paragraphs (Wang et al., 2018b). We equip the reader with an additional gated recurrent unit (Cho et al., 2014) which takes in the state of the reader and the current query vector and generates a new query vector. This new query vector is then used by the retriever model to re-rank the context. This allows the model to read new paragraphs and combine evidence across multiple paragraphs. Since the retriever makes a ‘hard selection’ of paragraphs to send to the reader, we train the retriever and the reader jointly using reinforcement learning.
|
| 28 |
+
|
| 29 |
+
Our architecture draws inspiration from how students are instructed to take reading comprehension tests (Cunningham & Shablak, 1975; Bishop et al., 2006; Duggan & Payne, 2009). Given a document containing multiple paragraphs and a set of questions which can be answered from the document, (a) the student quickly skims the paragraphs, (b) then for each question, she finds the most relevant paragraphs that she thinks will answer the question. (c) She then carefully reads the chosen paragraph to answer the question (d) However, if the chosen paragraph does not answer the question, then given the question and the knowledge of what she has read till now, she decides which paragraph to read next. Step (a) is akin to our model encoding and storing the question independent paragraph representations and step (b) corresponds to the inner product search to find the relevant context. The reading of the context by the sophisticated neural machine reader corresponds to step (c) and the last step corresponds to the iterative (multi-step) interaction between the retriever and the reader.
|
| 30 |
+
|
| 31 |
+
To summarize, this paper makes the following contributions: (a) We introduce a new framework for open-domain QA in which the retriever and reader iteratively interact with each other via a novel multistep-reasoning component allowing it to retrieve and combine information from multiple paragraphs.
|
| 32 |
+
|
| 33 |
+
(b) Our paragraph representations are independent of the query which makes our architecture highly scalable and we empirically demonstrate it by running large scale experiments over millions of paragraphs. (c) Lastly, our framework is agnostic to the architecture of the reader and we show improvements on two widely used neural reading comprehension models.
|
| 34 |
+
|
| 35 |
+
# 2 BASIC COMPONENTS OF OUR MODEL
|
| 36 |
+
|
| 37 |
+
The architecture of our model consists of three main components - (a) paragraph retriever - that computes a relevance score for each paragraph w.r.t a given query and ranks them according to the computed score. (b) reader - a more sophisticated neural machine reading model that receives few top-ranked paragraphs from the retriever and outputs a span of text as a possible answer to the query and (c) multi-step-reasoner - a gated recurrent unit that facilitates iterative interaction between the retriever and the reader.
|
| 38 |
+
|
| 39 |
+
Formally, the input to our model is a natural language question $\mathrm { Q } = \mathrm { q } _ { 1 }$ , q2,. . . , ${ \bf q } _ { n }$ consisting of $n$ tokens and a set of paragraphs $\mathsf { P } = \{ \mathsf { p } _ { 1 } , \mathsf { p } _ { 2 } , . . . \mathsf { p } _ { K } \}$ . Our model extracts a span of text $a$ as the answer to the question from the paragraphs in P. Note that the set of paragraphs in P can be the paragraphs in a set of documents retrieved by a search engine or it could be all the paragraphs in a large text corpus such as Wikipedia. Next we describe each individual component of our model.
|
| 40 |
+
|
| 41 |
+
# 2.1 PARAGRAPH RETRIEVER
|
| 42 |
+
|
| 43 |
+
The paragraph retriever computes a score for how likely a paragraph is to contain an answer to a given question. The paragraph representations are computed independent of the query and once computed, they are not updated. This allows us to cache the representations and store them offline. The relevance score of a paragraph is computed as a inner product between the paragraph and the query vectors. The paragraph and query representations are computed as follows.
|
| 44 |
+
|
| 45 |
+
Given a paragraph $\mathfrak { p } = \{ \mathfrak { p } _ { 1 } , \mathfrak { p } _ { 2 } , \dots , \mathfrak { p } _ { m } \}$ consisting of $m$ tokens, a multi-layer recurrent neural network encodes each tokens in the paragraph — $\left\{ \mathbf { p } _ { 1 } , \mathbf { p } _ { 2 } , \ldots , \mathbf { p } _ { m } \right\} = \mathbf { R N N } \left( \left\{ \mathbf { p } _ { 1 } , \mathbf { p } _ { 2 } , \ldots , \mathbf { p } _ { m } \right\} \right)$ , where $\mathbf { p } _ { j } \in \mathbb { R } ^ { 2 d }$ encodes useful contextual information around the $j$ -th token. Specifically we choose to use a multilayer bidirectional long-short term memory network (LSTM) (Hochreiter & Schmidhuber, 1997) and take $\mathbf { p } _ { j }$ as the hidden units in the last layer of the RNN. We concatenate the representation computed by the forward and the backward LSTM. To compute a single paragraph vector $ { \mathbf { p } } \in \mathbb { R } ^ { 2 d }$ from all the token representations, we combine them using weights $b _ { j } \in \mathbb { R }$
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
b _ { j } = \frac { \exp ( \mathbf { w } \cdot \mathbf { p _ { j } } ) } { \sum _ { j ^ { \prime } } \exp ( \mathbf { w } \cdot \mathbf { p } _ { j ^ { \prime } } ) } \qquad \mathbf { p } = W _ { s } \sum _ { j ^ { \prime } } b _ { j ^ { \prime } } \cdot \mathbf { p _ { j ^ { \prime } } }
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Here $b _ { j }$ encodes the importance of each token and $\mathbf { w } \in \mathbb { R } ^ { 2 d } , \mathbf { W _ { s } } \in \mathbb { R } ^ { 2 d \times 2 d }$ are learned weights. The query ${ \dot { \mathbf { q } } } = \left\{ { \mathfrak { q } } _ { 1 } , { \mathfrak { q } } _ { 2 } , \dots , { \mathfrak { q } } _ { n } \right\}$ is encoded by another network with the same architecture to obtain a query vector $\mathbf { q } \in \mathbb { R } ^ { 2 d }$ . Next the relevance score of a paragraph w.r.t the query (score $( \mathbf { p } , \mathbf { q } ) \in \mathbb { R } )$ is computed by a simple inner product — score $( { \bf p } , { \bf q } ) = \langle { \bf p } , { \bf q } \rangle$ . The paragraph retriever then returns the top scoring $k$ paragraphs to the reader.
|
| 52 |
+
|
| 53 |
+
Fast inner product search. Inner product can be efficiently computed on a GPU, however in our experiments with large corpus with over million paragraphs, (a) the paragraph vectors require more memory than available in a single commodity GPU (b) it is computationally wasteful to compute inner products with all paragraph vectors and we can do better by leveraging fast nearest neighbor (NN) search algorithms. Since the retriever has to find the $k$ paragraphs with the highest inner products w.r.t query, our problem essentially reduces to maximum inner product search (MIPS). There exists data structures for fast NN search in metric spaces such as Cover Trees (Beygelzimer et al., 2006). But we cannot use them directly, since triangle equality does not hold in inner product space. Borrowing ideas from Bachrach et al. (2014); Zaheer et al. (2019), we propose to use nearest neighbor (NN) search algorithms to perform the MIPS in sublinear time as follows.
|
| 54 |
+
|
| 55 |
+
Let u be an upper bound for the L2 norm for all paragraphs, i.e. $\mathbf { u } \geq \| \mathbf { p } \|$ , $\forall \mathbf { p }$ . Next, we modify the original paragraph and query vectors such that searching for the $\mathbf { k }$ -nearest neighbor w.r.t L2 distance with the modified vectors is equivalent to finding the $k$ nearest (original) paragraph vectors in the inner-product space.
|
| 56 |
+
|
| 57 |
+
Define the augmented paragraph vectors as $\tilde { \mathbf { p } } \mathbf { i } = [ \mathbf { p } \mathbf { i } ; \sqrt { \mathbf { u } ^ { 2 } - \| \mathbf { p } \mathbf { i } \| ^ { 2 } } ]$ and augmented query vector as $\widetilde { \mathbf { q } } = [ \mathbf { q } ; 0 ]$ , where $[ ; ]$ denotes concatenation. Note, with this transformation, $\langle \tilde { { \bf p } } _ { \bf i } , \tilde { { \bf q } } \rangle = \langle { \bf p _ { i } } , { \bf q } \rangle$ . Now,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l } & { \mathrm { N N } ( \tilde { \bf p _ { i } } , \tilde { \bf q } ) = \underset { i } { \arg \operatorname* { m i n } } \left\| \tilde { \bf p _ { i } } - \tilde { \bf q } \right\| ^ { 2 } } \\ & { \quad \quad \quad \quad = \underset { i } { \arg \operatorname* { m i n } } \left\| \tilde { \bf p _ { i } } \right\| ^ { 2 } + \left\| \tilde { \bf q } \right\| ^ { 2 } - 2 \langle \tilde { \bf p _ { i } } , \tilde { \bf q } \rangle } \\ & { \quad \quad \quad \quad = \underset { i } { \arg \operatorname* { m i n } } ( { \bf u } ^ { 2 } - 2 \langle \tilde { \bf p _ { i } } , \tilde { \bf q } \rangle ) } \\ & { \quad \quad \quad \quad = \underset { i } { \arg \operatorname* { m a x } } \langle \tilde { \bf p _ { i } } , \tilde { \bf q } \rangle = \underset { i } { \arg \operatorname* { m a x } } \langle { \bf p _ { i } } , { \bf q } \rangle = \mathrm { M I P S } ( { \bf p _ { i } } , { \bf q } ) } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Many exact NN search algorithms can find $\mathbf { k }$ -NN in time (sublinear) logarithmic in number of paragraphs (Beygelzimer et al., 2006; Zaheer et al., 2019), after an one-time preprocessing. In our architecture, the preprocessing can be done because the set of all paragraphs is fixed for all the queries. We chose to use SGTree (Zaheer et al., 2019) to perform the NN/MIPS due to its fast construction time and competitive performance reducing the search to logarithmic time per query.
|
| 64 |
+
|
| 65 |
+
Note that our paragraph representations are independent of the given query and are never updated once they are trained. After training is completed, we cache the $ { \mathbf { p } } \in { \mathbb { R } } ^ { 2 d }$ vectors. This is unlike many recent work in open-domain QA. For example, in $\mathbb { R } ^ { 3 }$ (Wang et al., 2018a), the retriever uses Match-LSTM model (Wang & Jiang, 2017) to compute question-matching representations for each token in the passage. The paragraph representations are then obtained by running a bi-directional RNN over these matched representation. Although powerful, this architecture design will not scale in open-domain settings where the retriever has to re-compute new representations for possibly millions of paragraphs for every new question. In contrast, once training is over, we cache the paragraph representation and use it for every query at test time.
|
| 66 |
+
|
| 67 |
+
Training - Following previous work (Htut et al., 2018; Lin et al., 2018; Wang et al., 2018a), we gather labels for paragraphs during training using distant supervision (Mintz et al., 2009). A paragraph that contains the exact ground truth answer string is labeled as an positive example. For a positive (negative) labeled paragraph, we maximize (minimize) the $\log ( \sigma ( \mathrm { s c o r e } ( \mathbf { p } , \mathbf { q } ) ) )$ . The number of layers of the bi-directional LSTM encoder is set to three and we use Adam (Kingma & Ba, 2014) for optimization. Once training is done, we pre-compute and cache the paragraph representation of each dataset in our experiments.
|
| 68 |
+
|
| 69 |
+
# 2.2 MACHINE READER
|
| 70 |
+
|
| 71 |
+
The reader is a sophisticated neural machine reading comprehension (MRC) model that takes in the top few paragraphs sent by the retriever and outputs a span of answer text. Our model is agnostic to the exact architecture of the reader and we perform experiments to show the efficacy of our model on two state-of-the-art neural machine reading models - DrQA and BiDAF.
|
| 72 |
+
|
| 73 |
+
MRC models designed for SQUAD (Rajpurkar et al., 2016), NewsQA (Trischler et al., 2016), etc operate on a single paragraph. However it has been shown that reading and aggregating evidence across multiple paragraphs is important when doing QA over larger evidence set (e.g. full Wikipedia document) (Swayamdipta et al., 2018; Clark & Gardner, 2018) and in open domain settings (Wang et al., 2018b). Most MRC models compute a start and end scores for each token in the paragraph that represents how likely a token is the start/end of an answer span. To gather evidence across multiple paragraphs sent by the retriever, we normalize the start/end scores across the paragraphs. Furthermore a text span can appear multiple times in a paragraph. To give importance to all answer spans in the text, our objective aggregates (sums) the log-probability of the score for each answer position. Let $\mathcal { T } ( w , p )$ denote the token start positions where the answer span appears in the paragraph $p$ and let $w _ { S }$ be the starting word of the answer span. Our model maximizes the sum of the following objective for the start and end word of an answer spans as follows. (For brevity, we only show the objective for the starting word $( \mathbf { w } _ { s } )$ of the span.)
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\log \left( \frac { \sum _ { j \in \mathcal { P } } \sum _ { k \in \mathcal { Z } ( w _ { s } , p _ { j } ) } \exp ( \operatorname { s c o r e } _ { \mathrm { s t a r t } } ( k , j ) ) } { \sum _ { j \in \mathcal { P } } \sum _ { i = 1 } ^ { n _ { j } } \exp ( \operatorname { s c o r e } _ { \mathrm { s t a r t } } ( i , j ) ) } \right)
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Here, $\mathcal { P }$ denotes the set of all top-ranked paragraphs by the retriever, $n _ { j }$ denotes the number of tokens in paragraph $j$ and $\mathrm { s c o r e } _ { \mathrm { s t a r t } } \left( k , j \right)$ denotes the start score of the $k$ -th token in the $j$ -th paragraph.
|
| 80 |
+
|
| 81 |
+
Score aggregation during inference. During inference, following Chen et al. (2017); Seo et al. (2017), the score of a span that starts at token position $i$ and ends at position $j$ of paragraph $p$ is given by the sum of the $\mathrm { \ s c o r e } _ { \mathrm { s t a r t } } ( i , p )$ and $\operatorname { s c o r e } _ { \mathrm { e n d } } ( j , p )$ . During inference, we score spans up to a pre-defined maximum length of 15. Further, we add the scores of spans across different paragraphs (even if they are retrieved at different steps), if they have the same surface form. That is, if the same span (e.g. “Barack Obama”) occurs multiple times in several paragraphs, we sum the individual span scores. However, to ensure tractability, we only consider the top 10 scoring spans in each paragraph for aggregation. It should be noted that the changes we made to aggregate evidence over multiple paragraphs and mentions of spans needs no change to the original MRC architecture.
|
| 82 |
+
|
| 83 |
+
# 3 MULTI-STEP-REASONER
|
| 84 |
+
|
| 85 |
+
A novel component of our open-domain architecture is the multi-step-reasoner which facilitates iterative interaction between the retriever and the machine reader. The multi-step-reasoner a module comprised of a gated recurrent unit (Cho et al., 2014) which takes in the current state of the reader and the current query vector and does a gated update to produce a reformulated query. The reformulated query is sent back to the retriever which uses it to re-rank the paragraphs in the corpus. Since the gated update of the multi-step-reasoner, conditions on the current state of the machine reader, this multi-step interaction provides a way for the search engine (retriever) and the QA model (reader) to communicate with each other. This can also be seen as an instance of two agents cooperating via communication to solve a task (Lazaridou et al., 2017; Lee et al., 2018; Cao et al., 2018).
|
| 86 |
+
|
| 87 |
+
More formally, let $\mathbf { q } _ { \mathbf { t } } \in \mathbb { R } ^ { 2 d }$ be the current query representation which was most recently used by the paragraph retriever to score the paragraphs in the corpus. The multi-step-reasoner also has access to the reader state which is computed from the hidden memory vectors of the reader. The reader state captures the current information that the reader has encoded after reading the paragraphs that was sent by the retriever. Next we show how the reader state is computed.
|
| 88 |
+
|
| 89 |
+
Span extractive machine reading architectures compute a hidden representation for each token in the paragraph. Our framework needs access to these hidden representations to compute the reader state.
|
| 90 |
+
|
| 91 |
+
Let $\mathbf { m _ { j } } \in \mathbb { R } ^ { 2 p }$ be the hidden vector associated with the $j { \cdot }$ -th token in the paragraph. Let $\mathbf { L } \in \mathbb { R } ^ { 2 p }$ be the final query representation of the reader model. $\mathbf { L }$ is usually created by some pooling operation on the hidden representation of each question token. The reader state $\mathbf { S } \in \mathbb { R } ^ { \sum p }$ is computed from each of the hidden vectors $\mathbf { m } _ { \mathrm { j } }$ and $\mathbf { L }$ by first computing soft-attention weights between each paragraph token, followed by combining each $\mathbf { m _ { j } }$ with the soft attention weights.
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\alpha _ { \mathbf { j } } = \frac { \exp \left( \mathbf { m _ { j } } \cdot \mathbf { L } \right) } { \sum _ { j ^ { \prime } } \exp \left( \mathbf { m _ { j } ^ { \prime } } \cdot \mathbf { L } \right) } \qquad \mathbf { S } = \sum _ { j } \left( \alpha _ { \mathbf { j } } \cdot \mathbf { m _ { j } } \right)
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Finally, the new reformulated query $\mathbf { q } _ { \mathbf { t } + \mathbf { 1 } } \in \mathbb { R } ^ { 2 d }$ for the paragraph retriever is calculated by the multi-step-reasoner module as follows —
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathbf { q } _ { \mathbf { t } + 1 } ^ { ' } = \mathbf { G } \mathbf { R } \mathbf { U } \left( \mathbf { q } _ { \mathbf { t } } , \mathbf { S } \right) } \\ { \mathbf { q } _ { \mathbf { t } + 1 } = \mathrm { F F N } \left( \mathbf { q } _ { \mathbf { t } + 1 } ^ { ' } \right) } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
In our architecture, we used a 3 layer GRU network, followed by a one layer feed forward network (FFN) with a ReLU non-linearity. The gated update ensures that relevant information from ${ \bf q _ { t } }$ is preserved and new and useful information from the reader state $\mathbf { s }$ is added to the reformulated query.
|
| 104 |
+
|
| 105 |
+
# 3.1 TRAINING
|
| 106 |
+
|
| 107 |
+
There exists no supervision for training the query reformulation of the multi-step-reasoner. Instead, we employ reinforcement learning (RL) and train it by how well the reader performs after reading the new set of paragraphs retrieved by the modified query. We define the problem as a deterministic finite horizon Partially Observed Markov decision process (POMDP). The components of POMDP are —
|
| 108 |
+
|
| 109 |
+
States. A state in the state space consists of the entire text corpora, the query, the answer, and $k$ selected paragraphs. The reader is part of the environment and is fully described given the current state, i.e. selected paragraphs and the query.
|
| 110 |
+
|
| 111 |
+
Observations. The agent only observes a function of the current state. In particular, to the agent only the query vector and the memory of the reader model is shown, which are a function of the current state. Intuitively, this represents the information encoded by the machine reader model after reading the top $k$ paragraphs sent by the retriever in current step.
|
| 112 |
+
|
| 113 |
+
Actions. The set of all paragraphs in the text corpora forms the action space. The retriever scores all paragraphs w.r.t the current query and selects the top $k$ paragraphs to send to the reader model. We treat $k$ as a hyper-parameter in our experiments.
|
| 114 |
+
|
| 115 |
+
Reward. At every step, the reward is measured by how well the answer extracted by the reader model matches to the ground-truth answer. We use the $\mathrm { F } _ { 1 }$ score (calculated by word overlap between prediction and ground-truth) as the reward at each step.
|
| 116 |
+
|
| 117 |
+
Transition. The environment evolves deterministically after reading the paragraphs sent by the retriever.
|
| 118 |
+
|
| 119 |
+
Our policy $\pi$ is parameterized by the GRU and the FFN of the multi-step-reasoner. Let $r _ { t }$ denote the reward $F _ { 1 }$ score) returned by the environment at time $t$ . We directly optimize the parameters to maximize the expected reward given by — $\begin{array} { r } { J ( \boldsymbol { \Theta } ) = \mathbb { E } _ { \underline { { \pi } } } \left[ \sum _ { t = 1 } ^ { T } r _ { t } \right] } \end{array}$ . Here $T$ denotes the number of steps of interactions between the retriever and the reader. We treat the reward at each step equally and do not apply any discounting. Motivated by the REINFORCE (Williams, 1992) algorithm, we compute the gradient of our objective as
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\nabla _ { \boldsymbol { \Theta } } J ( \boldsymbol { \Theta } ) = \mathbb { E } _ { \boldsymbol { \pi } } \left[ \sum _ { t = 1 } ^ { T } \boldsymbol { r } _ { t } \cdot \log ( \pi _ { \boldsymbol { \Theta } } ( p _ { t } \mid q ) ) \right]
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Here, $p _ { t }$ is the top-ranked paragraph returned by the retriever at time $t$ and the probability that the current policy assigns to $p _ { t }$ is computed by normalizing the scores with a softmax. It is usual practice to add a variance reduction baseline (e.g. average of rewards in the minibatch) for stable training, but we found this significantly degrades the final performance. We think this is because, in QA, a minibatch consists of questions of varying difficulty and hence the rewards in a batch itself have high variance. This is similar to findings by Shen et al. (2017) for closed domain-QA (e.g. SQUAD).
|
| 126 |
+
|
| 127 |
+
Pretraining the multi-step-reasoner. We also find that pre-training the multi-step-reasoner before fine tuning with RL to be effective. We train to rank the similarity between the reformulated query vector and one of the distantly-supervised correct paragraph vectors higher than the score of a randomly sampled paragraph vector. Specifically, let q denote the query vector, $\mathbf { p } ^ { * } , \mathbf { p } ^ { \prime }$ denote the paragraph representation of paragraphs containing the correct answer string and a random sampled paragraph respectively. We follow the Bayesian Personalized Ranking approach of Rendle et al. (2009) and maximize $\log ( \sigma ( \mathbf { q } ^ { \top } \mathbf { p } ^ { * } - \mathbf { q } ^ { \top } \mathbf { p } ^ { ' } ) )$ . The paragraph representations $\mathbf { p } ^ { * } , \mathbf { p } ^ { \prime }$ are kept fixed and gradient only flows through $\mathbf { q }$ to the parameters of the multi-step-reasoner.
|
| 128 |
+
|
| 129 |
+
# 3.2 PUTTING IT ALL TOGETHER
|
| 130 |
+
|
| 131 |
+
Our open-domain architecture is summarized above in Algorithm 1. Given a large text corpora (as a list of paragraphs), the corresponding paragraph embeddings (which can be trained by the procedure in $( \ S 2 . 1 ) )$ and hyper-parameters $( \mathrm { T } , k )$ , our model $\mathcal { M }$ returns a text span $a$ as answer. The multi-step interaction between the retriever and reader can be best understood by the for loop in line 2 of algorithm 1. The initial query ${ \bf q 0 }$ is first used to rank all the paragraphs in the corpus (line 3), followed by which the top $k$ paragraphs are sent to the reader (line 4). The reader returns the answer span (with an associated score for the span) and also its internal state (line 5). The GRU network then takes in the current query and the reader state to produce the updated query which is then passed to the retriever (line 6). The retriever uses this updated query to again re-rank the paragraphs and the entire process is repeated for $\mathrm { T }$ steps. At the end of $\mathrm { T }$ steps, the model returns the span with the highest score returned by the reader model. The reader is trained using supervised learning (using the correct spans as supervision) and the parameters of the GRU network are trained using reinforcement learning. During training, we first pre-train the reader model by setting the number of multi-step reasoning steps $( \mathrm { T } = 1 )$ ). After the training converges, we freeze the parameters of the reader model and train the parameters of the GRU network using policy gradients. The output of the reader model is used to generate the reward which is used to train the policy network.
|
| 132 |
+
|
| 133 |
+
<table><tr><td colspan="2">Algorithm 1 Multi-step reasoning for open-domain QA</td></tr><tr><td colspan="2">Input: Question text Qtext, Text corpus (as a list of paragraphs)T,Paragraph embeddings P (list of paragraph embeddings for each paragraph in T),Model M, Number of multi-steps T, number</td></tr><tr><td>of top-ranked paragraphs k Output: Answer span a</td><td></td></tr><tr><td>1: qo ← encode_query(Qtext) 2: for t in range(T) do</td><td>#(2.1)</td></tr><tr><td>3: {𝑝1,P2,...Pk} ←M.retriever.score_paras(qt,P,k) # 4:</td><td># each pi denotes a paragraph id # get text for the top paragraphs</td></tr><tr><td>5: at,St,St ← M.reader.read(Plexk,Qtext)</td><td># (§ 2.2); St denotes reader state</td></tr><tr><td></td><td># at denotes answer span</td></tr><tr><td>6:qt ← M.multi_step-reasoner.GRU(qt,St)</td><td># st denotes the score of the span</td></tr><tr><td></td><td># (§ 3); Query reformulation step</td></tr><tr><td>7: end for</td><td></td></tr><tr><td>8:return answer span a with highest score</td><td></td></tr></table>
|
| 134 |
+
|
| 135 |
+
# 4 RELATED WORK
|
| 136 |
+
|
| 137 |
+
Open domain QA is a well-established task that dates back to few decades of reasearch. For example the BASEBALL system (Green Jr et al., 1961) aimed at answering open domain question albeit for a specific domain. Open-domain QA has been popularized by the Trec-8 task (Voorhees et al., 1999) and has recently gained significant traction due to the introduction of various datasets (Dunn et al., 2017; Dhingra et al., 2017; Joshi et al., 2017). In many open-domain systems (Chen et al., 2017), the retriever is a simple IR based system (e.g. tfidf retriever) with no trainable parameters and hence the retriever cannot overcome from its mistakes. Recent work such as $\mathbb { R } ^ { 3 }$ (Wang et al., 2018a), DS-QA (Lin et al., 2018) use a trained retriever and have shown improvement in performance. However they form query dependent paragraph representation and such architectures will not scale to full open-domain settings where the retriever has to rank millions of paragraphs. and neither do they support iterative reasoning thereby failing to recover from any mistakes made by the ranker or where evidence needs to be aggregated across multiple paragraphs.
|
| 138 |
+
|
| 139 |
+
Query Reformulation by augmenting the original query with terms from the top- $k$ retrieved document (Xu & Croft, 1996; Lavrenko & Croft, 2001) has proven to be very effective in information retrieval. Instead of using such automatic relevance feedback, Nogueira & Cho (2017) train a query reformulation model to maximize the recall of a IR system using RL and Pfeiffer et al. (2018) showed that query refinement is effective for IR in bio-medical domain. The main difference between this work and ours is that our model directly optimizes to improve the performance of a question answering system. However, as we show, we still see an improvement in the recall of our retriever $( \ S 5 . 1 )$ . Perhaps the most related to our work is Active Question Answering (AQA) (Buck et al., 2018), which use reformulation of the natural language query to improve the performance of a BiDAF reader model on SEARCHQA. The main difference between AQA is that we reformulate the query in vector space. We compare with AQA and show that our model achieves significantly better performance.
|
| 140 |
+
|
| 141 |
+
Iterative Reasoning has shown significant improvements in models using memory networks (Sukhbaatar et al., 2015; Miller et al., 2016) for question answering in text and knowledge bases (Das et al., 2017; Yang et al., 2017; Das et al., 2018). Our model can be viewed as a type of controller update step of memory network type of inference. Recently, iterative reasoning has shown to be effective in reading comprehension in single paragraph setting, where the model reads the same paragraph iteratively (Shen et al., 2017; Liu et al., 2017). Our work can be seen as a strict generalization of these in a more realistic, open-domain setting.
|
| 142 |
+
|
| 143 |
+
Nearest Neighbor Search - Computing fast nearest neighbor (NN) search is a fundamental requirement in many applications. We used exact k-NN search using SGTree (Zaheer et al., 2019) which has been shown to perform better than other exact k-NN strategies such as Cover Tree (Beygelzimer et al., 2006), P-DCI (Li & Malik, 2017) and other approximate NN search techniques such as RP-Tree (Dasgupta & Sinha, 2013), HNSW (Malkov & Yashunin, 2018). In general, our proposed multi-step-reasoner framework is not coupled to any particular kind of $\mathbf { k }$ -NN technique.
|
| 144 |
+
|
| 145 |
+
Table 2: Performance on test sets for various datasets
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Quasar-T</td><td colspan="2">SearchQA</td><td colspan="2">TRIVIAQA-unfiltered</td><td colspan="2">SQUAD-open</td></tr><tr><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>GA (Dhingra et al., 2016)</td><td>26.4</td><td>26.4</td><td>-</td><td>-</td><td>-</td><td></td><td>=</td><td>-</td></tr><tr><td>BIDAF (Seo et al., 2017)</td><td>25.9</td><td>28.5</td><td>28.6</td><td>34.6</td><td></td><td></td><td></td><td></td></tr><tr><td>AQA (Buck et al.,2018)</td><td>-</td><td>-</td><td>40.5</td><td>47.4</td><td>=</td><td></td><td></td><td>1</td></tr><tr><td>R (Wang et al.,2018a)</td><td>35.3</td><td>41.7</td><td>49.0</td><td>55.3</td><td>47.3</td><td>53.7</td><td>29.1</td><td>37.5</td></tr><tr><td>DS-QA*(Lin et al., 2018)</td><td>37.27</td><td>43.63</td><td>58.5</td><td>64.5</td><td>48.7</td><td>56.3</td><td>28.7</td><td>36.6</td></tr><tr><td>MINIMAL (Min etal.,2018)</td><td>=</td><td>-</td><td>=</td><td>=</td><td>-</td><td>-</td><td>34.7</td><td>42.5</td></tr><tr><td>Dr.QA baseline</td><td>36.87</td><td>45.49</td><td>51.36</td><td>58.24</td><td>48.00</td><td>52.13</td><td>27.1</td><td>-</td></tr><tr><td>multi-step-reasoner (Dr.QA)</td><td>39.53</td><td>46.67</td><td>55.01</td><td>61.61</td><td>55.93</td><td>61.66</td><td>31.93</td><td>39.22</td></tr><tr><td>multi-step-reasoner (BiDAF)</td><td>40.63</td><td>46.97</td><td>56.26</td><td>61.36</td><td>55.91</td><td>61.65</td><td></td><td>-</td></tr><tr><td>DocumentQA**(Clark & Gardner,2018)</td><td>-</td><td>-</td><td>-</td><td>=</td><td>61.56</td><td>68.03</td><td>=</td><td>1</td></tr></table>
|
| 148 |
+
|
| 149 |
+
∗ Despite our best efforts, we could not reproduce the results of Ds-QA using their code and hyperparameter settings for Quasar-T. ∗∗ The results on the test set of TRIVIAQA-unfiltered were not reported in the original paper. Results obtained from authors via e-mail.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Model</td><td>P@1</td><td>P@3</td><td>P@5</td></tr><tr><td>R³ (Wang et al., 2018a)</td><td>40.3</td><td>51.3</td><td>54.5</td></tr><tr><td>Our Retriever (initial)</td><td>35.7</td><td>49.6</td><td>56.3</td></tr><tr><td>+ multi-step (7 steps)</td><td>42.9</td><td>55.5</td><td>59.3</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 3: Retrieval performance on QUASAR-T. The match-LSTM based retriever of $\mathbb { R } ^ { 3 }$ is a more powerful model than our intial retrieval model. However, after few steps of multi-step-reasoner, the performance increases suggesting that re-ranking via query-reformulation is retrieving relevant evidence from the corpus. We report the $\mathrm { P @ } k$ on the last step.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 2: Scalability of retriever.
|
| 157 |
+
|
| 158 |
+
# 5 EXPERIMENTS
|
| 159 |
+
|
| 160 |
+
We now present experiments to show the effectiveness of each component of our framework. We experiment on the following large open-domain QA datasets — (a) TRIVIAQA-unfiltered– a version of TRIVIAQA (Joshi et al., 2017) built for open-domain QA. It has much more number of paragraphs than the web/wiki setting of TRIVIAQA. Moreover, there is no guarantee that every document in the evidence will contain the answer making this setting more challenging. (b) TRIVIAQA-open– To test our framework for large scale setting, we combine all evidence for every question in the development set. This resulted in a corpus containing 1.68M paragraphs per question. (c)
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Datasets</td><td>#q(test)</td><td>#p/q(test)</td></tr><tr><td>SEARCHQA</td><td>27,247</td><td>49.6</td></tr><tr><td>QUASAR-T</td><td>3.000</td><td>99.8</td></tr><tr><td>SQUAD-open</td><td>10,570</td><td>115.6</td></tr><tr><td>TRIVIAQA-unfiltered</td><td>10,790</td><td>149</td></tr><tr><td>TRIVIAQA-open</td><td>11,274</td><td>1,684,193</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 1: Statistics of various dataset. The second column shows the number of paragraphs for each query.
|
| 165 |
+
|
| 166 |
+
SEARCHQA (Dunn et al., 2017) – is another open-domain dataset which consists of question-answer pairs crawled from the J! archive. The paragraphs are obtained from 50 web snippets retrieved using the Google search API. (d) QUASAR-T (Dhingra et al., 2017) – consists of 43K open-domain questions where the paragraphs are obtained from the ClueWeb data source. (e) SQUAD-open– We also experimented on the open domain version of the SQUAD dataset. For fair comparison to baselines, our evidence corpus was created by retrieving the top-5 wikipedia documents as returned by the pipeline of Chen et al. (2017). The datasets are summarized in table 1.
|
| 167 |
+
|
| 168 |
+
# 5.1 PERFORMANCE OF PARAGRAPH RETRIEVER
|
| 169 |
+
|
| 170 |
+
We first investigate the performance of our paragraph retriever model $( \ S 2 . 1 )$ . Our retriever is based on inner product between the query and pre-computed paragraph vectors. This architecture, although more scalable, is less powerful than the retrievers of $\mathbb { R } ^ { 3 }$ and DS-QA which compute query-dependent passage representation via soft alignment (attention) before encoding with a bi-LSTM. Results in table 3 indeed show that retriever of $\mathbb { R } ^ { 3 }$ has better $\mathbf { P } @ k$ than our retriever. We also measure the performance of our retriever after few steps (#steps $= 7$ ) of interaction between the retriever and reader. As we can see from table 3, the query reformulation has resulted in better re-ranking and hence an overall improved performance of the retriever.
|
| 171 |
+
|
| 172 |
+
To test for scalability in open-domain settings, we conduct a synthetic experiment. We plot the wall-clock time (in seconds) taken by the retriever to score and rank paragraphs with a query. To test for scalability, we increase the number of paragraphs ranging from 500 to 100 million and test on a single Titan-X GPU. For our baseline, we use the GPU implementation of the retriever of DS-QA (Lin et al., 2018). For our model, we test on three variants — (a) inner product on GPU, (b) inner-product on CPU and (c) inner-product using SG-Tree. Figure 2 shows the results. Our retriever model on GPU is faster than DS-QA, since the latter perform much more computation compared to just inner-product in our case. Moreover, DS-QA quickly uses up all the available memory and throws a memory error (OOM) by just 100K paragraphs. The inner product operation scales up to 1M paragraph before going OOM. SG-Tree shows very impressive performance even though it operates on CPU and consistently outperforms dot product operation on the CPU.
|
| 173 |
+
|
| 174 |
+
# 5.2 EFFECTIVENESS OF MULTI-STEP-REASONER
|
| 175 |
+
|
| 176 |
+
Next we investigate the improvements in QA performance due to multi-step-reasoner. We report the commonly used exact-match (EM) and F1 score on each dataset.
|
| 177 |
+
|
| 178 |
+
Performance on benchmark datasets. Table 2 compares the performance of our model with various competitive baselines on four open-domain QA datasets. One of the main observation is that combining multi-step-reasoner with the base Dr.QA reader (Chen et al., 2017) always leads to improved performance. We also perform competitively to most baselines across all datasets.
|
| 179 |
+
|
| 180 |
+
Figure 3 shows the relative improvements our models achieve on QUASAR-T, SEARCHQA and TRIVIAQA-unfiltered with varying number of steps of interaction between the retriever and the reader. The key takeaway of this experiment is that multiple steps of interaction uniformly increases performance over base model (with no interaction). Different datasets have varying level of difficulties, however, the performance reaches its peak around 5 to 7 steps and does not provide much benefit on further increasing the number of steps.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 3: F1 score w.r.t number of steps.
|
| 184 |
+
|
| 185 |
+
# Large scale experiment on TRIVIAQA-open. The benchmark datasets for open-domain QA have
|
| 186 |
+
|
| 187 |
+
on an average hundred paragraphs for each question (Table 1). In real open-domain settings, the size of the evidence corpus might be much bigger. To test our model for the same, we created the TRIVIAQA-open setting, in which for each query we combined all the paragraphs in the development set, resulting in 1.6M paragraphs per query. We want to emphasize that the baseline models such as $\mathbb { R } ^ { 3 }$ and DS-QA will not scale to this large setting. The baseline $\mathrm { D r Q A }$ . model with no interaction between the retriever and reader get a score of $\mathrm { E M } = 3 7 . 4 5$ and $\mathrm { F } 1 = 4 2 . 1 6$ . The same model with 3 steps of interaction achieves a score of $\mathrm { E M } = 3 9 . 7 6$ and $\mathbf { F } 1 = \mathbf { 4 4 . 3 0 }$ . The key takeaways from this experiment are — (a) our framework can scale to settings containing millions of paragraphs, (b) iterative interaction still increase performance even in large scale settings, (c) the overall performance has significantly decreased (from 61 to 44.3 F1), suggesting that large context in open-domain QA is very challenging and should be an active area of research with significant scope for improvement.
|
| 188 |
+
|
| 189 |
+
# 5.3 ANALYSIS OF RESULTS
|
| 190 |
+
|
| 191 |
+
This section does further analysis of the results of the model. Specifically we are interested in analyzing if our method is able to gather more relevant evidence as we increase the number of steps of interaction between the retriever and the reader. We conduct this analysis on the development set of SEARCHQA (containing 13,393 queries) and to simplify analysis, we make the retriever choose the top scored single paragraph to send to the reader, at each step. The results are noted in table 4. As we can see from row 1 of table 4, on increasing steps of interaction, the quality of retrieved paragraphs
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 4: Examples of how multi-step-reasoner iteratively modifies the query by reading context to find more relevant paragraphs. Figure (left) shows an example where the initial retrieved context did not have the answer but the context provided enough hint to get more relevant paragraph in the next step. In figure (right), both the retrieved paragraph have the answer string leading to a boost in the score of the answer span because of score aggregation of spans (§2.2).
|
| 195 |
+
|
| 196 |
+
<table><tr><td></td><td colspan="3"># steps of interaction</td></tr><tr><td></td><td>3</td><td>5</td><td>7</td></tr><tr><td>#queries where initial retrieved para was incor- rect but correct para was retrieved later</td><td>1047</td><td>1199</td><td>1270</td></tr><tr><td>#queries where correct para wasn't retrieved at all</td><td>3783</td><td>3594</td><td>3505</td></tr><tr><td># queries where initial answer was incorrect but recoveredlater</td><td>490</td><td>612</td><td>586</td></tr><tr><td>Avg. number of unique paragraphs read across all steps</td><td>1.99</td><td>2.38</td><td>3.65</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 4: Analysis of results on the dev. set of SEARCHQA as we increase the number of steps of interaction between the retriever and reader. The retriever at each step sends top-1 paragraph to the reader. A paragraph is correct if it contains the correct answer string.
|
| 199 |
+
|
| 200 |
+
becomes better, i.e. even though the correct paragraph (containing the answer string) was not retrieved in the first step, the retriever is able to fetch relevant paragraphs later. It is also unsurprising to see, that when correct paragraphs are retrieved, the performance of the reader also increases. To check if the our policy was exploring and retrieving different paragraphs, we counted the mean number of unique paragraphs retrieved across all steps and found that it is high (around 2) when #steps of interaction is small as 3, suggesting that the policy chooses to explore initially. As the number of steps is increased, it increases at slower rate suggesting that if the policy has already found good paragraphs for the reader, it chooses to exploit them rather than choosing to explore.
|
| 201 |
+
|
| 202 |
+
Figure 4 shows two instances where iterative interaction is helpful. In figure to the left, the retriever is initially unable to find a paragraph that directly answers the question, however it finds a paragraph which gives a different name for the disease allowing it to find a more relevant paragraph that directly answers the query. In the figure to the right, after the query reformulation, both the retrieved paragraphs have the correct answer string. Since we aggregate (sum) the scores of spans, this leads to an increase in the score of the right answer span (Demeter) to be the maximum.
|
| 203 |
+
|
| 204 |
+
# 6 CONCLUSION
|
| 205 |
+
|
| 206 |
+
This paper introduces a new framework for open-domain question answering in which the retriever and the reader iteratively interact with each other. The resulting framework improved performance of machine reading over the base reader model uniformly across four open-domain QA datasets. We also show that our fast retrieval method can scale upto millions of paragraphs, much beyond the current capability of existing open-domain systems with a trained retriever module. Finally, we show that our method is agnostic to the architecture of the machine reading system provided we have access to the token level hidden representations of the reader. Our method brings an increase in performance to two popular and widely used neural machine reading architectures, Dr.QA and BiDAF.
|
| 207 |
+
|
| 208 |
+
# ACKNOWLEDGEMENTS
|
| 209 |
+
|
| 210 |
+
This work is funded in part by the Center for Data Science and the Center for Intelligent Information Retrieval, and in part by the National Science Foundation under Grant No. IIS-1514053 and in part by the International Business Machines Corporation Cognitive Horizons Network agreement number W1668553 and in part by the Chan Zuckerberg Initiative under the project Scientific Knowledge Base Construction. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of the sponsor.
|
| 211 |
+
|
| 212 |
+
# REFERENCES
|
| 213 |
+
|
| 214 |
+
Yoram Bachrach, Yehuda Finkelstein, Ran Gilad-Bachrach, Liran Katzir, Noam Koenigstein, Nir Nice, and Ulrich Paquet. Speeding up the xbox recommender system using a euclidean transformation for inner-product spaces. In RecSys, 2014.
|
| 215 |
+
|
| 216 |
+
Alina Beygelzimer, Sham Kakade, and John Langford. Cover trees for nearest neighbor. In ICML, 2006.
|
| 217 |
+
|
| 218 |
+
Penny A Bishop, Cynthia Reyes, and Susanna W Pflaum. Read smarter, not harder: Global reading comprehension strategies. The Reading Teacher, 2006.
|
| 219 |
+
|
| 220 |
+
Christian Buck, Jannis Bulian, Massimiliano Ciaramita, Andrea Gesmundo, Neil Houlsby, Wojciech Gajewski, and Wei Wang. Ask the right questions: Active question reformulation with reinforcement learning. In ICLR, 2018.
|
| 221 |
+
|
| 222 |
+
Kris Cao, Angeliki Lazaridou, Marc Lanctot, Joel Z Leibo, Karl Tuyls, and Stephen Clark. Emergent communication through negotiation. arXiv preprint arXiv:1804.03980, 2018.
|
| 223 |
+
|
| 224 |
+
Danqi Chen, Adam Fisch, Jason Weston, and Antoine Bordes. Reading wikipedia to answer opendomain questions. In ACL, 2017.
|
| 225 |
+
|
| 226 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger ¨ Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 227 |
+
|
| 228 |
+
Christopher Clark and Matt Gardner. Simple and effective multi-paragraph reading comprehension. In ACL, 2018.
|
| 229 |
+
|
| 230 |
+
Dick Cunningham and Scott L Shablak. Selective reading guide-o-rama: The content teacher’s best friend. Journal of Reading, 1975.
|
| 231 |
+
|
| 232 |
+
Rajarshi Das, Manzil Zaheer, Siva Reddy, and Andrew McCallum. Question answering on knowledge bases and text using universal schema and memory networks. In ACL, 2017.
|
| 233 |
+
|
| 234 |
+
Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alex Smola, and Andrew McCallum. Go for a walk and arrive at the answer: Reasoning over paths in knowledge bases using reinforcement learning. In ICLR, 2018.
|
| 235 |
+
|
| 236 |
+
Sanjoy Dasgupta and Kaushik Sinha. Randomized partition trees for exact nearest neighbor search. In COLT, 2013.
|
| 237 |
+
|
| 238 |
+
Bhuwan Dhingra, Hanxiao Liu, Zhilin Yang, William W Cohen, and Ruslan Salakhutdinov. Gatedattention readers for text comprehension. arXiv preprint arXiv:1606.01549, 2016.
|
| 239 |
+
|
| 240 |
+
Bhuwan Dhingra, Kathryn Mazaitis, and William W Cohen. Quasar: Datasets for question answering by search and reading. arXiv preprint arXiv:1707.03904, 2017.
|
| 241 |
+
|
| 242 |
+
Geoffrey B Duggan and Stephen J Payne. Text skimming: The process and effectiveness of foraging through text under time pressure. Journal of Experimental Psychology: Applied, 2009.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Bert F Green Jr, Alice K Wolf, Carol Chomsky, and Kenneth Laughery. Baseball: an automatic question-answerer. In IRE-AIEE-ACM, 1961.
|
| 247 |
+
|
| 248 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997.
|
| 249 |
+
|
| 250 |
+
Phu Mon Htut, Samuel R Bowman, and Kyunghyun Cho. Training a ranking function for open-domain question answering. arXiv preprint arXiv:1804.04264, 2018.
|
| 251 |
+
|
| 252 |
+
Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In ACL, 2017.
|
| 253 |
+
|
| 254 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 255 |
+
|
| 256 |
+
Victor Lavrenko and W Bruce Croft. Relevance-based language models. In SIGIR, 2001.
|
| 257 |
+
|
| 258 |
+
Angeliki Lazaridou, Alexander Peysakhovich, and Marco Baroni. Multi-agent cooperation and the emergence of (natural) language. In ICLR, 2017.
|
| 259 |
+
|
| 260 |
+
Jason Lee, Kyunghyun Cho, Jason Weston, and Douwe Kiela. Emergent translation in multi-agent communication. In ICLR, 2018.
|
| 261 |
+
|
| 262 |
+
Ke Li and Jitendra Malik. Fast k-nearest neighbour search via prioritized dci. In ICML, 2017.
|
| 263 |
+
|
| 264 |
+
Yankai Lin, Haozhe Ji, Zhiyuan Liu, and Maosong Sun. Denoising distantly supervised open-domain question answering. In ACL, 2018.
|
| 265 |
+
|
| 266 |
+
Xiaodong Liu, Yelong Shen, Kevin Duh, and Jianfeng Gao. Stochastic answer networks for machine reading comprehension. arXiv preprint arXiv:1712.03556, 2017.
|
| 267 |
+
|
| 268 |
+
Yury A Malkov and Dmitry A Yashunin. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. TPAMI, 2018.
|
| 269 |
+
|
| 270 |
+
Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes, and Jason Weston. Key-value memory networks for directly reading documents. arXiv preprint arXiv:1606.03126, 2016.
|
| 271 |
+
|
| 272 |
+
Sewon Min, Victor Zhong, Richard Socher, and Caiming Xiong. Efficient and robust question answering from minimal context over documents. arXiv preprint arXiv:1805.08092, 2018.
|
| 273 |
+
|
| 274 |
+
Mike Mintz, Steven Bills, Rion Snow, and Dan Jurafsky. Distant supervision for relation extraction without labeled data. In ACL, 2009.
|
| 275 |
+
|
| 276 |
+
Rodrigo Nogueira and Kyunghyun Cho. Task-oriented query reformulation with reinforcement learning. In EMNLP, 2017.
|
| 277 |
+
|
| 278 |
+
Jonas Pfeiffer, Samuel Broscheit, Rainer Gemulla, and Mathias Goschl. A neural autoencoder ¨ approach for document ranking and query refinement in pharmacogenomic information retrieval. In BioNLP workshop, ACL, 2018.
|
| 279 |
+
|
| 280 |
+
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In EMNLP, 2016.
|
| 281 |
+
|
| 282 |
+
Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In UAI, 2009.
|
| 283 |
+
|
| 284 |
+
Minjoon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. In ICLR, 2017.
|
| 285 |
+
|
| 286 |
+
Yelong Shen, Po-Sen Huang, Jianfeng Gao, and Weizhu Chen. Reasonet: Learning to stop reading in machine comprehension. In KDD, 2017.
|
| 287 |
+
|
| 288 |
+
Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks. In NIPS, 2015.
|
| 289 |
+
|
| 290 |
+
Swabha Swayamdipta, Ankur P Parikh, and Tom Kwiatkowski. Multi-mention learning for reading comprehension with neural cascades. In ICLR, 2018.
|
| 291 |
+
|
| 292 |
+
Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. Newsqa: A machine comprehension dataset. arXiv preprint arXiv:1611.09830, 2016.
|
| 293 |
+
|
| 294 |
+
Ellen M Voorhees, others, et al. The trec-8 question answering track report. In Trec, 1999.
|
| 295 |
+
|
| 296 |
+
Shuohang Wang and Jing Jiang. Machine comprehension using match-lstm and answer pointer. In ICLR, 2017.
|
| 297 |
+
|
| 298 |
+
Shuohang Wang, Mo Yu, Xiaoxiao Guo, Zhiguo Wang, Tim Klinger, Wei Zhang, Shiyu Chang, Gerald Tesauro, Bowen Zhou, and Jing Jiang. R3: Reinforced ranker-reader for open-domain question answering. In AAAI, 2018a.
|
| 299 |
+
|
| 300 |
+
Shuohang Wang, Mo Yu, Jing Jiang, Wei Zhang, Xiaoxiao Guo, Shiyu Chang, Zhiguo Wang, Tim Klinger, Gerald Tesauro, and Murray Campbell. Evidence aggregation for answer re-ranking in open-domain question answering. In ICLR, 2018b.
|
| 301 |
+
|
| 302 |
+
Wei Wang, Ming Yan, and Chen Wu. Multi-granularity hierarchical attention fusion networks for reading comprehension and question answering. In ACL, 2018c.
|
| 303 |
+
|
| 304 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 1992.
|
| 305 |
+
|
| 306 |
+
Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. In ICLR, 2017.
|
| 307 |
+
|
| 308 |
+
Jinxi Xu and W Bruce Croft. Quary expansion using local and global document analysis. In SIGIR, 1996.
|
| 309 |
+
|
| 310 |
+
Fan Yang, Zhilin Yang, and William W Cohen. Differentiable learning of logical rules for knowledge base reasoning. In NeurIPS, 2017.
|
| 311 |
+
|
| 312 |
+
Adams Wei Yu, David Dohan, Minh-Thang Luong, Rui Zhao, Kai Chen, Mohammad Norouzi, and Quoc V Le. Qanet: Combining local convolution with global self-attention for reading comprehension. In ICLR, 2018.
|
| 313 |
+
|
| 314 |
+
Manzil Zaheer, Guru Guruganesh, Golan Levin, and Alex Smola. Terrapattern: A nearest neighbor search service. In Arxiv, 2019.
|
md/train/HkxAS6VFDB/HkxAS6VFDB.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PRUNE OR QUANTIZE? STRATEGY FOR PARETOOPTIMALLY LOW-COST AND ACCURATE CNN
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Pruning and quantization are typical approaches to reduce the computational cost of convolutional neural network (CNN) inference. Although the idea of combining both approaches seems natural, it is surprisingly difficult to determine the effects of the combination without measuring performance on the specific hardware that the user will use. This is because the benefits of pruning and quantization strongly depend on the hardware architecture where the model is executed. For example, a CPU-like architecture with no parallelization may fully exploit the reduction of computations by unstructured pruning to improve speed, but a GPUlike massive parallel architecture would not. Further, there have been emerging proposals of novel hardware architectures, such as those supporting variable bitprecision quantization. From an engineering viewpoint, optimization for each hardware architecture is useful and important in practice, but this is in essence a brute-force approach. Therefore, in this paper, we first propose a hardwareagnostic metric for measuring computational costs. Using the proposed metric, we demonstrate that Pareto-optimal performance, where the best accuracy is obtained at a given computational cost, is achieved when a slim model with fewer parameters is moderately quantized rather than a fat model with a huge number of parameters is quantized to extremely low bit precision, such as binary or ternary. Furthermore, we empirically find a possible quantitative relation between the proposed metric and the signal-to-noise ratio during stochastic gradient descent (SGD) training, by which information obtained during SGD training provides an optimal policy for quantization and pruning. We show the Pareto frontier is improved by $4 \times$ in a post-training quantization scenario based on these findings. These findings not only improve the Pareto frontier for accuracy versus computational cost, but also provide new insights into deep neural networks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reducing execution cost of deep learning inference is one of the most active research topics for applying superhuman recognition in embedded IoT devices and robots. A typical approach for employing memory- and computation-efficient components is separable convolution, which is a combination of depth-wise and point-wise convolutions (Iandola et al., 2016; Zoph et al., 2018; Zhang et al., 2018; Howard et al., 2017), structured/unstructured pruning of connections and activations, and quantizing activation, weight, and their vectors (Stock et al., 2019; Jegou et al., 2011; Gong et al., 2014). Among these, separable convolution and structured pruning are similar, in that separable convolution can be viewed as convolutions pruned in a handcrafted manner. From a pruning viewpoint, since the separable convolution structure results from applying aggressive pruning to normal convolution, the result is drastic reductions in memory and computational cost at the expense of greatly decreased accuracy (Stock et al., 2019). On the other hand, structured pruning and quantization are seemingly orthogonal approaches that can be naturally combined (Tung & Mori, 2018; Han et al., 2016). However, their interactions are still not well-studied. For instance, the use of a single-bit representation is being actively explored as an extreme quantization. Since a nonnegligible accuracy drop is inevitable in extreme quantization, some papers have proposed increasing the number of channels to compensate for the lack of expressivity (Lin et al., 2017). In other words, a quantization approach can further reduce the number of bits by compromising the increase in number of channels, or the increase in number of computations. This indicates that, conversely, reducing channels by pruning may limit capability for quantization. This discussion raises a controversial question: which is better, a fat model with smaller bit width or a slim model with larger bit width? Answering this question requires a metric that fairly measures the effects of both pruning and quantization. One such metric in the literature is the inference speed when the model is executed on specific hardware. This metric is useful or even ideal when the target hardware is known in advance but strongly depends on features of the hardware architecture. Yang et al. (2018) searched for an optimal architecture using inference time as the optimization objective and found different optimal architectures depending on the target device. For example, if the hardware cannot handle extremely low bit-widths (1 or 2 bits), instead treating them as 8-bit integers with upper bits filled with zeros, we cannot exploit the reduction of bit width to improve inference speed. From a theoretical viewpoint, figuring out the extent to which we can reduce the computational complexity of deep neural networks is another important open question.
|
| 12 |
+
|
| 13 |
+
The discussion so far urges us to develop a hardware-agnostic and theoretically reasonable metric for measuring computational costs of neural network architectures. In this paper, we propose the Frobenius norm of the effective value of weight parameters as one such metric. This metric is proportional to the total energy when the model is executed on ideal hardware, where energy consumption for a single multiply-accumulate (MAC) computation is proportional to the squared effective amplitude of the individual weight parameter used for the MAC computation. The basic idea of the metric is analogous to a highly efficient class-B amplifier circuit whose energy consumption is determined by the instant signal amplitude (Sechi, 1976). This metric successfully reflects the effects of both quantization and structured/unstructured pruning in accordance with intuition.
|
| 14 |
+
|
| 15 |
+
Using the proposed metric, we empirically find that a slimmer model can achieve a far better Pareto frontier in a lower computational cost region than can a fatter model after quantization, while a fat model is advantageous for achieving higher accuracy in a larger computational cost region. Finally, we perform experiments under a post-training quantization scenario (Banner et al., 2018) on ImageNet dataset (Deng et al., 2009) to verify the validity of our claim, namely that prune-then-quantize is superior to quantize-only or prune-only for achieving a better Pareto frontier.
|
| 16 |
+
|
| 17 |
+
Further, since this metric is relevant to the signal-to-noise ratio $( S / N )$ , it is measurable during SGD training, in which the absolute value of weights and the random walk of weight parameters correspond to signal and noise, respectively. We observe that the dependencies of the metric on validation accuracy seem to be correlated between those during training and those applying quantization after training. From this observation, we point out some possibilities for which we could expect robustness of a model for quantization from information obtained during training, we could determine an optimal policy for quantization of that model, and we could develop a novel optimization or regularization scheme.
|
| 18 |
+
|
| 19 |
+
The main contributions of this paper are as follows:
|
| 20 |
+
|
| 21 |
+
• We define a hardware-agnostic metric for measuring the computational cost of pruned and quantized models. We empirically find that models with fewer parameters achieve far better accuracy in a low computational cost region after quantization.
|
| 22 |
+
• We show a potential quantitative relation between quantization noise and perturbation of weight parameters during SGD training.
|
| 23 |
+
|
| 24 |
+
And as implications, we hope to exploit our findings for
|
| 25 |
+
|
| 26 |
+
• thorough comparison of various neural network architectures using the proposed hardwareagnostic metric,
|
| 27 |
+
• development of a method for extracting a quantization policy from information obtained during SGD training, and
|
| 28 |
+
• development of a training algorithm or regularization scheme for producing robust models based on the relation between quantization noise and perturbation of weight parameters during SGD training.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 1: Left/Center: Computational cost strongly depends on the hardware architecture on which the model is executed. Right: Proposed computational cost for analysis or theoretical research, assuming an ideal hardware architecture.
|
| 32 |
+
|
| 33 |
+
# 2 EFFECTIVE SIGNAL NORM
|
| 34 |
+
|
| 35 |
+
We seek a metric that properly reflects the effects of both quantization and pruning. Conventionally, quantization effectiveness is evaluated according to the number of bits required to achieve a given accuracy, or the accuracy achieved by using certain bit numbers for specific network architectures (Stock et al., 2019). We cannot use this to compare efficiencies between different architecture models (e.g., MobileNet versus ResNet-18). The number of MAC computations or parameters can be used to compare different architectures, but the number of MAC computations does not consider quantization and the number of parameters is not directly related to inference time.
|
| 36 |
+
|
| 37 |
+
Recently, the use of actual or estimated inference speeds as a metric for comparing network architectures has been proposed (Yang et al., 2018; Wang et al., 2019a; Cai et al., 2019). This metric is very useful when the target hardware is known in advance, and ideal for those who wish to use the model that performs best on that hardware. However, this metric is strongly hardware dependent. Indeed, Yang et al. (2018); Wang et al. (2019a); Cai et al. (2019) found that optimal architectures for different types of target hardware are totally different. Considering interest in, for example, the simplest realizable deep neural network model while achieving a required accuracy, there is a need for a hardware-agnostic metric.
|
| 38 |
+
|
| 39 |
+
The metric for model evaluation should correlate with energy consumed when the model is executed on ideal hardware. We assume that energy consumption by ideal hardware monotonically decreases when the bit width is reduced by quantization and when the number of nonzeros in weight parameters is reduced by pruning. For example, hardware with an 8-bit integer MAC array cannot be further accelerated even if the bit width is reduced from 8 to 1 or 2 bits. Thus, the energy consumption measured using such hardware does not satisfy the aforementioned requirement and cannot be our metric. Hardware like a CPU, which processes each computation in serial, can naturally exploit the structured or unstructured sparsity of weight parameters by skipping computations with zeroed weights. However, because it is difficult to parallelize computations while maintaining such a strategy, it is generally difficult to benefit from sparsity in GPU-like hardware employing massively parallel MAC units. Hardware dedicated to sparse convolution (Lu et al., 2019) tends to show better performance only when sparsity is sufficiently high, due to relatively large overheads for encoding and decoding sparse weight parameters in a special format.
|
| 40 |
+
|
| 41 |
+
Therefore, the benefit of sparsity from pruning and low bit width from quantization largely depends on the hardware architecture, so long as we consider only existing hardware. Because we require a hardware-agnostic metric, we assume ideal hardware in which energy consumption is linearly proportional to the number of nonzero weight parameters and monotonically depends on the bit width of weight parameters, as shown in Figure 1, setting aside the feasibility of such ideal hardware.
|
| 42 |
+
|
| 43 |
+
# 2.1 DEFINITION OF EFFECTIVE SIGNAL NORM
|
| 44 |
+
|
| 45 |
+
We define a metric called the effective signal norm (ESN) as
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathrm { E S N } = \sum _ { l } | | c ^ { l } f ( \mathbf { W } _ { \mathrm { i n t } } ^ { l } ) | | _ { F } ^ { 2 } ,
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
with $\mathbf { \boldsymbol { \mathsf { W } } } _ { \mathrm { i n t } } ^ { l } = \lfloor \mathbf { \boldsymbol { \mathsf { W } } } ^ { l } / \varDelta ^ { l } \rfloor + 0 . 5$ , where $\boldsymbol { \mathsf { W } } ^ { l }$ is the weight tensor and $\varDelta ^ { l }$ is the quantization step size of the th layer; and $\bar { c } ^ { l }$ is a coefficient depending on the layer, in that if $c ^ { l } = 1$ , ESN is related to the number of parameters (cf. memory footprint), and if $c ^ { l }$ is the number of computations per parameter at the lth layer, ESN is related to the number of computations (cf. FLOP). ${ \bar { f } } ( \cdot )$ is an element-wise function that determines how the metric responds to the value of each weight parameter. We propose two functions for $f ( \cdot )$ . The first is $f ( \bar { \mathbf { W } _ { \mathrm { i n t } } ^ { l } } ) = \mathbf { W } _ { \mathrm { i n t } } ^ { l }$ , based on the assumption that energy consumption increases with the square of the value for each weight parameter or for each computation. When $c ^ { l } = 1$ , the definition is
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathrm { E S N } _ { a } = \sum _ { l } | | \mathbf { W } _ { \mathrm { i n t } } ^ { l } | | _ { F } ^ { 2 } .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
This assumption is reasonable when we employ an analog (or in-memory) MAC computation engine (Shafiee et al., 2016; Miyashita et al., 2017), because energy consumption is proportional to the square of the signal amplitude when the signal represents an analog quantity such as voltage or current. Assuming ideal hardware, we adopt a definition where energy consumption varies according to the instant amplitude (cf. class-B amplifier), which is more energy efficient than the case where energy consumption is constant and the value is determined by the maximal amplitude (cf. class-A amplifier) (Sechi, 1976).
|
| 58 |
+
|
| 59 |
+
The second proposed function is $f ( \mathbf { W } _ { \mathrm { i n t } } ^ { l } ) = \lceil \log _ { 2 } ( \mathrm { a b s } ( \mathbf { W } _ { \mathrm { i n t } } ^ { l } ) ) + 1 \rceil$ , where $\log _ { 2 } \left( \cdot \right)$ and $\mathrm { a b s } \left( { \cdot } \right)$ are functions applied to each element of a tensor argument. This is based on the assumption that energy consumption increases with the binary logarithm of the value for each weight parameter. When $c ^ { l } = 1$ , the definition is
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathrm { E S N } _ { d } = \sum _ { l } \vert \vert \lceil \log _ { 2 } ( \mathrm { a b s } ( \boldsymbol { \mathsf { W } } _ { \mathrm { i n t } } ^ { l } ) ) + 1 \rceil \vert \vert _ { F } ^ { 2 } .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
In a digital circuit, a number is represented as a binary digit (bits), so the energy consumption for moving or processing signals is roughly proportional to the number of bits, which is the binary logarithm of the value. It is therefore reasonable to use Equation (3) for a digital circuit.
|
| 66 |
+
|
| 67 |
+
# 2.2 RELATION BETWEEN ESN AND S/N
|
| 68 |
+
|
| 69 |
+
The effective signal norm defined in Equation (2) is related to the signal-to-noise ratio $( S / N )$ when quantization noise is dominant and noise is approximated by a uniform distribution (Gray & Neuhoff, 1998).
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathrm { E S N } _ { a } = \sum _ { l } \left( \frac { | | \mathbf { W } ^ { l } | | _ { F } ^ { 2 } } { | | \mathbf { W } ^ { l } - \varDelta \cdot \mathbf { W } _ { \mathrm { i n t } } ^ { l } | | _ { F } ^ { 2 } } \cdot \frac { | | \mathbf { W } ^ { l } | | _ { 0 } } { 1 2 } \right) = \sum _ { l } \left( S / N _ { l } \cdot \frac { | | \mathbf { W } ^ { l } | | _ { 0 } } { 1 2 } \right) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $l$ is the layer index, $S / N _ { l }$ is the signal-to-quantization-noise ratio of the lth layer as defined by ||Wl||2FWl ∆ Wl 2 , and ||Wl||0 is the number of nonzero elements in the tensor Wl. Appendix E presents the derivation of Equation (4). This equation allows us to calculate $\mathrm { E S N } _ { a }$ , so long as $S / N$ is defined.
|
| 76 |
+
|
| 77 |
+
# 2.3 $\mathrm { E S N } _ { a }$ DURING TRAINING
|
| 78 |
+
|
| 79 |
+
For example, we can define $S / N$ by regarding perturbation of weight parameters during training as noise. Formally, we define the signal and noise at the $j$ th epoch as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
S _ { j } = \sum _ { l } \sum _ { i } | | \mathbf { W } _ { j , i } ^ { l } | | _ { F } ^ { 2 } , ~ N _ { j } = \sum _ { l } \sum _ { i } | | \mathbf { W } _ { j , i } ^ { l } - \mathbf { W } _ { \mathrm { i n i t } _ { j } } ^ { l } | | _ { F } ^ { 2 } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\boldsymbol { \mathsf { W } } _ { j , i } ^ { l }$ is the weight parameters in the lth layer at the $i$ th iteration in the $j$ th epoch, and $\mathbf { \Delta } \mathbf { W } _ { \mathrm { i n i t } _ { j } } ^ { l }$ is a snapshot of the weight at the beginning of the $j$ th epoch. Then, $N _ { j }$ is the effective value of random walk noise for weight parameters in one epoch.
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 2: Training curves of $\mathrm { E S N } _ { a }$ (left) and validation accuracy (right) on CIFAR-10. In the right graph, moving average curve between 3-epochs is overlapped on each plot.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 3: Relation between validation accuracy and $\mathrm { E S N } _ { a }$ during training and after quantization. $\mathrm { E S N } _ { a }$ of the former is computed using Equation (5), and that of the latter is computed using Equation (2)
|
| 92 |
+
|
| 93 |
+
The left figure in Figure 2 shows the $\mathrm { E S N } _ { a }$ curve during training, which is calculated by Equation (4), and $S / N$ as defined by Equation (5). In this experiment, we use ResNet-20 (He et al., 2016) on CIFAR-10 dataset (Krizhevsky, 2009). We use SGD with momentum 0.9, and we set the mini-batch size to 100 and the initial learning rate to 0.1, which is shifted by $1 / 1 0$ at epochs 80 and 120. We vary the weight decay factor from $\overline { { 5 } } \times 1 0 ^ { - 4 }$ to $2 \times 1 0 ^ { - 3 }$ , indicated by different colors in Figure 2.
|
| 94 |
+
|
| 95 |
+
Interestingly, the $\mathrm { E S N } _ { a }$ curves look very similar to the validation accuracy curves shown in the right figure in Figure 2. Both $\mathrm { E S N } _ { a }$ and validation accuracy steeply increase at the point where the learning rate is decreased by $1 / 1 0$ , because decreasing the learning rate reduces perturbation (or random walk) of weight values during one epoch, increasing $S / N$ . We can also see that as the weight decay factor increases, $\mathrm { E S N } _ { a }$ tends to decrease. This is also reasonable, because weight decay decreases $| | \pmb { \mathsf { W } } | | _ { F } ^ { 2 }$ or the signal level, reducing $S / N$ . More interestingly, even this trivial tendency appears correlated with validation accuracy; for example, after a steep rise at epoch 80, both $\mathrm { E S N } _ { a } ^ { * }$ and validation accuracy gradually decrease, converging to stable values after overshooting. There is a similar relation between the amount of overshoot and weight decay factor, namely, we observed a larger overshoot with a smaller weight decay factor. These findings might be useful for developing a novel optimization algorithm, but we leave this for future work.
|
| 96 |
+
|
| 97 |
+
The blue plots in Figure 3 show $\mathrm { E S N } _ { a }$ versus validation accuracy. In this experiment, we use VGG7 (Simonyan & Zisserman, 2014) and ResNet-20 on CIFAR-10, and DenseNet-BC with $l =$ 100, $k = 1 2$ (Huang et al., 2017) on CIFAR-100. We employ SGD with momentum 0.9 and set the initial learning rate to 0.1, followed by cosine annealing without restart (Ilya Loshchilov, 2017). The mini-batch size and weight decay factor are respectively set to 125 and $5 \times 1 0 ^ { - 4 }$ .
|
| 98 |
+
|
| 99 |
+
The red curve shows the $\mathrm { E S N } _ { a }$ versus validation accuracy curve when applying quantization to weight parameters trained by the training process where the blue plots are obtained. As the figure shows, the red and blue curves seem to be correlated. This suggests that the model acquires robustness to quantization by having experienced similar perturbations due to a random walk during the training process. If so, the $\mathrm { E S N } _ { a }$ versus validation accuracy curve during training is available as a loose boundary on accuracy degradation due to decrease of $\mathrm { E S N } _ { a }$ by quantization. We discuss this hypothesis in Section 2.7 again.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 4: Accuracy versus $\mathrm { E S N } _ { a }$ (left) and $\mathrm { E S N } _ { d }$ (right) for various network depths and widths.
|
| 103 |
+
|
| 104 |
+
# 2.4 ESN VERSUS ACCURACY FOR VARIOUS MODEL SIZES
|
| 105 |
+
|
| 106 |
+
With our metric defined, we next attempt to investigate which is better, a model that is slim (with the number of weight parameters and computations reduced by pruning) and mildly quantized (e.g., with 4–5 bits), or a model that is fat (with a large number of weight parameters and computations) and radically quantized (e.g., with 1–2 bits). We evaluate six network architectures with different depths and widths: ResNet-8, 14, 20 and VGG7 with different channel widths $( 1 \times , 0 . 5 \times , 0 . 2 5 \times )$ on CIFAR-10 dataset. In this experiment, we employ networks with originally small number of parameters as slim models instead of pruning fat models. The network architecture of ResNet is based on the original one without bottleneck architecture (He et al., 2016). The detailed network architecture of VGG7 is shown in Appendix F.
|
| 107 |
+
|
| 108 |
+
Figure 4 shows validation accuracy versus $\mathrm { E S N } _ { a }$ and $\mathrm { E S N } _ { d }$ . Here, we consider differences in $\mathrm { E S N } _ { a }$ and $\mathrm { E S N } _ { d }$ . For simplicity, we assume that all weight parameters have the same value $v > 1$ , and that the number of weight parameters is $N$ . The definitions of $\mathrm { E S N } _ { a }$ and $\mathrm { E S N } _ { d }$ are expressed as follows,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\mathrm { E S N } _ { a } = v ^ { 2 } \times N , \mathrm { E S N } _ { d } = \left\lceil \log _ { 2 } v + 1 \right\rceil \times N .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Therefore, when we compare $\mathrm { E S N } _ { a }$ and $\mathrm { E S N } _ { d }$ , both are linearly proportional to the number of weight parameters, whereas values of weight parameters affect the metric at squared and logarithmic scales, respectively. This means that $\mathrm { E S N } _ { a }$ is more strongly dependent on the size of the values than on the number of weight parameters, and the opposite is true for $\mathrm { E S N } _ { d }$ . In other words, $\mathrm { E S N } _ { d }$ is more sensitive to pruning than to quantization, and $\mathrm { E S N } _ { a }$ is more sensitive to quantization than to pruning. Figure 4 clearly shows these tendencies. We can see that even when using the $\mathrm { E S N } _ { a }$ metric, which is advantageous for quantization, the slimmer model shows better validation accuracy in lower ESN regions. These experiments indicate that in lower ESN regions, or with lower energy consumption by ideal hardware, especially when employing digital computing, it is an advisable strategy to prune the model to the limit where the desired accuracy is achieved, and then to apply quantization to obtain the highest possible accuracy. In contrast, it is a bad strategy to apply quantization to a fat model, even if it shows much better accuracy than the pruned slim model before quantization. Consequently, to the question posed at the beginning of this subsection—whether a slim and mildly quantized model or a fat and radically quantized model is better—the answer is the former one, which may in a sense raise a question on trends in quantization research. Note that the above discussion also indicates that the importance of quantization will be relatively increased if analog computing become practical in the future.
|
| 115 |
+
|
| 116 |
+
# 2.5 TRAINING UNDER LOW-ESN CONDITIONS
|
| 117 |
+
|
| 118 |
+
We next observe how the weight parameters evolve in the training process. Figure 5 shows from left to right the loss, $\mathrm { E S N } _ { a }$ , and number of pruned filters (output channels). In this experiment, we train ResNet-20 on CIFAR-10 dataset with initial weight parameters of a trained model. We employ SGD with momentum 0.9, weight decay factor $5 \times 1 \bar { 0 } ^ { - 4 }$ , and mini-batch size 200, updating for 20 epochs. The learning rate (LR) is constant, with a value varied from 0.32 to 1.81 for each training. Note that we do not intentionally prune filters in this experiment; rather, filter pruning spontaneously occurs along with sequential updates of weight parameters by SGD. The center graph shows that as the learning rate increases, $\mathrm { E S N } _ { a }$ decreases due to the larger noise. The number of pruned filters after epoch 20 is larger with the larger learning rate, which corresponds to smaller $\mathrm { E S N } _ { a }$ . In the training process, rather than continuing to increase at a constant rate throughout the training process, the number of pruned filters steeply increases within a few epochs and then is maintained without noticeable change.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 5: Training curves for loss, $\mathrm { E S N } _ { a }$ , and number of pruned filters under different learning rate (LR) conditions. $\mathrm { E S N } _ { a }$ is calculated by Equations (4) and (5).
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 6: Accuracy versus $\mathrm { E S N } _ { a / d }$ (left/center) and histogram of the maximal bit width for each filter (right) in the pruning only, quantization only, and prune-then-quantize mixed cases.
|
| 125 |
+
|
| 126 |
+
This indicates that under a small $\mathrm { E S N } _ { a }$ condition controlled by the learning rate, the optimizer finds a solution for reducing the number of parameters by pruning filters and prioritizing increases in amplitude of the remaining parameters, rather than letting all parameters survive with small amplitude.
|
| 127 |
+
|
| 128 |
+
# 2.6 PRUNE then QUANTIZE
|
| 129 |
+
|
| 130 |
+
In the previous two subsections, we empirically showed that achieving optimal accuracy in a low ESN region requires preparation of a slim model before applying quantization. A slim model can be generated by pruning a fat model or by designing a slim architecture. Based on the lottery ticket hypothesis (Frankle & Carbin, 2019), where a fat or overparameterized network can have higher potential for finding better optimal parameters by SGD training, we adopt the former method, namely, pruning weight parameters from a pretrained fat model. We apply ADMM regularization for structured pruning (Wang et al., 2019b), since this achieves state-of-the-art performance.
|
| 131 |
+
|
| 132 |
+
In this experiment, we evaluate ResNet-20 on CIFAR-10 dataset. We update pretrained weight parameters through the SGD algorithm with alternating direction method of multipliers (ADMM) regularization (Wang et al., 2019b) for a few additional epochs. We then fine-tune the resulting pruned model over 160 epochs. In this fine tuning, we employ SGD with momentum 0.9 and set the mini-batch size to 100 and the initial learning rate to 0.1, followed by cosine annealing without restart. The weight decay factor is set to $5 \times 1 0 ^ { - 4 }$ . Since the weight parameters are not yet quantized in this phase, we update all parameters, except that we set weights for the filters (output channels) and channels (input channels) pruned in the previous phase to zero. Finally, we apply quantization.
|
| 133 |
+
|
| 134 |
+
As Figure 6 shows, the Pareto frontier significantly improves by applying prune-then-quantize (red), as compared to applying extreme quantization (green). The right graph in Figure 6 shows a histogram of the maximal bit width under each filter (output channel) of the three models indicated by the broken line in the center graph $\mathrm { ( E S N _ { } = 3 9 M ( b i t s ) ) }$ . Since the pretrained model has 800 filters before pruning and quantization, summations of frequencies for each color are 800. In the pruning only (blue) case, the weight parameters in 555 filters, the largest number among the three methods, are pruned (represented as 0 bits). Most of remaining filters are 8 bits. In the quantization only (green) case, the number of pruned filters is a low 77, while the bit width of most remaining filters is 1 bit. In the proposed prune-then-quantize mixed (red) case, the number of pruned filters is 288 and the bit widths of most remaining filters are 3 or 4 bits, so the remaining filters are mildly quantized. As this case shows, while the $\mathrm { E S N } _ { d }$ values are similar, the validation accuracies differ depending on the number and bit width of the weight parameters. The prune-then-quantize mixed method properly produces a pruned and mildly quantized model, which achieves far better validation accuracy, especially in the low ESN region, as compared to the model produced by extremely quantizing a fat model without pruning.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 7: Relation between random walk during SGD and quantization noise. Loss often steeply decreases when LR is shifted by (e.g., $1 / 1 0 \AA$ ). In this situation, loss before shifting LR is possibly governed by random walk noise due to the large LR, as shown in the left figure. When we quantize weight parameters of the trained model, however, the loss or accuracy should be determined by noise induced by quantization, as shown in the right figure. If we can assume that the loss landscapes of the two cases should not diverge too much, the loss (or accuracy) after quantization is possibly predicted by the dependency of loss (or accuracy) on $\mathrm { E S N } _ { a }$ during training.
|
| 138 |
+
|
| 139 |
+
# 2.7 $\mathrm { E S N } _ { a }$ FOR QUANTIZATION
|
| 140 |
+
|
| 141 |
+
As Section 2.3 showed, there is a possible quantitative relation between $\mathrm { E S N } _ { a }$ during model training and $\mathrm { E S N } _ { a }$ of the pruned and quantized version of that model after training. This finding inspires us to exploit $\mathrm { E S N } _ { a }$ information obtained during training to determine the quantization policy, for example, how many bits to allocate for each layer. Figure 7 shows the intuition behind this idea, namely straightforward use of the $\mathrm { E S N } _ { a }$ values for each layer at a certain epoch during training as targets for quantization. Appendix B describes a preliminary experiment for verifying this idea.
|
| 142 |
+
|
| 143 |
+
# 3 EXPERIMENT ON IMAGENET
|
| 144 |
+
|
| 145 |
+
To verify the validity of our claims, we performed experiments under a post-training quantization scenario (Banner et al., 2018) on ImageNet dataset (Deng et al., 2009). Post-training quantization assumes a use-case scenario where a user (e.g., at an edge side) quantizes a given pretrained CNN model with a limited number of unlabeled training samples for obtaining a lightweight model suited to a particular situation. As concluded in Section 2.4, in a low ESN region or with low energy consumption, we can achieve higher accuracy by quantizing a slim model than by quantizing a fat model, even if the latter is more accurate. To provide optimal accuracy in a low computationalcost region, we apply the proposed prune-then-quantize method to the post-training quantization scenario.
|
| 146 |
+
|
| 147 |
+
Figure 8 shows the result of applying our method to ResNet-18 and ResNet-50 on ImageNet dataset. We used pretrained models12 as basic models with $1 \times$ channel width, and prune the models to various channel widths $0 . 2 5 \times$ , $0 . 5 \times$ , and $0 . 7 5 \times \mathrm { _ { \it { \cdot } } }$ ). In this experiment, we determine which filters (output channels) to prune based on the signal norm of weights calculated by Equation (5). We prune filters in order from the smallest signal norm, and tune each model for the pruned structure through the SGD algorithm over 4 epochs. The mini-batch size is set to 64, and the learning rate is initialized to 0.1 and divided by 10 at epochs 2 and 3. We then quantize each model. For quantization, we only fine-tune statistic parameters in BatchNorm layers (called running_mean and running_var in pytorch (Paszke et al., 2017)) with no labeled data (Sasaki et al., 2019), which is the same condition as conventional work (Banner et al., 2018).
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 8: (Left/center) top-1 accuracy on ImageNet versus $\mathrm { E S N } _ { a / d }$ and (right) estimated $\mathrm { E S N } _ { d } ^ { \prime }$ , applying the prune-then-quantize method to (upper) ResNet-18 and (lower) ResNet-50.
|
| 151 |
+
|
| 152 |
+
In addition to evaluations by $\mathrm { E S N } _ { a }$ and $\mathrm { E S N } _ { d }$ , to compare our method with the conventional work, we estimate its computational cost using Equation (1) with $c ^ { l }$ and $f ( \cdot )$ properly defined, as
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\mathrm { E S N } _ { d } ^ { \prime } = \sum _ { l } \sum _ { m } \mathrm { M A C } _ { l , m } \times \lceil \log _ { 2 } ( \operatorname* { m a x } ( \mathrm { a b s } ( \mathbf { W } _ { \mathrm { i n t } } ^ { l , m } ) ) ) + 1 \rceil ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
where applyi $\mathrm { M A C } _ { l , m }$ he number of computation per filter and function, we restrict the number of bits to $\pmb { \mathsf { W } } _ { \mathrm { i n t } } ^ { l , m }$ is the me in e $m$ th filter of h filter. $\pmb { \mathsf { W } } _ { \mathrm { i n t } } ^ { l }$ . By $\operatorname* { m a x } ( { \mathord { \cdot } } )$
|
| 159 |
+
|
| 160 |
+
We apply this metric3 to a recently proposed efficient MAC array architecture capable of handling variable bit precision (Maki et al., 2018).
|
| 161 |
+
|
| 162 |
+
As Figure 8 shows, significantly using slim models after pruning some filters improves the Pareto frontier as compared to Banner et al. (2018). For example, in ResNet-18, $5 7 \ \%$ top-1 accuracy is achieved at $2 \times$ lower computational cost, and in ResNet-50, $6 3 \ \%$ top-1 accuracy is at $4 \times$ lower computational cost. These results suggest that we should adopt a slim model to achieve best accuracy in low computational cost regions, instead of quantizing weight parameters to an extremely low bit precision.
|
| 163 |
+
|
| 164 |
+
# 4 CONCLUSION
|
| 165 |
+
|
| 166 |
+
We proposed a hardware-agnostic metric called the effective signal norm (ESN) to measure computational costs. Using this metric, we demonstrated that a slim model with fewer weight parameters achieves better Pareto frontier performance in low computational cost regions than does an extremely quantized fat model. We also showed a possible quantitative relation between weight perturbation during SGD training and quantization noise or robustness against quantization.
|
| 167 |
+
|
| 168 |
+
By defining this metric, on the hardware architecture side we can aim at realizing hardware whose energy consumption is proportional to the metric. On the algorithmic side, we can reduce the metric. We therefore expect consensus-sharing regarding the metric for computational cost to accelerate research progress for both algorithms and hardware architectures.
|
| 169 |
+
|
| 170 |
+
# 5 RELATED WORKS
|
| 171 |
+
|
| 172 |
+
Quantization Courbariaux & Bengio (2016); Rastegari et al. (2016); Zhu et al. (2017) quantize weight parameters and activations as 1 or 2. Since such extreme quantization deteriorates accuracy to a nonnegligible extent, quantization methods with, for example, 4–8 bits are also actively explored (Banner et al., 2018; Lin et al., 2017) to avoid the accuracy drop. Miyashita et al. (2016) attempts to quantize weight parameters and activations in a logarithmic domain, aiming not only at reducing information loss but also replacing multiplication with bit-shift to simplify computation. To reduce the average bit width as much as possible while maintaining accuracy, and to exploit it to accelerate inference speed, Maki et al. (2018) proposes variable bit-width quantization co-optimized with hardware architecture. Although nonuniform quantization (Tung & Mori, 2018; Han et al., 2016) and vector or product quantization (Gong et al., 2014; Jegou et al., 2011; Stock et al., 2019) are also actively studied, these approaches are effective for reducing the memory footprint but not for directly reducing computational costs. Use cases include quantization-aware training (Courbariaux & Bengio, 2016; Rastegari et al., 2016; Zhu et al., 2017; Lin et al., 2017; Zhang et al., 2018) and post-training quantization (Banner et al., 2018). Quantization-aware training achieves better accuracy with lower bit widths, and is almost inevitable for those with extreme quantization. However, it tends to incur higher training costs in most cases. The post-training quantization scenario, which is executable with less computational resources and a smaller training dataset, has potentially more applications, so we also target this scenario.
|
| 173 |
+
|
| 174 |
+
Pruning Pruning methods include structured pruning, which prunes whole layers, filters, or channels to maintain a regular structure so that computations are easily parallelized, and unstructured pruning, which randomly prunes individual weight parameters. Since it is difficult to benefit from unstructured pruning unless sparsity is sufficiently large, due to its incompatibility with parallelization (Lu et al., 2019), we target structured pruning. Many pruning methods have also been proposed, such as criteria-based approaches (LeCun et al., 1990), regularization-based approaches (Han et al., 2015; Wang et al., 2019b), and methods employing reinforcement learning (Zhong et al., 2018). In this paper, we argue that a pruned slim model performs better after quantization in lower computational cost regions. Any pruning method can be applied to produce a pruned slim model.
|
| 175 |
+
|
| 176 |
+
Metric for measuring cost In most quantization papers, the standard metric is accuracy achieved under a certain bit width. For pruning, the standard metric is the number of parameters or the number of computations (FLOP). Some papers use inference time when the model runs on specific hardware (Cai et al., 2019; Yang et al., 2018), but this metric is strongly hardware-dependent. In this paper, we propose a hardware-agnostic metric.
|
| 177 |
+
|
| 178 |
+
Noise during training Relations between learning rate, batch size, and noise during training are widely discussed (Keskar et al., 2017; Xing et al., 2018). To make the model more robust to quantization, some papers propose intentional addition of noise to gradient or weight parameters (Spallanzani et al., 2019; Baskin et al., 2018a;b).
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Ron Banner, Yury Nahshan, Elad Hoffer, and Daniel Soudry. ACIQ: analytical clipping for integer quantization of neural networks. CoRR, abs/1810.05723, 2018. URL http://arxiv.org/ abs/1810.05723.
|
| 183 |
+
|
| 184 |
+
Chaim Baskin, Natan Liss, Yoav Chai, Evgenii Zheltonozhskii, Eli Schwartz, Raja Giryes, Avi Mendelson, and Alexander M. Bronstein. NICE: noise injection and clamping estimation for neural network quantization. CoRR, abs/1810.00162, 2018a. URL http://arxiv.org/ abs/1810.00162.
|
| 185 |
+
|
| 186 |
+
Chaim Baskin, Eli Schwartz, Evgenii Zheltonozhskii, Natan Liss, Raja Giryes, Alexander M. Bronstein, and Avi Mendelson. UNIQ: uniform noise injection for the quantization of neural networks. CoRR, abs/1804.10969, 2018b. URL http://arxiv.org/abs/1804.10969.
|
| 187 |
+
|
| 188 |
+
Han Cai, Chuang Gan, and Song Han. Once for all: Train one network and specialize it for efficient deployment. CoRR, abs/1908.09791, 2019. URL http://arxiv.org/abs/1908.09791.
|
| 189 |
+
|
| 190 |
+
Matthieu Courbariaux and Yoshua Bengio. Binarynet: Training deep neural networks with weights and activations constrained to $+ 1$ or -1. CoRR, abs/1602.02830, 2016. URL http://arxiv. org/abs/1602.02830.
|
| 191 |
+
|
| 192 |
+
J. Deng, W. Dong, R. Socher, L. 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, June 2009. doi: 10.1109/CVPR.2009.5206848.
|
| 193 |
+
|
| 194 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2019. URL https:// openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJl-b3RcF7.
|
| 195 |
+
|
| 196 |
+
A. Gersho. Quantization. IEEE Communications Society Magazine, 15(5):16–16, Sep. 1977. doi: 10.1109/MCOM.1977.1089500.
|
| 197 |
+
|
| 198 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir D. Bourdev. Compressing deep convolutional networks using vector quantization. CoRR, abs/1412.6115, 2014. URL http://arxiv.org/ abs/1412.6115.
|
| 199 |
+
|
| 200 |
+
R. M. Gray and D. L. Neuhoff. Quantization. IEEE Transactions on Information Theory, 44(6): 2325–2383, Oct 1998. doi: 10.1109/18.720541.
|
| 201 |
+
|
| 202 |
+
Song Han, Jeff Pool, John Tran, and William J. Dally. Learning both weights and connections for efficient neural network. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1135–1143. Curran Associates, Inc., 2015.
|
| 203 |
+
|
| 204 |
+
Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. International Conference on Learning Representations (ICLR), 2016.
|
| 205 |
+
|
| 206 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, June 2016. doi: 10.1109/CVPR.2016.90.
|
| 207 |
+
|
| 208 |
+
Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. CoRR, abs/1704.04861, 2017. URL http://arxiv.org/abs/ 1704.04861.
|
| 209 |
+
|
| 210 |
+
G. Huang, Z. Liu, L. v. d. Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2261–2269, July 2017. doi: 10.1109/CVPR.2017.243.
|
| 211 |
+
|
| 212 |
+
Forrest N. Iandola, Matthew W. Moskewicz, Khalid Ashraf, Song Han, William J. Dally, and Kurt Keutzer. Squeezenet: Alexnet-level accuracy with $5 0 \mathrm { x }$ fewer parameters and ${ < } 1 \mathrm { m b }$ model size. CoRR, abs/1602.07360, 2016. URL http://arxiv.org/abs/1602.07360.
|
| 213 |
+
|
| 214 |
+
Frank Hutter Ilya Loshchilov. SGDR: stochastic gradient descent with warm restarts. International Conference on Learning Representations (ICLR), 2017.
|
| 215 |
+
|
| 216 |
+
H. Jegou, M. Douze, and C. Schmid. Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1):117–128, Jan 2011. ISSN 0162-8828. doi: 10.1109/TPAMI.2010.57.
|
| 217 |
+
|
| 218 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. International Conference on Learning Representations (ICLR), 2017.
|
| 219 |
+
|
| 220 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 221 |
+
|
| 222 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In D. S. Touretzky (ed.), Advances in Neural Information Processing Systems 2, pp. 598–605. Morgan-Kaufmann, 1990. URL http://papers.nips.cc/paper/250-optimal-brain-damage.pdf.
|
| 223 |
+
|
| 224 |
+
Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 345–353. Curran Associates, Inc., 2017.
|
| 225 |
+
|
| 226 |
+
L. Lu, J. Xie, R. Huang, J. Zhang, W. Lin, and Y. Liang. An efficient hardware accelerator for sparse convolutional neural networks on fpgas. In 2019 IEEE 27th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM), pp. 17–25, April 2019. doi: 10.1109/FCCM.2019.00013.
|
| 227 |
+
|
| 228 |
+
A. Maki, D. Miyashita, K. Nakata, F. Tachibana, T. Suzuki, and J. Deguchi. Fpga-based cnn processor with filter-wise-optimized bit precision. In 2018 IEEE Asian Solid-State Circuits Conference (A-SSCC), pp. 47–50, Nov 2018. doi: 10.1109/ASSCC.2018.8579342.
|
| 229 |
+
|
| 230 |
+
D. Miyashita, S. Kousai, T. Suzuki, and J. Deguchi. A neuromorphic chip optimized for deep learning and cmos technology with time-domain analog and digital mixed-signal processing. IEEE Journal of Solid-State Circuits, 52(10):2679–2689, Oct 2017. ISSN 0018-9200. doi: 10.1109/JSSC.2017.2712626.
|
| 231 |
+
|
| 232 |
+
Daisuke Miyashita, Edward H. Lee, and Boris Murmann. Convolutional neural networks using logarithmic data representation. CoRR, abs/1603.01025, 2016. URL http://arxiv.org/ abs/1603.01025.
|
| 233 |
+
|
| 234 |
+
Travis Oliphant. NumPy: A guide to NumPy. USA: Trelgol Publishing, 2006. URL http: //www.numpy.org/.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In ECCV, 2016.
|
| 239 |
+
|
| 240 |
+
S. Sasaki, A. Maki, D. Miyashita, and J. Deguchi. Post training weight compression with distribution-based filter-wise quantization step. In 2019 IEEE Symposium in Low-Power and High-Speed Chips (COOL CHIPS), pp. 1–3, April 2019. doi: 10.1109/CoolChips.2019.8721356.
|
| 241 |
+
|
| 242 |
+
F. N. Sechi. Linearised class-b transistor amplifiers. IEEE Journal of Solid-State Circuits, 11(2): 264–270, April 1976. ISSN 0018-9200. doi: 10.1109/JSSC.1976.1050713.
|
| 243 |
+
|
| 244 |
+
A. Shafiee, A. Nag, N. Muralimanohar, R. Balasubramonian, J. P. Strachan, M. Hu, R. S. Williams, and V. Srikumar. Isaac: A convolutional neural network accelerator with in-situ analog arithmetic in crossbars. In 2016 ACM/IEEE 43rd Annual International Symposium on Computer Architecture (ISCA), pp. 14–26, June 2016. doi: 10.1109/ISCA.2016.12.
|
| 245 |
+
|
| 246 |
+
K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014.
|
| 247 |
+
|
| 248 |
+
Matteo Spallanzani, Lukas Cavigelli, Gian Paolo Leonardi, Marko Bertogna, and Luca Benini. Additive noise annealing and approximation properties of quantized neural networks. CoRR, abs/1905.10452, 2019. URL http://arxiv.org/abs/1905.10452.
|
| 249 |
+
|
| 250 |
+
Pierre Stock, Armand Joulin, Remi Gribonval, Benjamin Graham, and Herv ´ e J ´ egou. And the bit ´ goes down: Revisiting the quantization of neural networks. CoRR, abs/1907.05686, 2019. URL http://arxiv.org/abs/1907.05686.
|
| 251 |
+
|
| 252 |
+
F. Tung and G. Mori. Clip-q: Deep network compression learning by in-parallel pruningquantization. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7873–7882, June 2018. doi: 10.1109/CVPR.2018.00821.
|
| 253 |
+
|
| 254 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019a.
|
| 255 |
+
|
| 256 |
+
Yanzhi Wang, Shaokai Ye, Zhezhi He, Xiaolong Ma, Linfeng Zhang, Sheng Lin, Geng Yuan, Sia Huat Tan, Zhengang Li, Deliang Fan, Xuehai Qian, Xue Lin, and Kaisheng Ma. Nonstructured DNN weight pruning considered harmful. CoRR, abs/1907.02124, 2019b. URL http://arxiv.org/abs/1907.02124.
|
| 257 |
+
|
| 258 |
+
Chen Xing, Devansh Arpit, Christos Tsirigotis, and Yoshua Bengio. A walk with sgd. CoRR, abs/1802.08770, 2018. URL http://arxiv.org/abs/1802.08770.
|
| 259 |
+
|
| 260 |
+
Tien-Ju Yang, Andrew Howard, Bo Chen, Xiao Zhang, Alec Go, Mark Sandler, Vivienne Sze, and Hartwig Adam. Netadapt: Platform-aware neural network adaptation for mobile applications. In Vittorio Ferrari, Martial Hebert, Cristian Sminchisescu, and Yair Weiss (eds.), Computer Vision – ECCV 2018, pp. 289–304, Cham, 2018. Springer International Publishing. ISBN 978-3-030- 01249-6.
|
| 261 |
+
|
| 262 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In European Conference on Computer Vision (ECCV), 2018.
|
| 263 |
+
|
| 264 |
+
X. Zhang, X. Zhou, M. Lin, and J. Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6848–6856, June 2018. doi: 10.1109/CVPR.2018.00716.
|
| 265 |
+
|
| 266 |
+
Jing Zhong, Guiguang Ding, Yuchen Guo, Jungong Han, and Bin Wang. Where to prune: Using lstm to guide end-to-end pruning. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pp. 3205–3211. International Joint Conferences on Artificial Intelligence Organization, 7 2018. doi: 10.24963/ijcai.2018/445. URL https://doi.org/ 10.24963/ijcai.2018/445.
|
| 267 |
+
|
| 268 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J. Dally. Trained ternary quantization. International Conference on Learning Representations (ICLR), 2017.
|
| 269 |
+
|
| 270 |
+
B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning transferable architectures for scalable image recognition. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8697–8710, June 2018. doi: 10.1109/CVPR.2018.00907.
|
| 271 |
+
|
| 272 |
+
# A DETAILS OF THE QUANTIZATION PROCESS
|
| 273 |
+
|
| 274 |
+
We basically apply a midrise-type quantization (Gersho, 1977), but modify it as follows. In the quantization phase, we prune filters in which all weight parameters are within $\pm \varDelta / 2$ , as described in the following pseudocode with Numpy (Oliphant, 2006) notation.
|
| 275 |
+
|
| 276 |
+
# Quantize
|
| 277 |
+
# W: (filter(out_ch), channel(in_ch), ky, kx)
|
| 278 |
+
pruned $=$ numpy.all(abs(W) $<$ delta/2, axi $s = ( 1 , 2 , 3 )$ )
|
| 279 |
+
W_int $=$ numpy.floor(W/delta) $+ ~ 0 . 5$
|
| 280 |
+
W_int[pruned, :, :, : $\jmath \ = \ 0$
|
| 281 |
+
|
| 282 |
+
# B $\mathrm { E S N } _ { a }$ FOR OPTIMAL QUANTIZATION POLICY
|
| 283 |
+
|
| 284 |
+
We attempt to exploit the $\mathrm { E S N } _ { a }$ obtained during training to determine a quantization policy using VGG7 where numbers of filters in all convolutional layers are reduced to $0 . 2 5 \times$ on CIFAR-10. The left figure in Figure 9 show the validation accuracy versus $\mathrm { E S N } _ { a }$ during training and after quantization. As an initial policy, we apply the same bit width for all layers. The results shown in gray do not fit the blue plot during training, possibly indicating the policy is suboptimal. We next investigate the $\mathrm { E S N } _ { a }$ of each layer and find that the misfit is caused by the sixth layer, as shown in the right figure. When we consider validation accuracy versus the sixth-layer $\mathrm { E S N } _ { a }$ , shown in green symbols, validation accuracy after quantization deteriorates at a much higher $\mathrm { E S N } _ { a }$ than during training. An interpretation is that since this deterioration is caused by other layers (e.g., the first) rather than the sixth layer, weight parameters in the sixth layer should be more aggressively quantized. Based on this observation, we modify the quantization policy such that the bit width of the sixth layer become smaller than that in other layers, thereby improving performance as shown by the red plot in the left figure. This preliminary experimental result suggests we can use $\mathrm { E S N } _ { a }$ information during training to find an optimal quantization policy.
|
| 285 |
+
|
| 286 |
+
# C RESNET-18 VERSUS RESNET-50
|
| 287 |
+
|
| 288 |
+
The proposed metric allows us to compare different network architectures. In Figure 10, we compare the Pareto frontier of validation accuracy versus $\mathrm { E S N } _ { a / d }$ curves for ResNet-18 and ResNet-50. The plots in Figure 10 are extracted from Figure 8. This result shows that ResNet-50 has a better Pareto frontier than does ResNet-18. One convincing reason is that ResNet-50 employs a parameterefficient bottleneck structure, whereas ResNet-18 does not. In contrast, ResNet-18 shows better performance for $\mathrm { E S N } _ { d } < \mathrm { 2 G }$ , partly due to the higher sensitivity of $\mathrm { E S N } _ { d }$ to the number of parameters. This suggests use of ResNet-18 when employing digital computing in this $\mathrm { E S N } _ { d }$ region. Such comparisons enabled by the proposed metric are useful when searching for or developing efficient structures.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 9: Relation between validation accuracy versus $\mathrm { E S N } _ { a }$ during training and after quantization.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 10: Comparison of ResNet-18 and ResNet-50 with respect to top-1 accuracy on ImageNet versus $\mathrm { E S N } _ { a / d }$ (left/right).
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 11: Comparison of other methods with respect to top-1 accuracy on ImageNet versus estimated $\mathrm { E S N } _ { d } ^ { \prime }$ .
|
| 298 |
+
|
| 299 |
+
# D COMPARISON WITH OTHER METHODS
|
| 300 |
+
|
| 301 |
+
In Figure 11, we superimpose results from other works on Figure 8. Lin et al. (2017) and Zhang et al. (2018) show better accuracy in smaller $\mathrm { E S N } _ { d } ^ { \prime }$ regions than ours, but these apply quantization-aware training, whereas our result is obtained by post-training quantization. Although we expect that the findings presented in this paper will also improve performance of quantization-aware training, we leave an explicit demonstration of this to future works.
|
| 302 |
+
|
| 303 |
+
# E DERIVATION OF EQUATION (4)
|
| 304 |
+
|
| 305 |
+
The mean squared noise energy $N$ due to quantization over the all elements in a tensor $\boldsymbol { \mathsf { W } }$ is computed as
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r } { N = | | \mathbf { W } - \varDelta \cdot \mathbf { W } _ { \mathrm { i n t } } | | _ { F } ^ { 2 } / | | \mathbf { W } | | _ { 0 } , } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
where $\pmb { \mathsf { W } } _ { \mathrm { i n t } } = \pmb { \mathsf { W } } / \Delta \rfloor + 0 . 5$ , $\varDelta$ is the quantization step size and $| | \pmb { \mathsf { W } } | | _ { 0 }$ is the number of nonzero elements in $\pmb { \mathsf { W } }$ . When quantization noise is approximated by a uniform distribution, the mean squared noise energy is (Gray & Neuhoff, 1998)
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
N = \int _ { - \Delta / 2 } ^ { \Delta / 2 } \frac { 1 } { \varDelta } n ^ { 2 } d n = \frac { { \varDelta } ^ { 2 } } { 1 2 } .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
From Equations (8) and (9),
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\varDelta ^ { 2 } = | | \boldsymbol { \mathsf { W } } - \varDelta \cdot \boldsymbol { \mathsf { W } } _ { \mathrm { i n t } } | | _ { F } ^ { 2 } \times \frac { 1 2 } { | | \boldsymbol { \mathsf { W } } | | _ { 0 } } .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Then,
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
| | \mathbf { W } _ { \mathrm { i n t } } | | _ { F } ^ { 2 } \sim | | \mathbf { W } / \varDelta | | _ { F } ^ { 2 } = \frac { | | \mathbf { W } | | _ { F } ^ { 2 } } { \varDelta ^ { 2 } } = \frac { | | \mathbf { W } | | _ { F } ^ { 2 } } { | | \mathbf { W } - \varDelta \cdot \mathbf { W } _ { \mathrm { i n t } } | | _ { F } ^ { 2 } } \cdot \frac { | | \mathbf { W } | | _ { 0 } } { 1 2 } .
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Here we again assume that quantization noise is uniformly distributed. In this equation, since $| | \pmb { \mathsf { W } } | |$ and $| | \boldsymbol { \mathsf { W } } - \varDelta \cdot \boldsymbol { \mathsf { W } } | | _ { F } ^ { 2 }$ are respectively the signal and noise norm, the term $\frac { | | \mathbf { W } | | _ { F } ^ { 2 } } { | | \mathbf { W } - \varDelta \cdot \mathbf { W _ { \mathrm { i n t } } } | | _ { F } ^ { 2 } }$ is considered to be $S / N$ , and thus,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
| | \mathbf { W _ { \mathrm { i n t } } } | | _ { F } ^ { 2 } = \frac { | | \mathbf { W } | | _ { F } ^ { 2 } } { | | \mathbf { W } - \varDelta \cdot \mathbf { W _ { \mathrm { i n t } } } | | _ { F } ^ { 2 } } \cdot \frac { | | \mathbf { W } | | _ { 0 } } { 1 2 } = S / N \cdot \frac { | | \mathbf { W } | | _ { 0 } } { 1 2 } .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
We obtain Equation (4) by summing this value over all layers.
|
| 336 |
+
|
| 337 |
+
# F DETAILS OF NETWORK ARCHITECTURES
|
| 338 |
+
|
| 339 |
+
The network architecures of VGG7 ( $1 \times , 0 . 5 \times , 0 . 2 5 \times )$ which we use in section 2.4 are shown in table 1. These architectures are based on the original model of VGG (Simonyan & Zisserman, 2014).
|
| 340 |
+
|
| 341 |
+
Table 1: Detailed network architecture of VGG7 for CIFAR-10. $C _ { I }$ and $C _ { O }$ represent the number of input and output channels, respectively in conv-layer. In fc-layer, they represent the number of input and output neurons
|
| 342 |
+
|
| 343 |
+
<table><tr><td rowspan=2 colspan=1>Layer name</td><td rowspan=1 colspan=2>VGG(1x)</td><td rowspan=1 colspan=2>VGG (0.5x)</td><td rowspan=1 colspan=2>VGG (0.25×)</td><td rowspan=2 colspan=1>kernel size</td><td rowspan=2 colspan=1> padding</td><td rowspan=2 colspan=1>stride</td></tr><tr><td rowspan=1 colspan=1>C1</td><td rowspan=1 colspan=1>Co</td><td rowspan=1 colspan=1>C1</td><td rowspan=1 colspan=1>Co</td><td rowspan=1 colspan=1>C1</td><td rowspan=1 colspan=1>Co</td></tr><tr><td rowspan=1 colspan=1>conv1</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>conv2</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>64</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>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>maxpool</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>64</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>2×2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>conv3</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>conv4</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>maxpool</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>2×2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>conv5</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>conv6</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>3×3</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>maxpool</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>512</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>2×2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>fc</td><td rowspan=1 colspan=1>8192</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>4096</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>2048</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>-</td></tr></table>
|
md/train/HyRVBzap-/HyRVBzap-.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CASCADE ADVERSARIAL MACHINE LEARNING REGULARIZED WITH A UNIFIED EMBEDDING
|
| 2 |
+
|
| 3 |
+
Taesik Na, Jong Hwan Ko & Saibal Mukhopadhyay
|
| 4 |
+
|
| 5 |
+
School of Electrical and Computer Engineering
|
| 6 |
+
Georgia Institute of Technology
|
| 7 |
+
Atlanta, GA 30332, USA
|
| 8 |
+
{taesik.na, jonghwan.ko, smukhopadhyay6}@gatech.edu
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Injecting adversarial examples during training, known as adversarial training, can improve robustness against one-step attacks, but not for unknown iterative attacks. To address this challenge, we first show iteratively generated adversarial images easily transfer between networks trained with the same strategy. Inspired by this observation, we propose cascade adversarial training, which transfers the knowledge of the end results of adversarial training. We train a network from scratch by injecting iteratively generated adversarial images crafted from already defended networks in addition to one-step adversarial images from the network being trained. We also propose to utilize embedding space for both classification and low-level (pixel-level) similarity learning to ignore unknown pixel level perturbation. During training, we inject adversarial images without replacing their corresponding clean images and penalize the distance between the two embeddings (clean and adversarial). Experimental results show that cascade adversarial training together with our proposed low-level similarity learning efficiently enhances the robustness against iterative attacks, but at the expense of decreased robustness against one-step attacks. We show that combining those two techniques can also improve robustness under the worst case black box attack scenario.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Injecting adversarial examples during training (adversarial training), (Goodfellow et al., 2015; Kurakin et al., 2017; Huang et al., 2015) increases the robustness of a network against adversarial attacks. The networks trained with one-step methods have shown noticeable robustness against onestep attacks, but, limited robustness against iterative attacks at test time. To address this challenge, we have made the following contributions:
|
| 17 |
+
|
| 18 |
+
Cascade adversarial training: We first show that iteratively generated adversarial images transfer well between networks when the source and the target networks are trained with the same training method. Inspired by this observation, we propose cascade adversarial training which transfers the knowledge of the end results of adversarial training. In particular, we train a network by injecting iter FGSM images (section 2.1) crafted from an already defended network (a network trained with adversarial training) in addition to the one-step adversarial images crafted from the network being trained. The concept of using already trained networks for adversarial training is also introduced in (Tramer et al., 2017). In their work, purely trained networks are used as another source networks \` to generate one-step adversarial examples for training. On the contrary, our cascade adversarial training uses already defended network for iter FGSM images generation.
|
| 19 |
+
|
| 20 |
+
Low level similarity learning: We advance the previous data augmentation approach (Kurakin et al., 2017) by adding additional regularization in deep features to encourage a network to be insensitive to adversarial perturbation. In particular, we inject adversarial images in the mini batch without replacing their corresponding clean images and penalize distance between embeddings from the clean and the adversarial examples. There are past examples of using embedding space for learning similarity of high level features like face similarity between two different images (Schroff et al., 2015; Parkhi et al., 2015; Wen et al., 2016). Instead, we use the embedding space for learning similarity of the pixel level differences between two similar images. The intuition of using this regularization is that small difference on input should not drastically change the high level feature representation.
|
| 21 |
+
|
| 22 |
+
Analysis of adversarial training: We train ResNet models (He et al., 2016) on MNIST (LeCun & Cortes, 2010) and CIFAR10 dataset (Krizhevsky, 2009) using the proposed adversarial training. We first show low level similarity learning improves robustness of the network against adversarial images generated by one-step and iterative methods compared to the prior work. We show that modifying the weight of the distance measure in the loss function can help control trade-off between accuracies for the clean and adversarial examples.
|
| 23 |
+
|
| 24 |
+
Together with cascade adversarial training and low-level similarity learning, we achieve accuracy increase against unknown iterative attacks, but at the expense of decreased accuracy for one-step attacks. We also show our cascade adversarial training and low level similarity learning provide much better robustness against black box attack.
|
| 25 |
+
|
| 26 |
+
# 2 BACKGROUND ON ADVERSARIAL ATTACKS
|
| 27 |
+
|
| 28 |
+
# 2.1 ATTACK METHODS
|
| 29 |
+
|
| 30 |
+
One-step fast gradient sign method (FGSM), referred to as “step FGSM”, generates adversarial image $\bar { X } ^ { a d v }$ by adding sign of the gradients w.r.t. the clean image $\boldsymbol { X }$ multiplied by $\epsilon \in [ 0 , 2 5 5 ]$ as shown below (Goodfellow et al., 2015):
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
X ^ { a d v } = X + \epsilon \mathrm { s i g n } ( \nabla _ { X } J ( X , y _ { t r u e } ) )
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
One-step target class method generates $X ^ { a d v }$ by subtracting sign of the gradients computed on a target false label as follows:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
X ^ { a d v } = X - \epsilon \mathrm { s i g n } ( \nabla _ { X } J ( X , y _ { t a r g e t } ) )
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
We use least likely class $y _ { L L }$ as a target class and refer this method as “step ll”.
|
| 43 |
+
|
| 44 |
+
Basic iterative method, referred to as “iter FGSM”, applies FGSM with small $\alpha$ multiple times.
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
X _ { 0 } ^ { a d v } = X , \quad X _ { N } ^ { a d v } = C l i p _ { X , \epsilon } \{ X _ { N - 1 } ^ { a d v } + \alpha \ \mathrm { s i g n } ( \nabla _ { X _ { N - 1 } ^ { a d v } } J ( X _ { N - 1 } ^ { a d v } , y _ { t r u e } ) ) \}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
We use $\alpha = 1$ , number of iterations $N$ to be $\operatorname* { m i n } ( \epsilon + 4 , 1 . 2 5 \epsilon ) . ~ C l i p _ { X , \epsilon }$ is elementwise clipping function where the input is clipped to the range $[ \mathrm { m a x } ( 0 , X - \epsilon ) , \mathrm { m i n } ( 2 5 5 , X + \epsilon ) ]$ .
|
| 51 |
+
|
| 52 |
+
Iterative least-likely class method, referred to as “iter ll”, is to apply “step ll” with small $\alpha$ multiple times.
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
X _ { 0 } ^ { a d v } = X , \quad X _ { N } ^ { a d v } = C l i p _ { X , \epsilon } \{ X _ { N - 1 } ^ { a d v } - \alpha \ \mathrm { s i g n } ( \nabla _ { X _ { N - 1 } ^ { a d v } } J ( X _ { N - 1 } ^ { a d v } , y _ { L L } ) ) \}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Carlini and Wagner attack (Carlini & Wagner, 2017) referred to as $\mathbf { \tilde { \Sigma } } ^ { 6 6 } \mathbf { C } \mathbf { W } ^ { \prime } $ solves an optimization problem which minimizes both an objective function $f$ (such that attack is success if and only if $\stackrel { \bullet } { f } ( X ^ { a d v } ) < 0 )$ and a distance measure between $X ^ { a d v }$ and $\boldsymbol { X }$ .
|
| 59 |
+
|
| 60 |
+
Black box attack is performed by testing accuracy on a target network with the adversarial images crafted from a source network different from the target network. Lower accuracy means successful black-box attack. When we use the same network for both target and source network, we call this as white-box attack.
|
| 61 |
+
|
| 62 |
+
# 2.2 DEFENSE METHODS
|
| 63 |
+
|
| 64 |
+
Adversarial training (Kurakin et al., 2017): is a form of data augmentation where it injects adversarial examples during training. In this method, $k$ examples are taken from the mini batch $B$ (size of $m$ ) and the adversarial examples are generated with one of step method. The $k$ adversarial examples replaces the corresponding clean examples when making mini batch. Below we refer this adversarial training method as “Kurakin’s”.
|
| 65 |
+
|
| 66 |
+
Table 1: CIFAR10 test results $( \% )$ under black box attacks for ${ \epsilon } { = } 1 6$ . Source networks share the same initialization which is different from the target networks. {Target: R20, $\mathsf { R } 2 0 _ { K }$ : standard, Kurakin’s, Source: $\mathbf { R } 2 0 \mathbf { _ 2 }$ , $\mathbf { R } 2 0 _ { K 2 }$ : standard, Kurakin’s.}
|
| 67 |
+
|
| 68 |
+
<table><tr><td rowspan="2">Target</td><td colspan="2">Source: step-FGSM</td><td colspan="2">Source: iter_FGSM</td></tr><tr><td>R202</td><td>R20K2</td><td>R202</td><td>R20K2</td></tr><tr><td>R20</td><td>16.2</td><td>31.6</td><td>2.7</td><td>60.1</td></tr><tr><td>R20K</td><td>66.7</td><td>82.7</td><td>55.8</td><td>28.5</td></tr></table>
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 1: Correlation between adversarial noises from different networks for each $\epsilon$ . Shaded region shows $\pm 0 . 1$ standard deviation of each line.
|
| 72 |
+
|
| 73 |
+
Ensemble adversarial training (Tramer et al., 2017): \` is essentially the same with the adversarial training, but uses several pre-trained vanilla networks to generate one-step adversarial examples for training. Below we refer this adversarial training method as “Ensemble”.
|
| 74 |
+
|
| 75 |
+
# 3 PROPOSED APPROACH
|
| 76 |
+
|
| 77 |
+
# 3.1 TRANSFERABILITY ANALYSIS
|
| 78 |
+
|
| 79 |
+
We first show transferability between purely trained networks and adversarially trained networks under black box attack. We use ResNet (He et al., 2016) models for CIFAR10 classification. We first train 20-layer ResNets with different methods (standard training, adversarial training (Kurakin et al., 2017)) and use those as target networks. We re-train networks (standard training and adversarial training) with the different initialization from the target networks, and use the trained networks as source networks. Experimental details and model descriptions can be found in Appendix A and B. In table 1, we report test accuracies under black box attack.
|
| 80 |
+
|
| 81 |
+
Transferability (step attack): We first observe that high robustness against one-step attack between defended networks $( \mathsf { R } 2 0 _ { K 2 } \ldots \mathsf { R } 2 0 _ { K } )$ ), and low robustness between undefended networks $( \mathsf { R 2 0 _ { 2 } }$ - $> { \textrm R } 2 0 \AA ,$ ). This observation shows that error surfaces of neural networks are driven by the training method and networks trained with the same method end up similar optimum states.
|
| 82 |
+
|
| 83 |
+
It is noteworthy to observe that the accuracies against step attack from the undefended network $( \mathsf { R } 2 0 _ { 2 } )$ are always lower than those from defended network $( \mathsf { R } 2 0 _ { K { \bf 2 } } )$ . Possible explanation for this would be that adversarial training tweaks gradient seen from the clean image to point toward weaker adversarial point along that gradient direction. As a result, one-step adversarial images from defended networks become weaker than those from undefended network.
|
| 84 |
+
|
| 85 |
+
Transferability (iterative attack): We observe “iter FGSM” attack remains very strong even under the black box attack scenario but only between undefended networks or defended networks. This is because iter FGSM noises $( X ^ { a d v } – X )$ from defended networks resemble each other. As shown in figure 1, we observe higher correlation between iter FGSM noises from a defended network $( \mathsf { R } 2 0 \kappa )$ and those from another defended network $( \mathsf { R } 2 0 _ { K { \bf 2 } } )$ ).
|
| 86 |
+
|
| 87 |
+
Difficulty of defense/attack under the black box attack scenario: As seen from this observation, it is efficient to attack an undefended/defended network with iter FGSM examples crafted from another undefended/defended network. Thus, when we want to build a robust network under the black box attack scenario, it is desired to check accuracies for the adversarial examples crafted from other networks trained with the same strategy.
|
| 88 |
+
|
| 89 |
+
# 3.2 CASCADE ADVERSARIAL TRAINING
|
| 90 |
+
|
| 91 |
+
Inspired by the observation that iter FGSM images transfer well between defended networks, we propose cascade adversarial training, which trains a network by injecting iter FGSM images crafted from an already defended network. We hypothesize that the network being trained with cascade adversarial training will learn to avoid such adversarial perturbation, enhancing robustness against iter FGSM attack. The intuition behind this proposed method is that we transfer the knowledge of the end results of adversarial training. In particular, we train a network by injecting iter FGSM images crafted from already defended network in addition to the one-step adversarial images crafted from the network being trained.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 2: Cascade adversarial training regularized with a unified embedding.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 3: (Left) Bidirectional loss. (Right) Pivot loss.
|
| 98 |
+
|
| 99 |
+
# 3.3 REGULARIZATION WITH A UNIFIED EMBEDDING
|
| 100 |
+
|
| 101 |
+
We advance the algorithm proposed in (Kurakin et al., 2017) by adding low level similarity learning. Unlike (Kurakin et al., 2017), we include the clean examples used for generating adversarial images in the mini batch. Once one step forward pass is performed with the mini batch, embeddings are followed by the softmax layer for the cross entropy loss for the standard classification. At the same time, we take clean embeddings and adversarial embeddings, and minimize the distance between the two with the distance based loss.
|
| 102 |
+
|
| 103 |
+
The distance based loss encourages two similar images (clean and adversarial) to produce the same outputs, not necessarily the true labels. Thus, low-level similarity learning can be considered as an unsupervised learning. By adding regularization in higher embedding layer, convolution filters gradually learn how to ignore such pixel-level perturbation. We have applied regularization on lower layers with an assumption that low level pixel perturbation can be ignored in lower hierarchy of networks. However, adding regularization term on higher embedding layer right before the softmax layer showed best performance. The more convolutional filters have chance to learn such similarity, the better the performance. Note that cross entropy doesn’t encourage two similar images to produce the same output labels. Standard image classification using cross entropy compares ground truth labels with outputs of a network regardless of how similar training images are.
|
| 104 |
+
|
| 105 |
+
The entire training process combining cascade adversarial training and low level similarity learning is shown in figure 2. We define the total loss as follows:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
L o s s = \frac { 1 } { ( m - k ) + \lambda k } \Bigg ( \sum _ { i = 1 } ^ { m - k } L ( { \bf X } _ { i } | y _ { i } ) + \lambda \sum _ { i = 1 } ^ { k } L ( { \bf X } _ { i } ^ { a d v } | y _ { i } ) \Bigg ) + \lambda _ { 2 } \sum _ { i = 1 } ^ { k } L _ { d i s t } ( E _ { i } ^ { a d v } , E _ { i } )
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
$\mathbf { \mathcal { E } } _ { i }$ and $E _ { i } ^ { a d v }$ are the resulting embeddings from $X _ { i }$ and $X _ { i } ^ { a d v }$ , respectively. $m$ is the size of the mini batch, $k \left( \leq m / 2 \right)$ is the number of adversarial images in the mini batch. $\lambda$ is the parameter to control the relative weight of classification loss for adversarial images. $\lambda _ { 2 }$ is the parameter to control the relative weight of the distance based loss $L _ { d i s t }$ in the total loss.
|
| 112 |
+
|
| 113 |
+
Bidirectional loss minimizes the distance between the two embeddings by moving both clean and adversarial embeddings as shown in the left side of the figure 3.
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L _ { d i s t } ( \pmb { { E } } _ { i } ^ { a d v } , \pmb { { E } } _ { i } ) = | | \pmb { { E } } _ { i } ^ { a d v } - \pmb { { E } } _ { i } | | _ { N } ^ { N } , \quad N \in { 1 , 2 \quad i = 1 , 2 , . . . , k }
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Table 2: MNIST test results $( \% )$ for 20-layer ResNet models $\prime { \epsilon } = 0 . 3 { ^ { * } } 2 5 5$ at test time). $\{ { \bf R } 2 0 { \bf M }$ : standard training, ${ \mathrm { R } } 2 0 { \mathrm { M } } _ { K }$ : Kurakin’s adversarial training, ${ \bf R } 2 0 { \bf M } _ { B }$ : Bidirectional loss, ${ \bf R } 2 0 { \bf M } _ { P }$ : P ivot loss. $\}$ CW $L _ { \infty }$ attack is performed with 100 test samples (10 samples per each class) and the number of adversarial examples with $\epsilon > 0 . 3 ^ { * } 2 5 5$ is reported. Additional details for CW attack can be found in Appendix F
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Model</td><td>clean</td><td>step_ll</td><td>step_FGSM</td><td>iter_ll</td><td>iter_FGSM</td><td>CW</td></tr><tr><td>R20M</td><td>99.6</td><td>9.7</td><td>10.3</td><td>0.0</td><td>0.0</td><td>0</td></tr><tr><td>R20MK</td><td>99.6</td><td>96.7</td><td>94.5</td><td>89.0</td><td>60.2</td><td>46</td></tr><tr><td>R20Mb (Ours)</td><td>99.5</td><td>97.3</td><td>96.2</td><td>97.2</td><td>88.5</td><td>81</td></tr><tr><td>R20Mp (Ours)</td><td>99.5</td><td>97.1</td><td>95.7</td><td>96.9</td><td>88.9</td><td>82</td></tr></table>
|
| 122 |
+
|
| 123 |
+
We tried $N = 1$ , 2 and found not much difference between the two. We report the results with $N =$ 2 for the rest of the paper otherwise noted. When $N = 2$ , $L _ { d i s t }$ becomes L2 loss.
|
| 124 |
+
|
| 125 |
+
Pivot loss minimizes the distance between the two embeddings by moving only the adversarial embeddings as shown in the right side of the figure 3.
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
L _ { d i s t } ( \pmb { { E } } _ { i } ^ { a d v } | \pmb { { E } } _ { i } ) = | | \pmb { { E } } _ { i } ^ { a d v } - \pmb { { E } } _ { i } | | _ { N } ^ { N } , \quad N \in { 1 , 2 \quad i = 1 , 2 , . . . , k }
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
In this case, clean embeddings ( $\mathbf { \mathcal { E } } _ { i }$ ) serve as pivots to the adversarial embeddings. In particular, we don’t back-propagate through the clean embeddings for the distance based loss. The intuition behind the use of pivot loss is that the embedding from a clean image can be treated as the ground truth embedding.
|
| 132 |
+
|
| 133 |
+
# 4 LOW LEVEL SIMILARITY LEARNING ANALYSIS
|
| 134 |
+
|
| 135 |
+
# 4.1 EXPERIMENTAL RESULTS ON MNIST
|
| 136 |
+
|
| 137 |
+
We first analyze the effect of low level similarity learning on MNIST. We train ResNet models (He et al., 2016) with different methods (standard training, Kurakin’s adversarial training and adversarial training with our distance based loss). Experimental details can be found in Appendix A.
|
| 138 |
+
|
| 139 |
+
Table 2 shows the accuracy results for MNIST test dataset for different types of attack methods. As shown in the table, our method achieves better accuracy than Kurakin’s method for all types of attacks with a little sacrifice on the accuracy for the clean images. Even though adversarial training is done only with “step ll”, additional regularization increases robustness against unknown “step FGSM”, “iter ll”, “iter FGSM” and CW $L _ { \infty }$ attacks. This shows that our low-level similarity learning can successfully regularize the one-step adversarial perturbation and its vicinity for simple image classification like MNIST.
|
| 140 |
+
|
| 141 |
+
# 4.2 EMBEDDING SPACE VISUALIZATION
|
| 142 |
+
|
| 143 |
+
To visualize the embedding space, we modify 20-layer ResNet model where the last fully connected layer $\left( 6 4 \mathbf { x } 1 0 \right)$ is changed to two fully connected layers ( $6 4 \mathrm { x } 2$ and 2x10). We re-train networks with standard training, Kurakin’s method and our pivot loss on MNIST. 1 In figure 4, we draw embeddings (dimension $^ { 1 = 2 }$ ) between two fully connected layers. As seen from this figure, adversarial images from the network trained with standard training cross the decision boundary easily as $\epsilon$ increases. With Kurakin’s adversarial training, the distances between clean and adversarial embeddings are minimized compared to standard training. And our pivot loss further minimizes distance between the clean and adversarial embeddings. Note that our pivot loss also decreases absolute value of the embeddings, thus, higher $\lambda _ { 2 }$ will eventually result in overlap between distinct embedding distributions. We also observe that intra class variation of the clean embeddings are also minimized for the network trained with our pivot loss as shown in the scatter plot in figure 4 (c).
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 4: Embedding space visualization for modified ResNet models trained on MNIST. $\mathbf { X }$ -axis and y-axis show first and second dimension of embeddings respectively. Scatter plot shows first 100 clean embeddings per each class on MNIST test set. Each arrow shows difference between two embeddings (one from iter FGSM image () and the other from $( \epsilon { + } 8 ) ,$ ). We draw arrows from $\epsilon = 0$ to $\epsilon = 7 6$ $( \approx 0 . 3 ^ { * } 2 5 5 )$ ) for one sample image per each class. We observe differences between clean and corresponding adversarial embeddings are minimized for the network trained with pivot loss.
|
| 147 |
+
|
| 148 |
+
# 4.3 EFFECT OF $\lambda _ { 2 }$ ON CIFAR10
|
| 149 |
+
|
| 150 |
+
We train 20-layer ResNet models with pivot loss and various $\lambda _ { \mathrm { 2 } } \mathrm { s }$ for CIFAR10 dataset to study effects of the weight of the distance measure in the loss function. Figure 5 shows that a higher $\lambda _ { 2 }$ increases accuracy of the iteratively generated adversarial images. However, it reduces accuracy on the clean images, and increasing $\lambda _ { 2 }$ above 0.3 even results in divergence of the training. This is because embedding distributions of different classes will eventually overlap since absolute value of the embedding will be decreased as $\lambda _ { 2 }$ increases as seen from the section 4.2. In this experiment, we show that there exists clear trade-off between accuracy for the clean images and that for the adversarial images, and we recommend using a very high $\lambda _ { 2 }$ only under strong adversarial environment.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 5: Accuracy vs. $\lambda _ { 2 }$
|
| 154 |
+
|
| 155 |
+
# 5 CASCADE ADVERSARIAL TRAINING ANALYSIS
|
| 156 |
+
|
| 157 |
+
# 5.1 SOURCE NETWORK SELECTION
|
| 158 |
+
|
| 159 |
+
We further study the transferability of iter FGSM images between various architectures. To this end, we first train 56-layer ResNet networks (Kurakin’s, pivot loss) with the same initialization. Then we train another 56-layer ResNet network (Kurakin’s) with different initialization. We repeat the training for the 110-layer ResNet networks. We measure correlation between iter FGSM noises from different networks.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 6 (a) shows correlation between iter FGSM noises crafted from Kurakin’s network and those from Pivot network with the same initialization. Conjectured from (Kurakin et al., 2017), we observe high corre
|
| 163 |
+
Figure 6: Correlation between iter FGSM noises crafted from different networks for each . Correlation is averaged over randomly chosen 128 images from CIFAR10 test-set.
|
| 164 |
+
|
| 165 |
+
Table 3: CIFAR10 test results $( \% )$ for 110-layer ResNet models. CW $L _ { \infty }$ attack is performed with 100 test samples (10 samples per each class) and the number of adversarial examples with $\epsilon > 2$ or 4 is reported. $\{ \mathrm { R 1 1 0 } _ { K }$ : Kurakin’s, $\mathrm { R } 1 0 _ { P }$ : P ivot loss, $\mathrm { R } 1 1 0 _ { E }$ : Ensemble training, $\mathrm { R 1 1 0 } _ { K , C }$ : Kurakin’s and $C$ ascade training, $\mathrm { R 1 1 0 } _ { P , E }$ : P ivot loss and Ensemble training, and $\mathrm { R 1 1 0 } _ { P , C }$ : P ivot loss and Cascade training}
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">clean</td><td colspan="2">step_ll</td><td colspan="2">step_FGSM</td><td colspan="2">iter_FGSM</td><td colspan="2">CW</td></tr><tr><td>e=2</td><td>∈=16</td><td>e=2</td><td>∈=16</td><td>e=2</td><td>∈=4</td><td>∈=2</td><td>e=4</td></tr><tr><td>R110K</td><td>92.3</td><td>88.3</td><td>90.7</td><td>86.0</td><td>95.2</td><td>59.4</td><td>9.2</td><td>25</td><td>4</td></tr><tr><td>R110p (Ours)</td><td>92.3</td><td>86.0</td><td>89.4</td><td>81.6</td><td>91.6</td><td>64.1</td><td>20.9</td><td>32</td><td>7</td></tr><tr><td>R110E</td><td>92.3</td><td>86.3</td><td>74.3</td><td>84.1</td><td>72.9</td><td>63.5</td><td>21.1</td><td>24</td><td>6</td></tr><tr><td>R110k,c (Ours)</td><td>92.3</td><td>86.2</td><td>72.8</td><td>82.6</td><td>66.7</td><td>69.3</td><td>33.4</td><td>20</td><td>5</td></tr><tr><td>R110p,ε (Ours)</td><td>91.3</td><td>84.0</td><td>65.7</td><td>77.6</td><td>54.5</td><td>66.8</td><td>38.3</td><td>38</td><td>16</td></tr><tr><td>R110p,c (Ours)</td><td>91.5</td><td>85.7</td><td>76.4</td><td>82.4</td><td>69.1</td><td>73.5</td><td>42.5</td><td>27</td><td>15</td></tr></table>
|
| 168 |
+
|
| 169 |
+
lation between iter FGSM noises from networks with the same initialization. Correlation between iter FGSM noises from the networks with different initialization, however, becomes lower as the network is deeper as shown in figure 6 (b). Since the degree of freedom increases as the network size increases, adversarially trained networks prone to end up with different states, thus, making transfer rate lower. To maximize the benefit of the cascade adversarial training, we propose to use the same initialization for a cascade network and a source network used for iterative adversarial examples generation.
|
| 170 |
+
|
| 171 |
+
# 5.2 WHITE BOX ATTACK ANALYSIS
|
| 172 |
+
|
| 173 |
+
We first compare a network trained with Kurakin’s method and that with pivot loss. We train 110- layer ResNet models with/without pivot loss and report accuracy in table 3. We observe our lowlevel similarity learning further improves robustness against iterative attacks compared to Kurakin’s adversarial training. However, the accuracy improvements against iterative attacks (iter FGSM, CW) are limited, showing regularization effect of low-level similarity learning is not sufficient for the iterative attacks on complex color images like CIFAR10. This is different from MNIST test cases where we observed significant accuracy increase for iterative attacks only with pivot loss. We observe label leaking phenomenon reported in (Kurakin et al., 2017) happens even though we don’t train a network with step FGSM images. Additional analysis for this phenomenon is explained in Appendix D.
|
| 174 |
+
|
| 175 |
+
Next, we train a network from scratch with iter FGSM examples crafted from the defended network, $\mathrm { R } 1 0 _ { P }$ . We use the same initialization used in $\mathrm { R } 1 1 0 _ { P }$ as discussed in 5.1. In particular, iter FGSM images are crafted from $\mathrm { R } 1 0 _ { P }$ with CIFAR10 training images for $\epsilon = 1 , 2 , . . . , 1 6$ , and those are used randomly together with step ll examples from the network being trained. We train cascade networks with/without pivot loss. We also train networks with ensemble adversarial training (Tramer et al., \` 2017) with/without pivot loss for comparison. The implementation details for the trained models can be found in Appendix B.
|
| 176 |
+
|
| 177 |
+
We find several meaningful observations in table 3. First, ensemble and cascade models show improved accuracy against iterative attack although at the expense of decreased accuracy for onestep attacks compared to the baseline defended network $( \mathrm { R } 1 1 0 _ { K } )$ ). Additional data augmentation from other networks enhances the robustness against iterative attack, weakening label leaking effect caused by one-step adversarial training.
|
| 178 |
+
|
| 179 |
+
Second, our low-level similarity learning $( \mathrm { R } 1 1 0 _ { P , E }$ , $\operatorname { R 1 1 0 } _ { P , C } )$ ) further enhances robustness against iterative attacks including fully unknown CW attack (especially for $\epsilon { = } 4$ ). Additional knowledge learned from data augmentation through cascade/ensemble adversarial training enables networks to learn partial knowledge of perturbations generated by an iterative method. And the learned iterative perturbations become regularized further with our low-level similarity learning making networks robust against unknown iterative attacks.
|
| 180 |
+
|
| 181 |
+
Table 4: CIFAR10 test results $( \% )$ for 110-layer ResNet models under black box attacks $\left( \epsilon = 1 6 \right)$ . {Target: same networks in table 3 and $\mathrm { R } 1 1 0 _ { K }$ : Kurakin’s, Source: re-trained baseline, Kurakin’s, cascade and ensemble networks with/without pivot loss. Source networks use the different initialization from the target networks. Additional details of the models can be found in Appendix B.}
|
| 182 |
+
|
| 183 |
+
<table><tr><td rowspan="2">Target</td><td colspan="7">Source: iter_FGSM</td></tr><tr><td>R1102</td><td>R110K2</td><td>R110E2</td><td>R110p2</td><td>R110K,C2</td><td>R110p,E2</td><td>R110p,C2</td></tr><tr><td>R110K</td><td>70.5</td><td>73.2</td><td>27.9</td><td>77.0</td><td>67.3</td><td>54.6</td><td>80.8</td></tr><tr><td>R110E</td><td>77.9</td><td>79.5</td><td>55.8</td><td>79.0</td><td>68.2</td><td>54.7</td><td>82.7</td></tr><tr><td>R110p (Ours)</td><td>75.9</td><td>75.6</td><td>39.6</td><td>78.5</td><td>68.3</td><td>61.3</td><td>83.3</td></tr><tr><td>R110k,c (Ours)</td><td>56.4</td><td>80.2</td><td>61.1</td><td>79.5</td><td>67.4</td><td>62.6</td><td>82.1</td></tr><tr><td>R110p,E (Ours)</td><td>78.2</td><td>82.1</td><td>67.7</td><td>81.7</td><td>73.4</td><td>68.4</td><td>83.8</td></tr><tr><td>R110p,C (Ours)</td><td>71.9</td><td>80.4</td><td>63.9</td><td>80.1</td><td>71.1</td><td>64.2</td><td>83.0</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Third, our low-level similarity learning serves as a good regularizer for adversarial images, but not for the clean images for ensemble/cascade models (reduced accuracy for the clean images for $\mathrm { R 1 1 0 } _ { P , E }$ and $\mathrm { R 1 1 0 } _ { P , C }$ in table 3). Compared to pure adversarial training with one-step adversarial examples, the network sees more various adversarial perturbations during training as a result of ensemble and cascade training. Those perturbations are prone to end up embeddings in the vicinity of decision boundary more often than perturbations caused by one-step adversarial training. Pivot loss pulls the vicinity of those adversarial embeddings toward their corresponding clean embeddings. During this process, clean embeddings from other classes might also be moved toward the decision boundary which results in decreased accuracy for the clean images.
|
| 186 |
+
|
| 187 |
+
# 5.3 BLACK BOX ATTACK ANALYSIS
|
| 188 |
+
|
| 189 |
+
We finally perform black box attack analysis for the cascade/ensemble networks with/without pivot loss. We report black box attack accuracy with the source networks trained with the same method, but with different initialization from the target networks. The reason for this is adversarial examples transfer well between networks trained with the same strategy as observed in section 3.1. We re-train 110-layer ResNet models using Kurakin’s, cascade and ensemble adversarial training with/without low-level similarity learning and use those networks as source networks for black-box attacks. Baseline 110-layer ResNet model is also included as a source network. Target networks are the same networks used in table 3. We found iter FGSM attack resulted in lower accuracy than step FGSM attack, thus, report iter FGSM attack only in table 4.
|
| 190 |
+
|
| 191 |
+
We first observe that iter FGSM attack from ensemble models $( \mathrm { R } 1 1 0 _ { E 2 }$ , $\mathrm { R 1 1 0 } _ { P , E 2 } )$ is strong (results in lower accuracy) compared to that from any other trained networks. 2 Since ensemble models learn various perturbation during training, adversarial noises crafted from those networks might be more general for other networks making them transfer easily between defended networks.
|
| 192 |
+
|
| 193 |
+
Second, cascade adversarial training breaks chicken and egg problem. (In section 3.1, we found that it is efficient to use a defended network as a source network to attack another defended network.) Even though the transferability between defended networks is reduced for deeper networks, cascade network $( \mathrm { R } 1 1 0 _ { K , C } )$ shows worst case performance against the attack not from a defended network, but from a purely trained network $\mathbf { ( R 1 1 0 _ { 2 } ) }$ . Possible solution to further improve the worst case robustness would be to use more than one network as source networks (including pure/defended networks) for iter FGSM images generation for cascade adversarial training.
|
| 194 |
+
|
| 195 |
+
Third, ensemble/cascade networks together with our low-level similarity learning $( \mathrm { R } 1 1 0 _ { P , E }$ , $\mathrm { R 1 1 0 } _ { P , C } )$ show better worst case accuracy under black box attack scenario. This shows that enhancing robustness against iterative white box attack also improves robustness against iterative black box attack.
|
| 196 |
+
|
| 197 |
+
# 6 CONCLUSION
|
| 198 |
+
|
| 199 |
+
We performed through transfer analysis and showed iter FGSM images transfer easily between networks trained with the same strategy. We exploited this and proposed cascade adversarial training, a method to train a network with iter FGSM adversarial images crafted from already defended networks. We also proposed adversarial training regularized with a unified embedding for classification and low- level similarity learning by penalizing distance between the clean and their corresponding adversarial embeddings. Combining those two techniques (low level similarity learning $^ +$ cascade adversarial training) with deeper networks further improved robustness against iterative attacks for both white-box and black-box attacks.
|
| 200 |
+
|
| 201 |
+
However, there is still a gap between accuracy for the clean images and that for the adversarial images. Improving robustness against both one-step and iterative attacks still remains challenging since it is shown to be difficult to train networks robust for both one-step and iterative attacks simultaneously. Future research is necessary to further improve the robustness against iterative attack without sacrificing the accuracy for step attacks or clean images under both white-box attack and black-box attack scenarios.
|
| 202 |
+
|
| 203 |
+
# ACKNOWLEDGMENTS
|
| 204 |
+
|
| 205 |
+
We thank Alexey Kurakin of Google Brain and Li Chen of Intel for comments that greatly improved the manuscript. The research reported here was supported in part by the Defense Advanced Research Projects Agency (DARPA) under contract number HR0011-17-2-0045. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of DARPA.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, 2017.
|
| 210 |
+
|
| 211 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In Proceedings of the International Conference on Learning Representations (ICLR), 2015.
|
| 212 |
+
|
| 213 |
+
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 http://dx.doi.org/10.1109/CVPR.2016.90.
|
| 214 |
+
|
| 215 |
+
Ruitong Huang, Bing Xu, Dale Schuurmans, and Csaba Szepesvari. Learning with a strong adver-´ sary. CoRR, abs/1511.03034, 2015. URL http://arxiv.org/abs/1511.03034.
|
| 216 |
+
|
| 217 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 218 |
+
|
| 219 |
+
Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In Proceedings of the International Conference on Learning Representations (ICLR), 2017.
|
| 220 |
+
|
| 221 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
|
| 222 |
+
|
| 223 |
+
O. M. Parkhi, A. Vedaldi, and A. Zisserman. Deep face recognition. In Proceedings of the British Machine Vision Conference (BMVC), 2015.
|
| 224 |
+
|
| 225 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
|
| 226 |
+
|
| 227 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensem- \` ble adversarial training: Attacks and defenses. CoRR, abs/1705.07204, 2017. URL http: //arxiv.org/abs/1705.07204.
|
| 228 |
+
|
| 229 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In Computer Vision - ECCV 2016 - 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part VII, pp. 499– 515, 2016. doi: 10.1007/978-3-319-46478-7 31. URL http://dx.doi.org/10.1007/ 978-3-319-46478-7_31.
|
| 230 |
+
|
| 231 |
+
# A EXPERIMENTAL SETUP
|
| 232 |
+
|
| 233 |
+
We scale down the image values to [0,1] and don’t perform any data augmentation for MNIST. For CIFAR10, we scale down the image values to [0,1] and subtract per-pixel mean values. We perform $2 4 \times 2 4$ random crop and random flip on $3 2 \mathrm { x } 3 2 $ original images. We generate adversarial images with “step ll” after these steps otherwise noted.
|
| 234 |
+
|
| 235 |
+
We use stochastic gradient descent (SGD) optimizer with momentum of 0.9, weight decay of 0.0001 and mini batch size of 128. For adversarial training, we generate $k = 6 4$ adversarial examples among 128 images in one mini-batch. We start with a learning rate of 0.1, divide it by 10 at $4 \mathrm { k }$ and 6k iterations, and terminate training at 8k iterations for MNIST, and $4 8 \mathrm { k }$ and $7 2 \mathrm { k }$ iterations, and terminate training at 94k iterations for CIFAR10. 3
|
| 236 |
+
|
| 237 |
+
We also found that initialization affects the training results slightly as in (Kurakin et al., 2017), thus, we pre-train the networks 2 and 10 epochs for MNIST and CIFAR10, and use these as initial starting points for different configurations. We use $m a x \_ e = 0 . 3 ^ { * } 2 5 5$ and 16 for MNIST and CIFAR10 respectively.
|
| 238 |
+
|
| 239 |
+
# B MODEL DESCRIPTIONS
|
| 240 |
+
|
| 241 |
+
We summarize the model names used in this paper in table 5. For ensemble adversarial training, pre-trained networks as in table 7 together with the network being trained are used to generate onestep adversarial examples during training. For cascade adversarial training, pre-trained defended networks as in table 6 are used to generate iter FGSM images, and the network being trained is used to generate one-step adversarial examples during training.
|
| 242 |
+
|
| 243 |
+
Table 5: Model descriptions
|
| 244 |
+
Table 6: Ensemble model description
|
| 245 |
+
|
| 246 |
+
<table><tr><td colspan="5">Initialization</td></tr><tr><td>Dataset</td><td>ResNet</td><td>Group</td><td>Training</td><td>Model</td></tr><tr><td rowspan="2">MNIST</td><td rowspan="2">20-layer</td><td rowspan="2">A</td><td>standard training Kurakin's</td><td>R20M R20MK</td></tr><tr><td>Bidirection loss</td><td>R20MB</td></tr><tr><td rowspan="10"></td><td rowspan="10">20-layer</td><td rowspan="4"></td><td>Pivot loss</td><td>R20Mp</td></tr><tr><td> standard training</td><td>R20</td></tr><tr><td>Kurakin's</td><td>R20K</td></tr><tr><td>Ensemble training</td><td>R20E</td></tr><tr><td rowspan="6">B</td><td>Bidirection loss Pivot loss</td><td>R20B R20p</td></tr><tr><td>Kurakin's & Cascade training</td><td>R20K,C</td></tr><tr><td></td><td></td></tr><tr><td>Pivot loss & Ensemble training</td><td>R20p,E</td></tr><tr><td>Pivot loss & Cascade training</td><td>R20p,C</td></tr><tr><td> standard training</td><td>R202</td></tr><tr><td rowspan="7">CIFAR10 56-layer</td><td rowspan="7"></td><td>C</td><td>Kurakin's</td><td>R20K2</td></tr><tr><td>D</td><td>Pivot loss standard training</td><td>R20p2 R203</td></tr><tr><td>E</td><td> standard training</td><td>R204</td></tr><tr><td>F</td><td>Kurakin's</td><td>R56K R56p</td></tr><tr><td></td><td>Pivot loss</td><td></td></tr><tr><td>G</td><td>Kurakin's</td><td>R56K2</td></tr><tr><td></td><td></td><td></td></tr><tr><td rowspan="7">110-layer</td><td rowspan="7"></td><td rowspan="7">H</td><td> standard training</td><td>R110</td></tr><tr><td>Kurakin's</td><td>R110K</td></tr><tr><td>Pivot loss Ensemble training</td><td>R110p R110E</td></tr><tr><td>Kurakin's & Cascade training</td><td></td></tr><tr><td></td><td>R110K,C</td></tr><tr><td>Pivot loss & Ensemble training</td><td>R110p,E</td></tr><tr><td>Pivot loss & Cascade training</td><td>R110p,C</td></tr><tr><td rowspan="5"></td><td rowspan="5">I</td><td>standard training Kurakin's</td><td>R1102</td></tr><tr><td></td><td>R110k2</td></tr><tr><td>Ensemble training</td><td>R110E2</td></tr><tr><td>Pivot loss</td><td>R110p2</td></tr><tr><td>Kurakin's & Cascade training Pivot loss & Ensemble training</td><td>R110k,C2 R110p,E2</td></tr><tr><td rowspan="5"></td><td>J</td><td>Pivot loss & Cascade training</td><td>R110p,C2</td></tr><tr><td></td><td>standard training</td><td>R1103</td></tr><tr><td>K</td><td>standard training</td><td>R1104</td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 7: Cascade model description
|
| 249 |
+
|
| 250 |
+
<table><tr><td>Ensemble models</td><td>Pre-trained models</td></tr><tr><td>R20E,R20p,E,R110E,R110P,E R110E2,R110P,E2</td><td>R203,R110g R204,R1104</td></tr></table>
|
| 251 |
+
|
| 252 |
+
<table><tr><td>Cascade models</td><td>Pre-trained model</td></tr><tr><td>R20K,c,R20p,C</td><td>R20p</td></tr><tr><td>R110K,c,R110p,C</td><td>R110p</td></tr><tr><td>R110K,c2,R110P,C2</td><td>R110p2</td></tr></table>
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 7: Argument to the softmax vs. $\epsilon$ in test time. “step ll”, “step FGSM” and ”random sign” methods were used to generate test-time adversarial images. Arguments to the softmax were measured by changing $\epsilon$ for each test method and averaged over randomly chosen 128 images from CIFAR10 test-set. Blue line represents true class and the red line represents mean of the false classes. Shaded region shows $\pm \nobreakspace 1 \nobreakspace$ standard deviation of each line.
|
| 256 |
+
|
| 257 |
+
We draw average value of the argument to the softmax layer for the true class and the false classes to visualize how the adversarial training works as in figure 7. Standard training, as expected, shows dramatic drop in the values for the true class as we increase $\epsilon$ in “step ll” or “step FGSM direction. With adversarial training, we observe that the value drop is limited at small $\epsilon$ and our method even increases the value in certain range upto ${ \epsilon } { = } 1 0$ . Note that adversarial training is not the same as the gradient masking.As illustrated in figure 7, it exposes gradient information, however, quickly distort gradients along the sign of the gradient (“step ll” or “step FGSM) direction. We also observe improved results (broader margins than baseline) for “random sign” added images even though we didn’t inject random sign added images during training. Overall shape of the argument to the softmax layer in our case becomes smoother than Kurakin’s method, suggesting our method is good for pixel level regularization. Even though actual value of the embeddings for the true class in our case is smaller than that in Kurakin’s, the standard deviation of our case is less than Kurakin’s, making better margin between the true class and false classes.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 8: Averaged Pearson’s correlation coefficient between the gradients w.r.t. two images. Correlation were measured by changing $\epsilon$ for each adversarial image and averaged over randomly chosen 128 images from CIFAR10 test-set. Shaded region represents $\pm \ : 0 . 5$ standard deviation of each line.
|
| 261 |
+
|
| 262 |
+
We observe accuracies for the “step FGSM” adversarial images become higher than those for the clean images (“label leaking” phenomenon) by training with “step FGSM” examples as in (Kurakin et al., 2017). Interestingly, we also observe “label leaking” phenomenon even without providing true labels for adversarial images generation. We argue that “label leaking” is a natural result of the adversarial training.
|
| 263 |
+
|
| 264 |
+
To understand the nature of adversarial training, we measure correlation between gradients w.r.t. different images (i.e. clean vs. adversarial) as a measure of error surface similarity. We measure correlation between gradients w.r.t. (1) clean vs. “step ll” image, (2) clean vs. “step FGSM” image, (3) clean vs. “random sign” added image, and (4) “step ll” image vs. “step FGSM” image for three trained networks (a) R20, (b) $\mathsf { R } 2 0 _ { K }$ and (c) ${ \mathrm { R } } 2 0 _ { P }$ (Ours) in table 5. Figure 8 draws average value of correlations for each case.
|
| 265 |
+
|
| 266 |
+
Meaning of the correlation: In order to make strong adversarial images with “step FGSM” method, correlation between the gradient w.r.t. the clean image and the gradient w.r.t. its corresponding adversarial image should remain high since the “step FGSM” method only use the gradient w.r.t. the clean image $( \epsilon { = } 0 )$ . Lower correlation means perturbing the adversarial image at $\epsilon$ further to the gradient (seen from the clean image) direction is no longer efficient.
|
| 267 |
+
|
| 268 |
+
Results of adversarial training: We observe that (1) and (2) become quickly lower than (3) as $\epsilon$ increases. This means that, when we move toward the steepest (gradient) direction on the error surface, gradient is more quickly uncorrelated with the gradient w.r.t. the clean image than when we move to random direction. As a result of adversarial training, this uncorrelation is observed at a lower $\epsilon$ making one-step attack less efficient even with small perturbation. (1), (2) and (3) for our case are slightly lower than Kurakin’s method at the same $\epsilon$ which means that our method is better at defending one-step attacks than Kurakin’s.
|
| 269 |
+
|
| 270 |
+
Error surface similarity between “step ll” and “step FGSM” images: We also observe (4) remains high with higher $\epsilon$ for all trained networks. This means that the error surface (gradient) of the “step ll” image and that of its corresponding ���step FGSM” image resemble each other. That is the reason why we get the robustness against “step FGSM” method only by training with “step ll” method and vice versa. (4) for our case is slightly higher than Kurakin’s method at the same $\epsilon$ and that means our similarity learning tends to make error surfaces of the adversarial images with “step ll” and “step FGSM” method to be more similar.
|
| 271 |
+
|
| 272 |
+
Analysis of label leaking phenomenon: Interestingly, (2) becomes slightly negative in certain range $1 < \epsilon < 3$ for Kurakin’s, and $1 < \epsilon < 4$ for Pivot (Ours) ) and this could be the possible reason for “label leaking” phenomenon. For example, let’s assume that we have a perturbed image (by “step FGSM” method) at $\epsilon$ where the correlation between the gradients w.r.t. that image and the corresponding clean image is negative. Further increase of $\epsilon$ with the gradient (w.r.t. the clean image) direction actually decreases the loss resulting in increased accuracy (label leaking phenomenon). Due to the error surface similarity between “step ll” and “step FGSM” images and this negative correlation effect, however, label leaking phenomenon can always happen for the networks trained with one-step adversarial examples.
|
| 273 |
+
|
| 274 |
+
# E ADDITIONAL BLACK BOX ATTACK RESULTS
|
| 275 |
+
|
| 276 |
+
Table 8: CIFAR10 test results $( \% )$ under black box attacks between the network with the same initialization $\scriptstyle \left( \epsilon = 1 6 \right) \}$
|
| 277 |
+
|
| 278 |
+
<table><tr><td rowspan="2">Target</td><td colspan="3">Source: step_FGSM</td><td colspan="3">Source: iter_FGSM</td></tr><tr><td>R20</td><td>R20K</td><td>R20p</td><td>R20</td><td>R20K</td><td>R20p</td></tr><tr><td>R20</td><td>12.2</td><td>27.4</td><td>27.5</td><td>0.0</td><td>45.9</td><td>44.7</td></tr><tr><td>R20K</td><td>65.7</td><td>81.5</td><td>81.8</td><td>51.5</td><td>0.0</td><td>18.2</td></tr><tr><td>R20p</td><td>58.1</td><td>89.3</td><td>91.7</td><td>48.9</td><td>13.4</td><td>0.0</td></tr></table>
|
| 279 |
+
|
| 280 |
+
Table 8 shows that black box attack between trained networks with the same initialization tends to be more successful than that between networks with different initialization as explained in (Kurakin et al., 2017).
|
| 281 |
+
|
| 282 |
+
Table 9: CIFAR10 test results $( \% )$ under black box attacks for ${ \epsilon } { = } 1 6$ . {Target and Source networks are switched from the table 1}
|
| 283 |
+
|
| 284 |
+
<table><tr><td rowspan="2">Target</td><td colspan="3">Source: step-FGSM</td><td colspan="3">Source: iter_FGSM</td></tr><tr><td>R20</td><td>R20K</td><td>R20p</td><td>R20</td><td>R20K</td><td>R20p</td></tr><tr><td>R202</td><td>17.9</td><td>33.9</td><td>34.5</td><td>4.1</td><td>54.8</td><td>54.3</td></tr><tr><td>R20K2</td><td>65.0</td><td>84.6</td><td>84.5</td><td>61.2</td><td>25.3</td><td>30.4</td></tr><tr><td>R20p2</td><td>66.4</td><td>88.2</td><td>87.2</td><td>61.6</td><td>27.7</td><td>36.1</td></tr></table>
|
| 285 |
+
|
| 286 |
+
In table 9, our method $( \mathsf { R } 2 0 _ { P 2 } )$ is always better at one-step and iterative black box attack from defended networks $( \mathsf { R } 2 0 _ { K } , \mathsf { R } 2 0 _ { P } )$ and undefended network (R20) than Kurakin’s method $( { \bf R } 2 0 _ { B { \bf 2 } } )$ . However, it is hard to tell which method is better than the other one as explained in the main paper.
|
| 287 |
+
|
| 288 |
+
Table 10: CIFAR10 test results $( \% )$ for cascade networks under black box attacks for ${ \epsilon } { = } 1 6$ . {Target and Source: Please see the model descriptions in Appendix B.}
|
| 289 |
+
|
| 290 |
+
<table><tr><td rowspan="2">Target</td><td colspan="7">Source: iter_FGSM</td></tr><tr><td>R110</td><td>R110K</td><td>R110E</td><td>R110p</td><td>R110K,C</td><td>R110p,E</td><td>R110p,C</td></tr><tr><td>R110K2</td><td>80.5</td><td>72.7</td><td>49.3</td><td>68.0</td><td>49.6</td><td>41.0</td><td>67.9</td></tr><tr><td>R110E2</td><td>82.7</td><td>59.1</td><td>39.5</td><td>59.6</td><td>51.5</td><td>40.3</td><td>69.6</td></tr><tr><td>R110p2 (Ours)</td><td>80.3</td><td>75.9</td><td>54.2</td><td>72.2</td><td>54.9</td><td>44.3</td><td>72.4</td></tr><tr><td>R110k,C2 (Ours)</td><td>62.1</td><td>74.7</td><td>61.5</td><td>72.3</td><td>46.5</td><td>39.0</td><td>67.9</td></tr><tr><td>R110p,E2 (Ours)</td><td>81.5</td><td>79.0</td><td>50.0</td><td>77.3</td><td>56.9</td><td>45.5</td><td>75.2</td></tr><tr><td>R110p,c2 (Ours)</td><td>72.2</td><td>76.4</td><td>60.6</td><td>73.8</td><td>51.0</td><td>40.9</td><td>72.0</td></tr></table>
|
| 291 |
+
|
| 292 |
+
In table 10, we show black box attack accuracies with the source and the target networks switched from the table 4. We also observe that networks trained with both low-level similarity learning and cascade/ensemble adversarial training $( \mathrm { R } 1 1 0 _ { P , C 2 }$ , $\mathbf { R } 1 1 0 _ { P , E 2 } )$ show better worst-case performance than other networks. Overall, iter FGSM images crafted from ensemble model families $( \mathrm { R } 1 1 0 _ { E }$ , $\operatorname { R 1 1 0 } _ { P , E } )$ remain strong on the defended networks.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 9: Cumulative distribution function vs. $\epsilon$ for 100 test adversarial examples generated by CW $L _ { \infty }$ attack. Lower CDF value for a fixed $\epsilon$ means the better defense.
|
| 296 |
+
|
| 297 |
+
Carlini and Wagner (CW) $L _ { \infty }$ attack solves the following optimization problem for every input $\boldsymbol { X }$
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
m i n i m i z e \quad c \cdot f ( X + \pmb { \delta } ) + \sum _ { i } [ ( | \delta _ { i } | - \tau ) ^ { + } ]
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
where, the function $f$ is defined such that attack is success if and only if $f ( X + \delta ) < 0 , \mathfrak { c }$ δ is the target perturbation defined as $X ^ { a d v } - X$ , $c$ is the parameter to control the relative weight of function $f$ in the total cost function, and $\tau$ is the control threshold used to penalize any terms that exceed $\tau$ .
|
| 304 |
+
|
| 305 |
+
Since CW $L _ { \infty }$ attack is computationally expensive, we only use 100 test examples (10 examples per each class). We search adversarial example $X ^ { a d v }$ with $c \in \{ 0 . 1 , 0 . 2 , 0 . 5 , 1 , 2 , 5 , 1 0 , 2 0 \}$ and $\tau \in \ \{ 0 . 0 2 , 0 . 0 4 , . . . , 0 . 6 \}$ for MNIST and $c ~ \in ~ \{ 0 . 1 , 0 . 3 , 1 , 3 , 1 0 , 3 0 , 1 0 0 \}$ and $\tau \_ { \in }$ $\{ 0 . 0 0 1 , 0 . 0 0 \dot { 2 } , . . . , 0 . 0 1 , 0 . 0 1 2 , . . . , 0 . 0 2 , 0 . 0 2 4 , . . . , 0 . 0 4 , 0 . 0 4 8 , . . . , 0 . 0 8 \}$ for CIFAR10. We use Adam optimizer with an initial learning rate of $0 . 0 1 / c$ since we found constant initial learning rate for $c \cdot f ( \pmb { X } + \pmb { \delta } )$ term is critical for successful adversarial images generation. We terminate the search after 2,000 iterations for each $\boldsymbol { X }$ , $c$ and $\tau$ . If $f ( X + \delta ) < 0$ and the resulting $| | \delta | | _ { \infty }$ is lower than the current best distance, we update $X ^ { a d v }$ .
|
| 306 |
+
|
| 307 |
+
Figure 9 shows cumulative distribution function of $\epsilon$ for 100 successful adversarial examples per each network. We report the number of adversarial examples with $\epsilon > 0 . 3 ^ { * } 2 5 5$ for MNIST and that with $\epsilon > 2$ or 4 for CIFAR10. As seen from this figure, our approaches provide robust defense against CW $L _ { \infty }$ attack compared to other approaches.
|
md/train/HyxCxhRcY7/HyxCxhRcY7.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP ANOMALY DETECTION WITH OUTLIER EXPOSURE
|
| 2 |
+
|
| 3 |
+
Dan Hendrycks University of California, Berkeley hendrycks@berkeley.edu
|
| 4 |
+
|
| 5 |
+
Mantas Mazeika University of Chicago mantas@ttic.edu
|
| 6 |
+
|
| 7 |
+
Thomas Dietterich Oregon State University tgd@oregonstate.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
It is important to detect anomalous inputs when deploying machine learning systems. The use of larger and more complex inputs in deep learning magnifies the difficulty of distinguishing between anomalous and in-distribution examples. At the same time, diverse image and text data are available in enormous quantities. We propose leveraging these data to improve deep anomaly detection by training anomaly detectors against an auxiliary dataset of outliers, an approach we call Outlier Exposure (OE). This enables anomaly detectors to generalize and detect unseen anomalies. In extensive experiments on natural language processing and small- and large-scale vision tasks, we find that Outlier Exposure significantly improves detection performance. We also observe that cutting-edge generative models trained on CIFAR-10 may assign higher likelihoods to SVHN images than to CIFAR-10 images; we use OE to mitigate this issue. We also analyze the flexibility and robustness of Outlier Exposure, and identify characteristics of the auxiliary dataset that improve performance.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Machine Learning systems in deployment often encounter data that is unlike the model’s training data. This can occur in discovering novel astronomical phenomena, finding unknown diseases, or detecting sensor failure. In these situations, models that can detect anomalies (Liu et al., 2018; Emmott et al., 2013) are capable of correctly flagging unusual examples for human intervention, or carefully proceeding with a more conservative fallback policy.
|
| 16 |
+
|
| 17 |
+
Behind many machine learning systems are deep learning models (Krizhevsky et al., 2012) which can provide high performance in a variety of applications, so long as the data seen at test time is similar to the training data. However, when there is a distribution mismatch, deep neural network classifiers tend to give high confidence predictions on anomalous test examples (Nguyen et al., 2015). This can invalidate the use of prediction probabilities as calibrated confidence estimates (Guo et al., 2017), and makes detecting anomalous examples doubly important.
|
| 18 |
+
|
| 19 |
+
Several previous works seek to address these problems by giving deep neural network classifiers a means of assigning anomaly scores to inputs. These scores can then be used for detecting outof-distribution (OOD) examples (Hendrycks & Gimpel, 2017; Lee et al., 2018; Liu et al., 2018). These approaches have been demonstrated to work surprisingly well for complex input spaces, such as images, text, and speech. Moreover, they do not require modeling the full data distribution, but instead can use heuristics for detecting unmodeled phenomena. Several of these methods detect unmodeled phenomena by using representations from only in-distribution data.
|
| 20 |
+
|
| 21 |
+
In this paper, we investigate a complementary method where we train models to detect unmodeled data by learning cues for whether an input is unmodeled. While it is difficult to model the full data distribution, we can learn effective heuristics for detecting out-of-distribution inputs by exposing the model to OOD examples, thus learning a more conservative concept of the inliers and enabling the detection of novel forms of anomalies. We propose leveraging diverse, realistic datasets for this purpose, with a method we call Outlier Exposure (OE). OE provides a simple and effective way to consistently improve existing methods for OOD detection.
|
| 22 |
+
|
| 23 |
+
Through numerous experiments, we extensively evaluate the broad applicability of Outlier Exposure. For multiclass neural networks, we provide thorough results on Computer Vision and Natural
|
| 24 |
+
|
| 25 |
+
Language Processing tasks which show that Outlier Exposure can help anomaly detectors generalize to and perform well on unseen distributions of outliers, even on large-scale images. We also demonstrate that Outlier Exposure provides gains over several existing approaches to out-of-distribution detection. Our results also show the flexibility of Outlier Exposure, as we can train various models with different sources of outlier distributions. Additionally, we establish that Outlier Exposure can make density estimates of OOD samples significantly more useful for OOD detection. Finally, we demonstrate that Outlier Exposure improves the calibration of neural network classifiers in the realistic setting where a fraction of the data is OOD. Our code is made publicly available at https://github.com/hendrycks/outlier-exposure.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Out-of-Distribution Detection with Deep Networks. Hendrycks & Gimpel (2017) demonstrate that a deep, pre-trained classifier has a lower maximum softmax probability on anomalous examples than in-distribution examples, so a classifier can conveniently double as a consistently useful outof-distribution detector. Building on this work, DeVries & Taylor (2018) attach an auxiliary branch onto a pre-trained classifier and derive a new OOD score from this branch. Liang et al. (2018) present a method which can improve performance of OOD detectors that use a softmax distribution. In particular, they make the maximum softmax probability more discriminative between anomalies and in-distribution examples by pre-processing input data with adversarial perturbations (Goodfellow et al., 2015). Unlike in our work, their parameters are tailored to each source of anomalies.
|
| 30 |
+
|
| 31 |
+
Lee et al. (2018) train a classifier concurrently with a GAN (Radford et al., 2016; Goodfellow et al., 2014), and the classifier is trained to have lower confidence on GAN samples. For each testing distribution of anomalies, they tune the classifier and GAN using samples from that out-distribution, as discussed in Appendix B of their work. Unlike Liang et al. (2018); Lee et al. (2018), in this work we train our method without tuning parameters to fit specific types of anomaly test distributions, so our results are not directly comparable with their results. Many other works (de Vries et al., 2016; Subramanya et al., 2017; Malinin & Gales, 2018; Bevandic et al., 2018) also encourage the model to have lower confidence on anomalous examples. Recently, Liu et al. (2018) provide theoretical guarantees for detecting out-of-distribution examples under the assumption that a suitably powerful anomaly detector is available.
|
| 32 |
+
|
| 33 |
+
Utilizing Auxiliary Datasets. Outlier Exposure uses an auxiliary dataset entirely disjoint from test-time data in order to teach the network better representations for anomaly detection. Goodfellow et al. (2015) train on adversarial examples to increased robustness. Salakhutdinov et al. (2011) pre-train unsupervised deep models on a database of web images for stronger features. Radford et al. (2017) train an unsupervised network on a corpus of Amazon reviews for a month in order to obtain quality sentiment representations. Zeiler & Fergus (2014) find that pre-training a network on the large ImageNet database (Russakovsky et al., 2015) endows the network with general representations that are useful in many fine-tuning applications. Chen & Gupta (2015); Mahajan et al. (2018) show that representations learned from images scraped from the nigh unlimited source of search engines and photo-sharing websites improve object detection performance.
|
| 34 |
+
|
| 35 |
+
# 3 OUTLIER EXPOSURE
|
| 36 |
+
|
| 37 |
+
We consider the task of deciding whether or not a sample is from a learned distribution called $\mathcal { D } _ { \mathrm { i n } }$ . Samples from $\mathcal { D } _ { \mathrm { i n } }$ are called “in-distribution,” and otherwise are said to be “out-of-distribution” (OOD) or samples from $\mathcal { D } _ { \mathrm { o u t } }$ . In real applications, it may be difficult to know the distribution of outliers one will encounter in advance. Thus, we consider the realistic setting where $\mathcal { D } _ { \mathrm { o u t } }$ is unknfrom Given a parametrized OOD detector and an Outlier Exposure (OE) dataset , we train the model to discover signals and learn heuristics to detect whet $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ , disjoint query is $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ out sampled from $\mathcal { D } _ { \mathrm { i n } }$ or $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ . We find that these heuristics generalize to unseen distributions $\mathcal { D } _ { \mathrm { o u t } }$ .
|
| 38 |
+
|
| 39 |
+
Deep parametrized anomaly detectors typically leverage learned representations from an auxiliary task, such as classification or density estimation. Given a model $f$ and the original learning objective $\mathcal { L }$ , we can thus formalize Outlier Exposure as minimizing the objective
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array} { r } { \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { \mathrm { i n } } } [ \mathcal { L } ( f ( x ) , y ) + \lambda \mathbb { E } _ { x ^ { \prime } \sim \mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o g } } } [ \mathcal { L } _ { \mathrm { O E } } ( f ( x ^ { \prime } ) , f ( x ) , y ) ] ] } \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
over the parameters of $f$ . In cases where labeled data is not available, then $y$ can be ignored.
|
| 46 |
+
|
| 47 |
+
Outlier Exposure can be applied with many types of data and original tasks. Hence, the specific formulation of $\mathcal { L } _ { \mathrm { O E } }$ is a design choice, and depends on the task at hand and the OOD detector used. For example, when using the maximum softmax probability baseline detector (Hendrycks & Gimpel, 2017), we set $\mathcal { L } _ { \mathrm { O E } }$ to the cross-entropy from $f ( x ^ { \prime } )$ to the uniform distribution (Lee et al., 2018). When the original objective $\mathcal { L }$ is density estimation and labels are not available, we set $\mathcal { L } _ { \mathrm { O E } }$ to a margin ranking loss on the log probabilities $f ( x ^ { \prime } )$ and $f ( x )$ .
|
| 48 |
+
|
| 49 |
+
# 4 EXPERIMENTS
|
| 50 |
+
|
| 51 |
+
We evaluate OOD detectors with and without OE on a wide range of datasets. Each evaluation consists of an in-distribution dataset $\mathcal { D } _ { \mathrm { i n } }$ used to train an initial model, a dataset of anomalous examples $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ , and a baseline detector to which we apply OE. We describe the datasets in Section 4.2. The OOD detectors and $\mathcal { L } _ { \mathrm { O E } }$ losses are described on a case-by-case basis.
|
| 52 |
+
|
| 53 |
+
In the first experiment, we show that OE can help detectors generalize to new text and image anomalies. This is all accomplished without assuming access to the test distribution during training or tuning, unlike much previous work. In the confidence branch experiment, we show that OE is flexible and complements a binary anomaly detector. Then we demonstrate that using synthetic outliers does not work as well as using real and diverse data; previously it was assumed that we need synthetic data or carefully selected close-to-distribution data, but real and diverse data is enough. We conclude with experiments in density estimation. In these experiments we find that a cutting-edge density estimator unexpectedly assigns higher density to out-of-distribution samples than in-distribution samples, and we ameliorate this surprising behavior with Outlier Exposure.
|
| 54 |
+
|
| 55 |
+
# 4.1 EVALUATING OUT-OF-DISTRIBUTION DETECTION METHODS
|
| 56 |
+
|
| 57 |
+
We evaluate out-of-distribution detection methods on their ability to detect OOD points. For this purpose, we treat the OOD examples as the positive class, and we evaluate three metrics: area under the receiver operating characteristic curve (AUROC), area under the precision-recall curve (AUPR), and the false positive rate at $\bar { N } \%$ true positive rate (FPRN ). The AUROC and AUPR are holistic metrics that summarize the performance of a detection method across multiple thresholds. The AUROC can be thought of as the probability that an anomalous example is given a higher OOD score than a in-distribution example (Davis & Goadrich, 2006). Thus, a higher AUROC is better, and an uninformative detector has an AUROC of $50 \%$ . The AUPR is useful when anomalous examples are infrequent (Manning & Schutze ¨ , 1999), as it takes the base rate of anomalies into account. During evaluation with these metrics, the base rate of $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ to $\mathcal { D } _ { \mathrm { i n } } ^ { \mathrm { t e s t } }$ test examples in all of our experiments is 1:5.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: ROC curve with Tiny ImageNet $( \mathcal { D } _ { \mathrm { i n } } )$ and Textures $( \mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } } )$ .
|
| 61 |
+
|
| 62 |
+
Whereas the previous two metrics represent the detection performance across various thresholds, the FPRN metric represents performance at one strict threshold. By observing performance at a strict threshold, we can make clear comparisons among strong detectors. The FPRN metric (Liu et al., 2018; Kumar et al., 2016; Balntas et al., 2016) is the probability that an in-distribution example (negative) raises a false alarm when $N \%$ of anomalous examples (positive) are detected, so a lower FPR $N$ is better. Capturing nearly all anomalies with few false alarms can be of high practical value.
|
| 63 |
+
|
| 64 |
+
# 4.2 DATASETS
|
| 65 |
+
|
| 66 |
+
# 4.2.1 IN-DISTRIBUTION DATASETS
|
| 67 |
+
|
| 68 |
+
SVHN. The SVHN dataset (Netzer et al., 2011) contains $3 2 \times 3 2$ color images of house numbers. There are ten classes comprised of the digits 0-9. The training set has 604, 388 images, and the test set has 26, 032 images. For preprocessing, we rescale the pixels to be in the interval $[ 0 , 1 ]$ .
|
| 69 |
+
|
| 70 |
+
CIFAR. The two CIFAR (Krizhevsky & Hinton, 2009) datasets contain $3 2 \times 3 \bar { 2 }$ natural color images. CIFAR-10 has ten classes while CIFAR-100 has 100. CIFAR-10 and CIFAR-100 classes are disjoint but have similiarities. For example, CIFAR-10 has “automobiles” and “trucks” but not CIFAR-100’s “pickup truck” class. Both have 50, 000 training images and 10, 000 test images. For this and the remaining image datasets, each image is standardized channel-wise.
|
| 71 |
+
|
| 72 |
+
Tiny ImageNet. The Tiny ImageNet dataset (Johnson et al.) is a 200-class subset of the ImageNet (Russakovsky et al., 2015) dataset where images are resized and cropped to $6 4 \times 6 4$ resolution. The dataset’s images were cropped using bounding box information so that cropped images contain the target, unlike Downsampled ImageNet (Chrabaszcz et al., 2017). The training set has 100, 000 images and the test set has 10, 000 images.
|
| 73 |
+
|
| 74 |
+
Places365. The Places365 training dataset (Zhou et al., 2017) consists in 1, 803, 460 large-scale photographs of scenes. Each photograph belongs to one of 365 classes.
|
| 75 |
+
|
| 76 |
+
20 Newsgroups. 20 Newsgroups is a text classification dataset of newsgroup documents with 20 classes and approximately 20, 000 examples split evenly among the classes. We use the standard 60/40 train/test split.
|
| 77 |
+
|
| 78 |
+
TREC. TREC is a question classification dataset with 50 fine-grained classes and 5, 952 individual questions. We reserve 500 examples for the test set, and use the rest for training.
|
| 79 |
+
|
| 80 |
+
SST. The Stanford Sentiment Treebank dataset (Socher et al., 2013) consists of movie reviews expressing positive or negative sentiment. SST has 8, 544 reviews for training and 2, 210 for testing.
|
| 81 |
+
|
| 82 |
+
# 4.2.2 OUTLIER EXPOSURE DATASETS
|
| 83 |
+
|
| 84 |
+
80 Million Tiny Images. 80 Million Tiny Images (Torralba et al., 2008) is a large-scale, diverse dataset ofwith SVH $3 2 \times 3 2$ natural images scrapped fAR-10, and CIFAR-100 as the web. We use this dataset as. We remove all examples of 80 $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ for experimentsion Tiny Images in which appear in the CIFAR datasets, so that DOEout and Dtestout are disjoint. In Section 5 we note that
|
| 85 |
+
|
| 86 |
+
ImageNet-22K. We use the ImageNet dataset with images from approximately 22 thousand classes as too low-re $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ for Tiny Imion. To make et anand aces365 since images from 80 Million Tiny Images areare disjoint, images in ImageNet-1K are removed. $\bar { \mathcal { D } } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$
|
| 87 |
+
|
| 88 |
+
WikiText-2. WikiText-2 is a corpus of Wikipedia articles typically used for language modeling. We use WikiText-2 as $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ for language modeling experiments with Penn Treebank as $\mathcal { D } _ { \mathrm { i n } }$ . For classification tasks on 20 Newsgroups, TREC, and SST, we treat each sentence of WikiText-2 as an individual example, and use simple filters to remove low-quality sentences.
|
| 89 |
+
|
| 90 |
+
# 4.3 MULTICLASS CLASSIFICATION
|
| 91 |
+
|
| 92 |
+
In what follows, we use Outlier Exposure to enhance the performance of existing OOD detection techniques with multiclass classification as the original task. Throughout the following experiments, we let $x \in \mathcal { X }$ be a classifier’s input and $y \in { \mathcal { Y } } = \{ 1 , 2 , \dotsc , \underline { { k } } \}$ be a class. We also represent the classifier with the function $f : \mathcal { X } \overset { } { \to } \mathbb { R } ^ { k }$ , such that for any $x$ , $1 ^ { \top } \bar { f } ( x ) = 1$ and $f ( x ) \succeq 0$ .
|
| 93 |
+
|
| 94 |
+
Maximum Softmax Probability (MSP). Consider the maximum softmax probability baseline (Hendrycks & Gimpel, 2017) which gives an input $x$ the OOD score $- \operatorname* { m a x } _ { c } f _ { c } ( x )$ . Out-ofdistribution samples are drawn from various unseen distributions (Appendix A). For each task, we test with approximately twice the number of $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ distributions compared to most other papers, and we also test on NLP tasks. The quality of the OOD example scores are judged with the metrics described in Section 4.1. For this multiclass setting, we perform Outlier Exposure by fine-tuning a pre-trained classifier $f$ so that its posterior is more uniform on $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ samples. Specifically, the finetuning objective is $\begin{array} { r } { \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { \mathrm { i n } } } [ - \log f _ { y } ( x ) ] + \lambda \mathbb { E } _ { x \sim \mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o g } } } [ H ( \mathcal { U } ; f ( \bar { x } ) ) ] } \end{array}$ , where $H$ is the cross entropy and $\mathcal { U }$ is the uniform distribution over $k$ classes. When there is class imbalance, we could encourage $f ( x )$ to match $( P ( y = 1 ) , \ldots , P ( y = k ) )$ ; yet for the datasets we consider, matching $\mathcal { U }$ works well enough. Also, note that training from scratch with OE can result in even better performance than fine-tuning (Appendix C). This approach works on different architectures as well (Appendix D).
|
| 95 |
+
|
| 96 |
+
Unlike Liang et al. (2018); Lee et al. (2018) and like Hendrycks & Gimpel (2017); DeVries & Taylor (2018), we do not tune our hyperparameters for each $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ distribution, so that $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ is kept unknown like with real-world anomalies. Instead, the $\lambda$ coefficients were determined early in experimentation with validation $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { v a l } }$ distributions described in Appendix A. In particular, we use $\lambda = 0 . 5$ for vision experiments and $\lambda = 1 . 0$ for NLP experiments. Like previous OOD detection methods involving network fine-tuning, we chose $\lambda$ so that impact on classification accuracy is negligible.
|
| 97 |
+
|
| 98 |
+
For nearly all of the vision experiments, we train Wide Residual Networks (Zagoruyko & Komodakis, 2016) and then fine-tune network copies with OE for 10 epochs. However we use a pretrained ResNet-18 for Places365. For NLP experiments, we train 2-layer GRUs (Cho et al., 2014) for 5 epochs, then fine-tune network copies with OE for 2 epochs. Networks trained on CIFAR10 or CIFAR-100 are exposed to images from 80 Million Tiny Images, and the Tiny ImageNet and Places365 classifiers are exposed to ImageNet-22K. NLP classifiers are exposed to WikiText-2. Further architectural and training details are in Appendix B. For all tasks, OE improves average performance by a large margin. Averaged results are shown in Tables 1 and 2. Sample ROC curves are shown in Figures 1 and 4. Detailed results on individual $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets are in Table 7 and Table 8 in Appendix A. Notice that the SVHN classifier with OE can be used to detect new anomalies such as emojis and street view alphabet letters, even though $\mathcal { D } _ { \mathrm { O E } } ^ { \mathrm { t e s t } }$ is a dataset of natural images. Thus, Outlier Exposure helps models to generalize to unseen $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ distributions far better than the baseline.
|
| 99 |
+
|
| 100 |
+
<table><tr><td rowspan="2">Din</td><td colspan="2">FPR95↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td>SVHN</td><td>6.3</td><td>0.1</td><td>98.0</td><td>100.0</td><td>91.1</td><td>99.9</td></tr><tr><td>CIFAR-10</td><td>34.9</td><td>9.5</td><td>89.3</td><td>97.8</td><td>59.2</td><td>90.5</td></tr><tr><td>CIFAR-100</td><td>62.7</td><td>38.5</td><td>73.1</td><td>87.9</td><td>30.1</td><td>58.2</td></tr><tr><td>Tiny ImageNet</td><td>66.3</td><td>14.0</td><td>64.9</td><td>92.2</td><td>27.2</td><td>79.3</td></tr><tr><td>Places365</td><td>63.5</td><td>28.2</td><td>66.5</td><td>90.6</td><td>33.1</td><td>71.0</td></tr></table>
|
| 101 |
+
|
| 102 |
+
Table 1: Out-of-distribution image detection for the maximum softmax probability (MSP) baseline detector and the MSP detector after fine-tuning with Outlier Exposure (OE). Results are percentages and also an average of 10 runs. Expanded results are in Appendix A.
|
| 103 |
+
|
| 104 |
+
<table><tr><td rowspan="2">Din</td><td colspan="2">FPR90↓</td><td colspan="2">AUROC↑</td><td colspan="2">AUPR↑</td></tr><tr><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td>20 Newsgroups</td><td>42.4</td><td>4.9</td><td>82.7</td><td>97.7</td><td>49.9</td><td>91.9</td></tr><tr><td>TREC</td><td>43.5</td><td>0.8</td><td>82.1</td><td>99.3</td><td>52.2</td><td>97.6</td></tr><tr><td>SST</td><td>74.9</td><td>27.3</td><td>61.6</td><td>89.3</td><td>22.9</td><td>59.4</td></tr></table>
|
| 105 |
+
|
| 106 |
+
Table 2: Comparisons between the MSP baseline and the MSP of the natural language classifier fine-tuned with OE. Results are percentages and averaged over 10 runs.
|
| 107 |
+
|
| 108 |
+
Confidence Branch. A recently proposed OOD detection technique (DeVries & Taylor, 2018) involves appending an OOD scoring branch $b : \mathcal { X } [ 0 , 1 ]$ onto a deep network. Trained with samples from only $\mathcal { D } _ { \mathrm { i n } }$ , this branch estimates the network’s confidence on any input. The creators of this technique made their code publicly available, so we use their code to train new 40-4 Wide Residual Network classifiers. We fine-tune the confidence branch with Outlier Exposure by adding $0 . 5 \mathbb { E } _ { \boldsymbol { x } \sim \mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } } } \left[ \log b ( \boldsymbol { x } ) \right]$ to the network’s original optimization objective. In Table 3, the baseline values are derived from the maximum softmax probabilities produced by the classifier trained with DeVries & Taylor (2018)’s publicly available training code. The confidence branch improves over this MSP detector, and after OE, the confidence branch detects anomalies more effectively.
|
| 109 |
+
|
| 110 |
+
<table><tr><td rowspan="2">Din</td><td colspan="3">FPR95↓</td><td colspan="3">AUROC ↑</td><td colspan="3">AUPR ↑</td></tr><tr><td>MSP</td><td>Branch</td><td>+OE</td><td>MSP</td><td>Branch</td><td>+OE</td><td>MSP</td><td>Branch</td><td>+OE</td></tr><tr><td>CIFAR-10</td><td>49.3</td><td>38.7</td><td>20.8</td><td>84.4</td><td>86.9</td><td>93.7</td><td>51.9</td><td>48.6</td><td>66.6</td></tr><tr><td>CIFAR-100</td><td>55.6</td><td>47.9</td><td>42.0</td><td>77.6</td><td>81.2</td><td>85.5</td><td>36.5</td><td>44.4</td><td>54.7</td></tr><tr><td>Tiny ImageNet</td><td>64.3</td><td>66.9</td><td>20.1</td><td>65.3</td><td>63.4</td><td>90.6</td><td>30.3</td><td>25.7</td><td>75.2</td></tr></table>
|
| 111 |
+
|
| 112 |
+
Table 3: Comparison among the maximum softmax probability, Confidence Branch, and Confidence Branch $+ \mathrm { { ~ O E ~ } }$ OOD detectors. The same network architecture is used for all three detectors. All results are percentages, and averaged across all $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets.
|
| 113 |
+
|
| 114 |
+
Synthetic Outliers. Outlier Exposure leverages the simplicity of downloading real datasets, but it is possible to generate synthetic outliers. Note that we made an attempt to distort images with noise and use these as outliers for OE, but the classifier quickly memorized this statistical pattern and did not detect new OOD examples any better than before (Hafner et al., 2018). A method with better success is from Lee et al. (2018). They carefully train a GAN to generate synthetic examples near the classifier’s decision boundary. The classifier is encouraged to have a low maximum softmax probability on these synthetic examples. For CIFAR classifiers, they mention that a GAN can be a better source of anomalies than datasets such as SVHN. In contrast, we find that the simpler approach of drawing anomalies from a diverse dataset is sufficient for marked improvements in OOD detection.
|
| 115 |
+
|
| 116 |
+
We train a 40-4 Wide Residual Network using Lee et al. (2018)’s publicly available code, and use the network’s maximum softmax probabilities as our baseline. Another classifier trains concurrently with a GAN so that the classifier assigns GAN-generated examples a high OOD score. We want each $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ to be novel. Counters all tested ently we use their code’s default hyperparameters, and distributions. This is unlike their work since, for each ly one modeldistribution, $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ they train and tune a new network. We do not evaluate on Tiny ImageNet, Places365, nor text, since DCGANs cannot stably generate such images and text reliably. Lastly, we take the network trained in tandem with a GAN and fine-tune it with OE. Table 4 shows the large gains from using OE with a real and diverse dataset over using synthetic samples from a GAN.
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan="2">Din</td><td colspan="3">FPR95↓</td><td colspan="3">AUROC ↑</td><td colspan="3">AUPR↑</td></tr><tr><td>MSP</td><td>+GAN</td><td>+OE</td><td>MSP</td><td>+GAN</td><td>+OE</td><td>MSP</td><td>+GAN</td><td>+OE</td></tr><tr><td>CIFAR-10</td><td>32.3</td><td>37.3</td><td>11.8</td><td>88.1</td><td>89.6</td><td>97.2</td><td>51.1</td><td>59.0</td><td>88.5</td></tr><tr><td>CIFAR-100</td><td>66.6</td><td>66.2</td><td>49.0</td><td>67.2</td><td>69.3</td><td>77.9</td><td>27.4</td><td>33.0</td><td>44.7</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 4: Comparison among the maximum softmax probability (MSP), $\mathbf { M S P + G A N }$ , and ${ \mathrm { M S P } } + { }$ $\mathrm { G A N + O E }$ OOD detectors. The same network architecture is used for all three detectors. All results are percentages and averaged across all $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets.
|
| 121 |
+
|
| 122 |
+
# 4.4 DENSITY ESTIMATION
|
| 123 |
+
|
| 124 |
+
Density estimators learn a probability density function over the data distribution $\mathcal { D } _ { \mathrm { i n } }$ . Anomalous examples should have low probability density, as they are scarce in $\mathcal { D } _ { \mathrm { i n } }$ by definition (Nalisnick et al., 2019). Consequently, density estimates are another means by which to score anomalies (Zong et al., 2018). We show the ability of OE to improve density estimates on low-probability, outlying data.
|
| 125 |
+
|
| 126 |
+
$\mathbf { P i x e l C N N + + }$ . Autoregressive neural density estimators provide a way to parametrize the probability density of image data. Although sampling from these architectures is slow, they allow for evaluating the probability density with a single forward pass through a CNN, making them promising candidates for OOD detection. We use Pix${ \mathrm { e l C N N } } { + + }$ (Salimans et al., 2017) as a baseline OOD detector, and we train it on CIFAR-10. The OOD score of example $x$ is the bits per pixel (BPP), defined as ${ \mathrm { n l l } } ( x ) / { \mathrm { n u m } } \_ { \mathrm { p i x e l } \mathrm { s } }$ , where nll is the negative log-likelihood. With this loss we fine-tune for 2 epochs using OE, which we find is sufficient for the training loss to converge. Here OE is implemented with a margin loss over the log-likelihood difference between in-distribution and anomalous examples, so that the loss for a sample $x _ { \mathrm { i n } }$ from $\mathcal { D } _ { \mathrm { i n } }$ and point $x _ { \mathrm { o u t } }$ from $\hat { \mathcal { D } } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ is
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
In-Distribution
|
| 130 |
+
Figure 2: OOD scores from PixelCNN $^ { + + }$ on images from CIFAR-10 and SVHN.
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\mathrm { m a x } \{ 0 , \mathrm { n u m \_ p i x e l s } + \mathrm { n l l } ( x _ { \mathrm { i n } } ) - \mathrm { n l l } ( x _ { \mathrm { o u t } } ) \} .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Results are shown in Table 5. Notice that PixelCNN++ without OE unexpectedly assigns lower BPP from SVHN images than CIFAR-10 images. For all $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets, OE significantly improves results.
|
| 137 |
+
|
| 138 |
+
Language Modeling. We next explore using OE on language models. We use QRNN (Merity et al., 2018a;b) language models as baseline OOD detectors. For the OOD score, we use bits per character (BPC) or bits per word (BPW), defined as $\mathrm { n l l } ( x ) / { \mathrm { s } } ,$ equence_length, where $\mathrm { n l l } ( x )$ is the negative log-likelihood of the sequence $x$ . Outlier Exposure is implemented by adding the cross entropy to the uniform distribution on tokens from sequences in $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ as an additional loss term.
|
| 139 |
+
|
| 140 |
+
For $\mathcal { D } _ { \mathrm { i n } }$ , we convert the language-modeling version of Penn Treebank, split into sequences of length 70 for backpropagation for word-level models, and 150 for character-level models. We do not train or evaluate with preserved hidden states as in BPTT. This is because retaining hidden states would greatly simplify the task of OOD detection. Accordingly, the OOD detection task is to provide a score for 70- or 150-token sequences in the unseen $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets.
|
| 141 |
+
|
| 142 |
+
Table 5: OOD detection results with a $\mathrm { P i x e l C N N + + }$ density estimator, and the same estimator after applying OE. The model’s bits per pixel (BPP) scores each sample. All results are percentages. Test distributions $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ are described in Appendix A.
|
| 143 |
+
|
| 144 |
+
<table><tr><td colspan="2"></td><td colspan="2">FPR95↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>Din</td><td>Dtest out</td><td>BPP</td><td>+OE</td><td>BPP</td><td>+OE</td><td>BPP</td><td>+OE</td></tr><tr><td rowspan="9">CIFAR-10</td><td>Gaussian</td><td>0.0</td><td>0.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>99.6</td></tr><tr><td>Rademacher</td><td>61.4</td><td>50.3</td><td>44.2</td><td>56.5</td><td>14.2</td><td>17.3</td></tr><tr><td>Blobs</td><td>17.2</td><td>1.3</td><td>93.2</td><td>99.5</td><td>60.0</td><td>96.2</td></tr><tr><td>Textures</td><td>96.8</td><td>48.9</td><td>69.4</td><td>88.8</td><td>40.9</td><td>70.0</td></tr><tr><td>SVHN</td><td>98.8</td><td>86.9</td><td>15.8</td><td>75.8</td><td>9.7</td><td>60.0</td></tr><tr><td>Places365</td><td>86.1</td><td>50.3</td><td>74.8</td><td>89.3</td><td>38.6</td><td>70.4</td></tr><tr><td>LSUN</td><td>76.9</td><td>43.2</td><td>76.4</td><td>90.9</td><td>36.5</td><td>72.4</td></tr><tr><td>CIFAR-100</td><td>96.1</td><td>89.8</td><td>52.4</td><td>68.5</td><td>19.0</td><td>41.9</td></tr><tr><td>Mean</td><td>66.6</td><td>46.4</td><td>65.8</td><td>83.7</td><td>39.9</td><td>66.0</td></tr></table>
|
| 145 |
+
|
| 146 |
+
We train word-level models for 300 epochs, and character-level models for 50 epochs. We then fine-tune using OE on WikiText-2 for 5 epochs. For the character-level language model, we create a character-level version of WikiText-2 by converting words to lowercase and leaving out characters which do not appear in PTB. OOD detection results for the word-level and character-level language models are shown in Table 6; expanded results and $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ descriptions are in Appendix F. In all cases, OE improves over the baseline, and the improvement is especially large for the word-level model.
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2">Din</td><td colspan="2">FPR90↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR↑</td></tr><tr><td>BPC/BPW</td><td>+OE</td><td>BPC/BPW</td><td>+OE</td><td>BPC/BPW</td><td>+OE</td></tr><tr><td>PTB Characters</td><td>99.0</td><td>89.4</td><td>77.5</td><td>86.3</td><td>76.0</td><td>86.7</td></tr><tr><td>PTB Words</td><td>48.5</td><td>0.98</td><td>81.2</td><td>99.2</td><td>44.0</td><td>97.8</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 6: OOD detection results on Penn Treebank language models. Results are percentages averaged over the $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets. Expanded results are in Appendix F.
|
| 151 |
+
|
| 152 |
+
# 5 DISCUSSION
|
| 153 |
+
|
| 154 |
+
Extensions to Multilabel Classifiers and the Reject Option. Outlier Exposure can work in more classification regimes than just those considered above. For example, a multilabel classifier trained on CIFAR-10 obtains an $8 8 . 8 \%$ mean AUROC when using the maximum prediction probability as the OOD score. By training with OE to decrease the classifier’s output probabilities on OOD samples, the mean AUROC increases to $9 7 . 1 \%$ . This is slightly less than the AUROC for a multiclass model tuned with OE. An alternative OOD detection formulation is to give classifiers a “reject class” (Bartlett & Wegkamp, 2008). Outlier Exposure is also flexible enough to improve performance in this setting, but we find that even with OE, classifiers with the reject option or multilabel outputs are not as competitive as OOD detectors with multiclass outputs.
|
| 155 |
+
|
| 156 |
+
Flexibility in Choosing tant for generalization to $\mathcal { D } _ { \mathbf { o u t } } ^ { \mathbf { o E } }$ . een in experimentation, we found that the choice of distributions. For example, adding Gaussian no $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ is impor-o samples $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$
|
| 157 |
+
from $\mathcal { D } _ { \mathrm { i n } }$ to create $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ does not teach the network to generalize to unseen anomaly distributions for
|
| 158 |
+
complex $\mathcal { D } _ { \mathrm { i n } }$ . Similarly, we found in Section 4.3 that synthetic anomalies do not work as well as real
|
| 159 |
+
data for describe $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ . In contrast, our experiments demonSection 4.2.2 do generalize to unseen that the large datasets of realistic anomaliesdistributions. $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$
|
| 160 |
+
|
| 161 |
+
In addition to size and realism, we founCIFAR-100 classifier with CIFAR-10 as ersity of hardly i $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ to be an important factor. Concretely, aves over the baseline. A CIFAR-10 clas$\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ sifier exposed to ten CIFAR-100 outlier classes corresponds to an average AUPR of $78 . 5 \%$ . Exposed to 30 such classes, the classifier’s average AUPR becomes $8 5 . 1 \%$ . Next, 50 classes corresponds to $8 5 . 3 \%$ , and from thereon additional CIFAR-100 classes barely improve performance. This suggests that dataset diversity is important, not just size. In fact, experiments in this paper often used around
|
| 162 |
+
|
| 163 |
+
$1 \%$ of the images in the 80 Million Tiny Images dataset since we only briefly fine-tuned the models. We also found that using only 50,000 examples from this dataset led to a negligible degradation in detection performance. Additionally, $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ datasets with significantly different statistics can perform out similarly. For instance, using the Project Gutenberg dataset in lieu of WikiText-2 for $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o b } }$ i n the SST experiments gives an average AUROC of $9 0 . 1 \%$ instead of $8 9 . 3 \%$ .
|
| 164 |
+
|
| 165 |
+
Closeness of Dtest, DOE, out and Dtestin . Our experiments show several interesting effects of the closeness of the datasets involved. Firstly, we find that $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ and $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ need not be close for training with OE to improve performance on $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ . In Appendix A, we observe that an OOD detector for SVHN has its performance improve with Ouural scenes rather than digits, and (2) Exposure even though (1) includes unnatural examp $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ samples are images of nat-uch as emojis. We observed $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$
|
| 166 |
+
out the same in our preliminary experiments with MNIST; using 80 Million Tiny Images as $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ , O E increased the AUPR from $9 4 . 2 \%$ to $9 7 . 0 \%$ . Secondly, we find that the closeness of OE. In the NLP experiments, preproces $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ $\mathcal { D } _ { \mathrm { i n } } ^ { \mathrm { t e s t } }$ can be ane closer to ortant factor in the success ofimproves OOD detection per$\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ $\mathcal { D } _ { \mathrm { i n } }$
|
| 167 |
+
formance significantly. Without preprocessing, the network may discover easy-to-learn cues which reveal whether the input is in- or out-of-distribution, so the OE training objective can be optimized in unintended ways. That results in weaker detectors. In a separate experiment, we use Online Hard Example Mining so that difficult outliers have more weight in Outlier Exposure. Although this improves performance on the hardest anomalies, anomalies without plausible local statistics like noise are detected slightly less effectively than before. Thus hard or close-to-distribution examples do not necessarily teach the detector all valuable heuristics for detecting various forms of anomalies. Real-world applications of OE could use the method of Sun et al. (2018) to refine a scraped $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ auxiliary dataset to be appropriately close to $\mathcal { D } _ { \mathrm { i n } } ^ { \mathrm { t e s t } }$ .
|
| 168 |
+
|
| 169 |
+
OE Improves Calibration. When using classifiers for prediction, it is important that confidence estimates given for the predictions do not misrepresent empirical performance. A calibrated classifier gives confidence probabilities that match the empirical frequency of correctness. That is, if a calibrated model predicts an event with $30 \%$ probability, then $30 \%$ of the time the event transpires.
|
| 170 |
+
|
| 171 |
+
Existing confidence calibration approaches consider the standard setting where data at test-time is always drawn from $\mathcal { D } _ { \mathrm { i n } }$ . We extend this setting to include examples from $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ at test-time since systems should provide calibrated probabilities on both in- and out-of-distribution samples. The classifier should have low-confidence predictions on these OOD examples, since they do not have a class. Building on the temperature tuning method of Guo et al. (2017), we demonstrate that
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 3: Root Mean Square Calibration Error values with temperature tuning and temperature tuning $+ \mathrm { O E }$ across various datasets.
|
| 175 |
+
|
| 176 |
+
OE can improve calibration performance in this realistic setting. Summary results are shown in Figure 3. Detailed results and a description of the metrics are in Appendix G.
|
| 177 |
+
|
| 178 |
+
# 6 CONCLUSION
|
| 179 |
+
|
| 180 |
+
In this paper, we proposed Outlier Exposure, a simple technique that enhances many current OOD detectors across various settings. It uses out-of-distribution samples to teach a network heuristics to detect new, unmodeled, out-of-distribution examples. We showed that this method is broadly applicable in vision and natural language settings, even for large-scale image tasks. OE can improve model calibration and several previous anomaly detection techniques. Further, OE can teach density estimation models to assign more plausible densities to out-of-distribution samples. Finally, Outlier Exposure is computationally inexpensive, and it can be applied with low overhead to existing systems. In summary, Outlier Exposure is an effective and complementary approach for enhancing out-of-distribution detection systems.
|
| 181 |
+
|
| 182 |
+
# ACKNOWLEDGMENTS
|
| 183 |
+
|
| 184 |
+
We thank NVIDIA for donating GPUs used in this research. This research was supported by a grant from the Future of Life Institute.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Vassileios Balntas, Edgar Riba, Daniel Ponsa, and Krystian Mikolajczyk. Learning local feature descriptors with triplets and shallow convolutional neural networks. British Machine Vision Conference, 2016.
|
| 189 |
+
|
| 190 |
+
Peter L Bartlett and Marten H Wegkamp. Classification with a reject option using a hinge loss. Journal of Machine Learning Research, 2008.
|
| 191 |
+
|
| 192 |
+
Petra Bevandic, Sinisa Segvic, Ivan Kreso, and Marin Orsic. Discriminative out-of-distribution detection for semantic segmentation. arXiv preprint, 2018.
|
| 193 |
+
|
| 194 |
+
Ann Bies, Justin Mott, Colin Warner, and Seth Kulick. English web treebank, 2012.
|
| 195 |
+
|
| 196 |
+
Xinlei Chen and Abhinav Gupta. Webly supervised learning of convolutional networks. In International Conference on Computer Vision, 2015.
|
| 197 |
+
|
| 198 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. Empirical Methods in Natural Language Processing, 2014.
|
| 199 |
+
|
| 200 |
+
Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of imagenet as an alternative to the cifar datasets. arXiv preprint, 2017.
|
| 201 |
+
|
| 202 |
+
Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. Computer Vision and Pattern Recognition, 2014.
|
| 203 |
+
|
| 204 |
+
Jesse Davis and Mark Goadrich. The relationship between precision-recall and ROC curves. In International Conference on Machine Learning, 2006.
|
| 205 |
+
|
| 206 |
+
Harm de Vries, Roland Memisevic, and Aaron Courville. Deep learning vector quantization. In European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, 2016.
|
| 207 |
+
|
| 208 |
+
Terrance DeVries and Graham W Taylor. Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018.
|
| 209 |
+
|
| 210 |
+
Andrew F Emmott, Shubhomoy Das, Thomas Dietterich, Alan Fern, and Weng-Keen Wong. Systematic construction of anomaly detection benchmarks from real data. In Proceedings of the ACM SIGKDD workshop on outlier detection and description. ACM, 2013.
|
| 211 |
+
|
| 212 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Neural Information Processing Systems, 2014.
|
| 213 |
+
|
| 214 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Machine Learning, 2015.
|
| 215 |
+
|
| 216 |
+
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. International Conference on Machine Learning, 2017.
|
| 217 |
+
|
| 218 |
+
Danijar Hafner, Dustin Tran, Alex Irpan, Timothy Lillicrap, and James Davidson. Reliable uncertainty estimates in deep neural networks using noise contrastive priors. International Conference on Machine Learning Workshop, 2018.
|
| 219 |
+
|
| 220 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. International Conference on Learning Representations, 2019.
|
| 221 |
+
|
| 222 |
+
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. International Conference on Learning Representations, 2017.
|
| 223 |
+
|
| 224 |
+
Johnson et al. Tiny imagenet visual recognition challenge. URL https://tiny-imagenet. herokuapp.com.
|
| 225 |
+
|
| 226 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Neural Information Processing Systems, 2012.
|
| 229 |
+
|
| 230 |
+
Volodymyr Kuleshov and Percy Liang. Calibrated structured prediction. Neural Information Processing Systems, 2015.
|
| 231 |
+
|
| 232 |
+
Vijay Kumar, Gustavo Carneiro, and Ian Reid. Learning local image descriptors with deep siamese and triplet convolutional networks by minimizing global loss functions. Computer Vision and Pattern Recognition, 2016.
|
| 233 |
+
|
| 234 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. International Conference on Learning Representations, 2018.
|
| 235 |
+
|
| 236 |
+
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. International Conference on Learning Representations, 2018.
|
| 237 |
+
|
| 238 |
+
Si Liu, Risheek Garrepalli, Thomas Dietterich, Alan Fern, and Dan Hendrycks. Open category detection with PAC guarantees. In Proceedings of International Conference on Machine Learning, 2018.
|
| 239 |
+
|
| 240 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts, 2017.
|
| 241 |
+
|
| 242 |
+
Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. arXiv preprint, 2018.
|
| 243 |
+
|
| 244 |
+
Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. Neural Information Processing Systems, 2018.
|
| 245 |
+
|
| 246 |
+
Chris Manning and Hinrich Schutze. ¨ Foundations of Statistical Natural Language Processing. MIT Press, 1999.
|
| 247 |
+
|
| 248 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. International Conference on Learning Representations, 2018a.
|
| 249 |
+
|
| 250 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An Analysis of Neural Language Modeling at Multiple Scales. arXiv preprint, 2018b.
|
| 251 |
+
|
| 252 |
+
Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? International Conference on Learning Representations, 2019.
|
| 253 |
+
|
| 254 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
|
| 255 |
+
|
| 256 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Computer Vision and Pattern Recognition, 2015.
|
| 257 |
+
|
| 258 |
+
Khanh Nguyen and Brendan O’Connor. Posterior calibration and exploratory analysis for natural language processing models. Empirical Methods in Natural Language Processing, 2015.
|
| 259 |
+
|
| 260 |
+
Joan Pastor-Pellicer, Francisco Zamora-Mart´ınez, Salvador Espana-Boquera, and Mar ˜ ´ıa Jose Castro- ´ Bleda. F-measure as the error function to train neural networks. In International Work-Conference on Artificial Neural Networks (IWANN), 2013.
|
| 261 |
+
|
| 262 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. International Conference on Machine Learning, 2016.
|
| 263 |
+
|
| 264 |
+
Alec Radford, Rafal Jozefowicz, and Ilya Sutskever. Learning to generate reviews and discovering sentiment. arXiv preprint, 2017.
|
| 265 |
+
|
| 266 |
+
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, 2015.
|
| 267 |
+
|
| 268 |
+
Ruslan Salakhutdinov, Joshua Tenenbaum, and Antonio Torralba. Learning to learn with compound hd models. In Neural Information Processing Systems, 2011.
|
| 269 |
+
|
| 270 |
+
Tim Salimans and Diederik Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. NIPS, 2016.
|
| 271 |
+
|
| 272 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, and Diederik P Kingma. PixelCNN $^ { + + }$ : Improving the PixelCNN with discretized logistic mixture likelihood and other modifications. International Conference on Learning Representations, 2017.
|
| 273 |
+
|
| 274 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Conference on Empirical Methods in Natural Language Processing, 2013.
|
| 275 |
+
|
| 276 |
+
Akshayvarun Subramanya, Suraj Srinivas, and R.Venkatesh Babu. Confidence estimation in deep neural networks via density modelling. arXiv preprint, 2017.
|
| 277 |
+
|
| 278 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Large scale fine-grained categorization and the effectiveness of domain-specific transfer learning. Yin Cui and Yang Song and Chen Sun and Andrew Howard and Serge Belongie, 2018.
|
| 279 |
+
|
| 280 |
+
Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. Pattern Analysis and Machine Intelligence, 2008.
|
| 281 |
+
|
| 282 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. LSUN: construction of a large-scale image dataset using deep learning with humans in the loop. CoRR, 2015.
|
| 283 |
+
|
| 284 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. British Machine Vision Conference, 2016.
|
| 285 |
+
|
| 286 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European Conference on Computer Vision. Springer, 2014.
|
| 287 |
+
|
| 288 |
+
Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. Pattern Analysis and Machine Intelligence, 2017.
|
| 289 |
+
|
| 290 |
+
Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Daeki Cho, and Haifeng Chen. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. International Conference on Learning Representations, 2018.
|
| 291 |
+
|
| 292 |
+
# A EXPANDED MULTICLASS RESULTS
|
| 293 |
+
|
| 294 |
+
Expanded mutliclass out-of-distribution detection results are in Table 7 and Table 8.
|
| 295 |
+
Table 7: Vision OOD example detection for the maximum softmax probability (MSP) baseline detector and the MSP detector after fine-tuning with Outlier Exposure (OE). All results are percentages and the result of 10 runs. Values are rounded so that $9 9 . 9 5 \%$ rounds to $1 0 0 \%$ . More results are in Appendix E.
|
| 296 |
+
|
| 297 |
+
<table><tr><td colspan="2"></td><td colspan="2">FPR95↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>Din</td><td>Dest</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td rowspan="11">NH∧S</td><td>Gaussian Bernoulli</td><td>5.4</td><td>0.0</td><td>98.2</td><td>100.</td><td>90.5</td><td>100.</td></tr><tr><td></td><td>4.4</td><td>0.0</td><td>98.6</td><td>100.</td><td>91.9</td><td>100.</td></tr><tr><td>Blobs</td><td>3.7</td><td>0.0</td><td>98.9</td><td>100.</td><td>93.5</td><td>100.</td></tr><tr><td>Icons-50</td><td>11.4</td><td>0.3</td><td>96.4</td><td>99.8</td><td>87.2</td><td>99.2</td></tr><tr><td>Textures</td><td>7.2</td><td>0.2</td><td>97.5</td><td>100.</td><td>90.9</td><td>99.7</td></tr><tr><td>Places365</td><td>5.6</td><td>0.1</td><td>98.1</td><td>100.</td><td>92.5</td><td>99.9</td></tr><tr><td>LSUN</td><td>6.4</td><td>0.1</td><td>97.8</td><td>100.</td><td>91.0</td><td>99.9</td></tr><tr><td>CIFAR-10</td><td>6.0</td><td>0.1</td><td>98.0</td><td>100.</td><td>91.2</td><td>99.9</td></tr><tr><td>Chars74K</td><td>6.4</td><td>0.1</td><td>97.9</td><td>100.</td><td>91.5</td><td>99.9</td></tr><tr><td>Mean</td><td>6.28</td><td>0.07</td><td>97.95</td><td>99.96</td><td>91.12</td><td>99.85</td></tr><tr><td rowspan="8">CIAAIII0</td><td>Gaussian</td><td>14.4</td><td>0.7</td><td>94.7</td><td>99.6</td><td>70.0</td><td>94.3</td></tr><tr><td>Rademacher</td><td>47.6</td><td>0.5</td><td>79.9</td><td>99.8</td><td>32.3</td><td>97.4</td></tr><tr><td>Blobs</td><td>16.2</td><td>0.6</td><td>94.5</td><td>99.8</td><td>73.7</td><td>98.9</td></tr><tr><td>Textures</td><td>42.8</td><td>12.2</td><td>88.4</td><td>97.7</td><td>58.4</td><td>91.0</td></tr><tr><td>SVHN</td><td>28.8</td><td>4.8</td><td>91.8</td><td>98.4</td><td>66.9</td><td>89.4</td></tr><tr><td>Places365</td><td>47.5</td><td>17.3</td><td>87.8</td><td>96.2</td><td>57.5</td><td>87.3</td></tr><tr><td>LSUN</td><td>38.7</td><td>12.1</td><td>89.1</td><td>97.6</td><td>58.6</td><td>89.4</td></tr><tr><td>CIFAR-100</td><td>43.5</td><td>28.0</td><td>87.9</td><td>93.3</td><td>55.8</td><td>76.2</td></tr><tr><td></td><td>Mean</td><td>34.94</td><td>9.50</td><td>89.27</td><td>97.81</td><td>59.16</td><td>90.48</td></tr><tr><td rowspan="11">CII-AIII0</td><td>Gaussian</td><td>54.3</td><td>12.1</td><td>64.7</td><td>95.7</td><td>19.7</td><td>71.1</td></tr><tr><td>Rademacher</td><td>39.0</td><td>17.1</td><td>79.4</td><td>93.0</td><td>30.1</td><td>56.9</td></tr><tr><td>Blobs</td><td>58.0</td><td>12.1</td><td>75.3</td><td>97.2</td><td>29.7</td><td>86.2</td></tr><tr><td>Textures</td><td>71.5</td><td>54.4</td><td>73.8</td><td>84.8</td><td>33.3</td><td>56.3</td></tr><tr><td>SVHN</td><td>69.3</td><td>42.9</td><td>71.4</td><td>86.9</td><td>30.7</td><td>52.9</td></tr><tr><td>Places365</td><td>70.4</td><td>49.8</td><td>74.2</td><td>86.5</td><td>33.8</td><td>57.9</td></tr><tr><td>LSUN</td><td>74.0</td><td>57.5</td><td>70.7</td><td>83.4</td><td>28.8</td><td>51.4</td></tr><tr><td>CIFAR-10</td><td>64.9</td><td>62.1</td><td>75.4</td><td>75.7</td><td>34.3</td><td>32.6</td></tr><tr><td>Mean</td><td>62.66</td><td>38.50</td><td>73.11</td><td>87.89</td><td>30.05</td><td>58.15</td></tr><tr><td>Gaussian</td><td>72.6</td><td>45.4</td><td>33.7</td><td>76.5</td><td>12.3</td><td>28.6</td></tr><tr><td rowspan="8">1hrree Gi</td><td>Rademacher</td><td>51.7</td><td>49.0</td><td>62.0</td><td>65.1</td><td>18.8</td><td>20.0</td></tr><tr><td>Blobs</td><td>79.4</td><td>0.0</td><td>48.2</td><td>100.</td><td>14.4</td><td>99.9</td></tr><tr><td>Textures</td><td>76.4</td><td>4.8</td><td>70.4</td><td>98.5</td><td>31.4</td><td>95.8</td></tr><tr><td>SVHN</td><td>52.3</td><td>0.4</td><td>80.8</td><td>99.8</td><td>42.8</td><td>98.2</td></tr><tr><td>Places365</td><td>63.6</td><td>0.4</td><td>76.9</td><td>99.8</td><td>36.3</td><td>99.3</td></tr><tr><td>LSUN</td><td>67.0</td><td>0.4</td><td>74.2</td><td>99.9</td><td>31.2</td><td>99.5</td></tr><tr><td>ImageNet</td><td>67.3</td><td>11.6</td><td>72.8</td><td>97.9</td><td>30.0</td><td>92.9</td></tr><tr><td>Mean</td><td>66.27</td><td>13.99</td><td>64.86</td><td>92.18</td><td>27.15</td><td>79.26</td></tr><tr><td rowspan="11">Psse55</td><td>Gaussian</td><td>37.1</td><td></td><td></td><td>93.5</td><td></td><td></td></tr><tr><td>Rademacher</td><td>60.4</td><td>9.4 13.5</td><td>72.2 47.7</td><td>90.2</td><td>23.5 14.6</td><td>54.1 44.9</td></tr><tr><td>Blobs</td><td>73.7</td><td>0.1</td><td>41.9</td><td>100.0</td><td>13.0</td><td>99.4</td></tr><tr><td>Icons-50</td><td>59.1</td><td>0.0</td><td>82.7</td><td>99.9</td><td>49.9</td><td>99.7</td></tr><tr><td>Textures</td><td>84.1</td><td></td><td>66.6</td><td>91.4</td><td>24.6</td><td>75.7</td></tr><tr><td></td><td></td><td>49.9</td><td></td><td></td><td></td><td></td></tr><tr><td>SVHN</td><td>19.9</td><td>0.0 65.3</td><td>96.6</td><td>100.0</td><td>90.5</td><td>99.9</td></tr><tr><td>ImageNet Places69</td><td></td><td>86.3 87.3</td><td>63.0</td><td>86.5</td><td>25.1</td><td>69.7</td></tr><tr><td></td><td></td><td>87.5</td><td>61.5</td><td>63.1</td><td>23.4</td><td>24.9</td></tr><tr><td>Mean</td><td></td><td>28.21</td><td>66.51</td><td>90.57</td><td>33.08</td><td>71.04</td></tr><tr><td></td><td>63.46</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 298 |
+
|
| 299 |
+
Table 8: NLP OOD example detection for the maximum softmax probability (MSP) baseline detector and the MSP detector after fine-tuning with Outlier Exposure (OE). All results are percentages and the result of 10 runs. Values are rounded so that $9 9 . 9 5 \%$ rounds to $1 0 0 \%$ .
|
| 300 |
+
|
| 301 |
+
<table><tr><td rowspan=2 colspan=4>FPR90↓ AUROC ↑ AUPR ↑Din Dtest MSP +OE MSP +OE MSP +OEout</td></tr><tr><td rowspan=1 colspan=1>MSP +OE</td><td rowspan=1 colspan=1>MSP +OE</td><td rowspan=1 colspan=1>MSP +OE</td></tr><tr><td rowspan=1 colspan=1>SNLI</td><td rowspan=1 colspan=1>38.2 12.5</td><td rowspan=1 colspan=1>87.7 95.1</td><td rowspan=1 colspan=1>71.3 86.3</td></tr><tr><td rowspan=1 colspan=1>IMDB</td><td rowspan=1 colspan=1>45.0 18.6</td><td rowspan=1 colspan=1>79.9 93.5</td><td rowspan=1 colspan=1>42.6 74.5</td></tr><tr><td rowspan=1 colspan=1>Multi30K</td><td rowspan=1 colspan=1>54.5 3.2</td><td rowspan=1 colspan=1>78.3 97.3</td><td rowspan=1 colspan=1>45.8 93.7</td></tr><tr><td rowspan=1 colspan=1>WMT16</td><td rowspan=1 colspan=1>45.8 2.0</td><td rowspan=1 colspan=1>80.2 98.8</td><td rowspan=1 colspan=1>43.7 96.1</td></tr><tr><td rowspan=1 colspan=1>Yelp</td><td rowspan=1 colspan=1>45.9 3.9</td><td rowspan=1 colspan=1>78.7 97.8</td><td rowspan=1 colspan=1>38.1 87.9</td></tr><tr><td rowspan=1 colspan=1>EWT-A</td><td rowspan=1 colspan=1>36.1 1.2</td><td rowspan=1 colspan=1>86.2 99.2</td><td rowspan=1 colspan=1>58.2 97.3</td></tr><tr><td rowspan=2 colspan=1>EWT-EEWT-N</td><td rowspan=1 colspan=1>31.9 1.4</td><td rowspan=1 colspan=1>87.8 99.2</td><td rowspan=1 colspan=1>60.3 97.2</td></tr><tr><td rowspan=1 colspan=1>41.7 1.8</td><td rowspan=1 colspan=1>83.1 98.7</td><td rowspan=1 colspan=1>46.2 95.7</td></tr><tr><td rowspan=1 colspan=1>EWT-R</td><td rowspan=1 colspan=1>40.7 1.7</td><td rowspan=1 colspan=1>83.5 98.9</td><td rowspan=1 colspan=1>53.4 96.6</td></tr><tr><td rowspan=1 colspan=1>EWT-W</td><td rowspan=1 colspan=1>44.5 2.4</td><td rowspan=1 colspan=1>81.1 98.5</td><td rowspan=1 colspan=1>39.0 93.8</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>42.44 4.86</td><td rowspan=1 colspan=1>82.66 97.71</td><td rowspan=1 colspan=1>49.85 91.91</td></tr><tr><td rowspan=1 colspan=1>SNLI</td><td rowspan=1 colspan=1>18.2 4.2</td><td rowspan=1 colspan=1>94.0 98.1</td><td rowspan=1 colspan=1>81.9 91.6</td></tr><tr><td rowspan=1 colspan=1>IMDB</td><td rowspan=1 colspan=1>49.6 0.6</td><td rowspan=1 colspan=1>78.0 99.4</td><td rowspan=1 colspan=1>44.2 97.8</td></tr><tr><td rowspan=3 colspan=1>Multi30KWMT16TTTE Yelp</td><td rowspan=1 colspan=1>44.2 0.3</td><td rowspan=1 colspan=1>81.6 99.7</td><td rowspan=1 colspan=1>44.9 99.0</td></tr><tr><td rowspan=1 colspan=1>50.7 0.2</td><td rowspan=1 colspan=1>78.2 99.8</td><td rowspan=1 colspan=1>42.2 99.4</td></tr><tr><td rowspan=1 colspan=1>50.9 0.4</td><td rowspan=1 colspan=1>75.1 99.7</td><td rowspan=1 colspan=1>37.7 96.1</td></tr><tr><td rowspan=5 colspan=1>TTTE EWT-AEWT-EEWT-NEWT-REWT-W</td><td rowspan=1 colspan=1>45.7 0.9</td><td rowspan=1 colspan=1>82.4 97.7</td><td rowspan=1 colspan=1>53.1 96.1</td></tr><tr><td rowspan=1 colspan=1>36.8 0.4</td><td rowspan=1 colspan=1>85.7 99.5</td><td rowspan=1 colspan=1>60.8 99.1</td></tr><tr><td rowspan=1 colspan=1>44.3 0.3</td><td rowspan=1 colspan=1>84.2 99.6</td><td rowspan=1 colspan=1>58.8 99.2</td></tr><tr><td rowspan=1 colspan=1>46.1 0.4</td><td rowspan=1 colspan=1>82.5 99.5</td><td rowspan=1 colspan=1>51.1 98.8</td></tr><tr><td rowspan=1 colspan=1>50.1 0.2</td><td rowspan=1 colspan=1>79.8 99.7</td><td rowspan=1 colspan=1>47.8 99.4</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>43.46 0.78</td><td rowspan=1 colspan=1>82.14 99.28</td><td rowspan=1 colspan=1>52.23 97.64</td></tr><tr><td rowspan=1 colspan=1>SNLI</td><td rowspan=1 colspan=1>57.3 33.4</td><td rowspan=1 colspan=1>75.7 86.8</td><td rowspan=1 colspan=1>36.2 52.0</td></tr><tr><td rowspan=1 colspan=1>IMDB</td><td rowspan=1 colspan=1>83.1 32.6</td><td rowspan=1 colspan=1>54.3 85.9</td><td rowspan=1 colspan=1>19.0 51.5</td></tr><tr><td rowspan=2 colspan=1>Multi30KWMT16</td><td rowspan=1 colspan=1>81.3 33.0</td><td rowspan=1 colspan=1>58.5 88.3</td><td rowspan=1 colspan=1>21.4 58.9</td></tr><tr><td rowspan=1 colspan=1>76.0 17.1</td><td rowspan=1 colspan=1>60.2 92.9</td><td rowspan=1 colspan=1>21.4 68.8</td></tr><tr><td rowspan=2 colspan=1>S YelpEWT-A</td><td rowspan=1 colspan=1>82.0 11.3</td><td rowspan=1 colspan=1>54.2 92.7</td><td rowspan=1 colspan=1>18.8 60.0</td></tr><tr><td rowspan=1 colspan=1>72.6 33.6</td><td rowspan=1 colspan=1>62.7 87.2</td><td rowspan=1 colspan=1>21.4 53.8</td></tr><tr><td rowspan=4 colspan=1>EWT-EEWT-NEWT-REWT-W</td><td rowspan=1 colspan=1>68.1 26.5</td><td rowspan=1 colspan=1>68.5 90.4</td><td rowspan=1 colspan=1>27.0 63.7</td></tr><tr><td rowspan=1 colspan=1>73.8 27.2</td><td rowspan=1 colspan=1>63.8 90.1</td><td rowspan=1 colspan=1>22.6 62.0</td></tr><tr><td rowspan=1 colspan=1>79.6 41.4</td><td rowspan=1 colspan=1>58.1 85.6</td><td rowspan=1 colspan=1>20.3 54.7</td></tr><tr><td rowspan=1 colspan=1>74.8 17.2</td><td rowspan=1 colspan=1>60.3 92.8</td><td rowspan=1 colspan=1>21.2 66.9</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>74.86 25.31</td><td rowspan=1 colspan=1>61.61 90.07</td><td rowspan=1 colspan=1>22.93 64.37</td></tr></table>
|
| 302 |
+
|
| 303 |
+
Anomalous Data. For each in-distribution dataset $\mathcal { D } _ { \mathrm { i n } }$ , we comprehensively evaluate OOD detectors on artificial and real anomalous distributions $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ following Hendrycks & Gimpel (2017). For each learned distribution $\mathcal { D } _ { \mathrm { i n } }$ , the number of test distributions that we compare against is approximately double that of most previous works.
|
| 304 |
+
|
| 305 |
+
Gaussian anomalies have each dimension i.i.d. sampled from an isotropic Gaussian distribution. Rademacher anomalies are images where each dimension is $- 1$ or 1 with equal probability, so each dimension is sampled from a symmetric Rademacher distribution. Bernoulli images have each pixel sampled from a Bernoulli distribution if the input range is [0, 1]. Blobs data consist in algorithmically generated amorphous shapes with definite edges. Icons- $5 0$ is a dataset of icons and emojis (Hendrycks & Dietterich, 2019); icons from the “Number” class are removed. Textures is a dataset of describable textural images (Cimpoi et al., 2014). Places365 consists in images for scene recognition rather than object recognition (Zhou et al., 2017). LSUN is another scene understanding dataset with fewer classes than Places365 (Yu et al., 2015). ImageNet anomalous examples are taken from the 800 ImageNet-1K classes disjoint from Tiny ImageNet’s 200 classes, and when possible each image is cropped with bounding box information as in Tiny ImageNet. For the Places365 experiment, ImageNet is ImageNet-1K with all 1000 classes. With CIFAR-10 as $\mathcal { D } _ { \mathrm { i n } }$ , we use also CIFAR-100 as $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ and vice versa; recall that the CIFAR-10 and CIFAR-100 classes do not overlap. Chars74K is a dataset of photographed characters in various styles; digits and letters such as “O” and “l” were removed since they can look like numbers. Places69 has images from 69 scene categories not found in the Places365 dataset.
|
| 306 |
+
|
| 307 |
+
SNLI is a dataset of predicates and hypotheses for natural language inference. We use the hypotheses for $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ . IMDB is a sentiment classification dataset of movie reviews, with similar statistics to those of SST. Multi30K is a dataset of English-German image descriptions, of which we use the English descriptions. WMT16 is the English portion of the test set from WMT16. Yelp is a dataset of restaurant reviews. English Web Treebank (EWT) consists of five individual datasets: Answers (A), Email (E), Newsgroups (N), Reviews (R), and Weblog (W). Each contains examples from the indicated domain.
|
| 308 |
+
|
| 309 |
+
Validation Data. For each experiment, we create a set of validation distributions $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { v a l } }$ . The first anomalies are uniform noise anomalies where each pixel is sampled from $\boldsymbol { \mathcal { U } } [ 0 , 1 ]$ or $\mathcal { U } [ - 1 , 1 ]$ depending on the input space of the classifier. The remaining $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { v a l } }$ validation sources are generated by corrupting in-distribution data, so that the data becomes out-of-distribution. One such source of anomalies is created by taking the pixelwise arithmetic mean of a random pair of in-distribution images. Other anomalies are created by taking the geometric mean of a random pair of in-distribution images. Jigsaw anomalies are created by taking an in-distribution example, partitioning the image into 16 equally sized patches, and permuting those patches. Speckle Noised anomalies are created by applying speckle noise to in-distribution images. RGB Ghosted anomalies involves shifting and reordering the color channels of in-distribution images. Inverted images are anomalies which have some or all of their color channels inverted.
|
| 310 |
+
|
| 311 |
+
# B ARCHITECTURES AND TRAINING DETAILS
|
| 312 |
+
|
| 313 |
+
For CIFAR-10, CIFAR-100, and Tiny ImageNet classification experiments, we use a 40-2 Wide Residual Network (Zagoruyko & Komodakis, 2016). The network trains for 100 epochs with a dropout rate of 0.3. The initial learning rate of 0.1 decays following a cosine learning rate schedule (Loshchilov & Hutter, 2017). During fine-tuning of the entire network, we again use a cosine learning rate schedule but with an initial learning rate of 0.001. We use standard flipping and data cropping augmentation, Nesterov momentum, and $\ell _ { 2 }$ weight decay with a coefficient of $\bar { 5 } \times 1 0 ^ { - 4 }$ . SVHN architectures are 16-4 Wide ResNets trained for 20 epochs with an initial learning rate of 0.01 and no data augmentation. For Places365, we use a ResNet-18 pre-trained on Places365. In this Places365 experiment, we tune with Outlier Exposure for 5 epochs, use 512 outlier samples per iteration, and start with a learning rate of 0.0001. Outlier Exposure fine-tuning occurs with each epoch being the length of in-distribution dataset epoch, so that Outlier Exposure completes quickly and does involve reading the entire $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { o E } }$ dataset.
|
| 314 |
+
|
| 315 |
+
# C TRAINING FROM SCRATCH WITH OUTLIER EXPOSURE USUALLY IMPROVES DETECTION PERFORMANCE
|
| 316 |
+
|
| 317 |
+
Elsewhere we show results for pre-trained networks that are fine-tuned with OE. However, a network trained from scratch which simultaneously trains with OE tends to give superior results. For example, a CIFAR-10 Wide ResNet trained normally obtains a classification error rate of $5 . 1 6 \%$ and an FPR95 of $3 4 . 9 4 \%$ . Fine-tuned, this network has an error rate of $5 . 2 7 \%$ and an FPR95 of $9 . 5 0 \%$ . Yet if we instead train the network from scratch and expose it to outliers as it trains, then the error rate is $4 . 2 6 \%$ and the FPR95 is $6 . 1 5 \%$ . This architecture corresponds to a $9 . 5 0 \%$ RMS calibration error with OE fine-tuning, but by training with OE from scratch the RMS calibration error is $6 . 1 5 \%$ . Compared to fine-tuning, training a network in tandem with OE tends to produce a network with a better error rate, calibration, and OOD detection performance. The reason why we use OE for fine-tuning is because training from scratch requires more time and sometimes more GPU memory than fine-tuning.
|
| 318 |
+
|
| 319 |
+
# D OE WORKS ON OTHER VISION ARCHITECTURES
|
| 320 |
+
|
| 321 |
+
Outlier Exposure also improves vision OOD detection performance for more than just Wide ResNets. Table 9 shows that Outlier Exposure also improves vision OOD detection performance for “All Convolutional Networks” (Salimans & Kingma, 2016).
|
| 322 |
+
|
| 323 |
+
<table><tr><td rowspan="2">Din</td><td colspan="2">FPR95↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR↑</td></tr><tr><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td>SVHN</td><td>6.84</td><td>0.08</td><td>98.1</td><td>100.0</td><td>90.9</td><td>99.8</td></tr><tr><td>CIFAR-10</td><td>28.4</td><td>14.0</td><td>90.1</td><td>96.7</td><td>58.9</td><td>87.3</td></tr><tr><td>CIFAR-100</td><td>57.5</td><td>43.3</td><td>76.7</td><td>85.3</td><td>33.9</td><td>51.3</td></tr><tr><td>Tiny ImageNet</td><td>75.5</td><td>25.0</td><td>55.4</td><td>82.9</td><td>25.6</td><td>75.3</td></tr></table>
|
| 324 |
+
|
| 325 |
+
Table 9: Results using an All Convolutional Network architectures. Results are percentages and an average of 10 runs.
|
| 326 |
+
|
| 327 |
+
# E OUTLIER EXPOSURE WITH $H ( \mathcal { U } ; p )$ SCORES DOES BETTER THAN WITH MSP SCORES
|
| 328 |
+
|
| 329 |
+
While − maxc $f _ { c } ( x )$ tends to be a discriminative OOD score for example $x$ , models with OE can do better by using $- \dot { H } ( \mathcal { U } ; f ( x ) )$ instead. This alternative accounts for classes with small probability mass rather than just the class with most mass. Additionally, the model with OE is trained to give anomalous examples a uniform posterior not just a lower MSP. This simple change roundly aids performance as shown in Table 10. This general performance improvement is most pronounced on datasets with many classes. For instance, when $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } } =$ Tiny ImageNet and $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } } =$ Gaussian, swapping the MSP score with the $H ( \mathcal { U } ; f ( x ) )$ score increases the AUROC $7 6 . 5 \%$ to $9 7 . 1 \%$ .
|
| 330 |
+
|
| 331 |
+
<table><tr><td rowspan="2">Din</td><td colspan="2">FPR95↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>MSP</td><td>H(U;p)</td><td>MSP</td><td>H(U;p)</td><td>MSP</td><td>H(U;p)</td></tr><tr><td>CIFAR-10</td><td>9.50</td><td>9.04</td><td>97.81</td><td>97.92</td><td>90.48</td><td>90.85</td></tr><tr><td>CIFAR-100</td><td>38.50</td><td>33.31</td><td>87.89</td><td>88.46</td><td>58.15</td><td>58.30</td></tr><tr><td>Tiny ImageNet</td><td>13.99</td><td>7.45</td><td>92.18</td><td>95.45</td><td>79.26</td><td>85.71</td></tr><tr><td>Places365</td><td>28.21</td><td>19.58</td><td>90.57</td><td>92.53</td><td>71.04</td><td>74.39</td></tr></table>
|
| 332 |
+
|
| 333 |
+
Table 10: Comparison between the maximum softmax probability (MSP) and $H ( \mathcal { U } ; p )$ OOD scoring methods on a network fine-tuned with OE. Results are percentages and an average of 10 runs. For example, CIFAR-10 results are averaged over “Gaussian,” “Rademacher,” . . ., or “CIFAR-100” measurements.
|
| 334 |
+
|
| 335 |
+
# F EXPANDED LANGUAGE MODELING RESULTS
|
| 336 |
+
|
| 337 |
+
Detailed OOD detection results with language modeling datasets are shown in Table 11.
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan="2">Din</td><td rowspan="2">Dest</td><td colspan="2">FPR90↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR↑</td></tr><tr><td>BPC</td><td>+OE</td><td>BPC</td><td>+OE</td><td>BPC</td><td>+OE</td></tr><tr><td rowspan="5">PTB Char</td><td>Answers</td><td>96.9</td><td>49.93</td><td>82.1</td><td>89.6</td><td>81.0</td><td>89.3</td></tr><tr><td>Email</td><td>99.5</td><td>90.64</td><td>80.6</td><td>88.6</td><td>79.4</td><td>89.1</td></tr><tr><td>Newsgroup</td><td>99.8</td><td>99.39</td><td>75.2</td><td>85.0</td><td>73.3</td><td>85.5</td></tr><tr><td>Reviews</td><td>99.0</td><td>74.64</td><td>80.8</td><td>89.0</td><td>79.2</td><td>89.6</td></tr><tr><td>Weblog</td><td>100.0</td><td>100.0</td><td>68.9</td><td>79.2</td><td>67.3</td><td>80.1</td></tr><tr><td colspan="2">Mean</td><td>99.0</td><td>89.4</td><td>77.5</td><td>86.3</td><td>76.0</td><td>86.7</td></tr><tr><td rowspan="5">PTB Word</td><td>Answers</td><td>41.4</td><td>3.65</td><td>81.4</td><td>98.0</td><td>40.5</td><td>94.7</td></tr><tr><td>Email</td><td>64.9</td><td>0.17</td><td>78.1</td><td>99.6</td><td>44.5</td><td>98.9</td></tr><tr><td>Newsgroup</td><td>54.9</td><td>0.17</td><td>77.8</td><td>99.5</td><td>39.8</td><td>98.3</td></tr><tr><td>Reviews</td><td>30.5</td><td>0.85</td><td>88.0</td><td>98.9</td><td>53.6</td><td>96.8</td></tr><tr><td>Weblog</td><td>50.8</td><td>0.08</td><td>80.7</td><td>99.9</td><td>41.5</td><td>99.7</td></tr><tr><td colspan="2">Mean</td><td>48.5</td><td>0.98</td><td>81.2</td><td>99.2</td><td>44.0</td><td>97.8</td></tr></table>
|
| 340 |
+
|
| 341 |
+
Table 11: OOD detection results on Penn Treebank examples and English Web Treebank outliers. All results are percentages.
|
| 342 |
+
|
| 343 |
+
The $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets come from the English Web Treebank (Bies et al., 2012), which contains text from five different domains: Yahoo! Answers, emails, newsgroups, product reviews, and weblogs. Other
|
| 344 |
+
|
| 345 |
+
NLP $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ datasets we consider do not satisfy the language modeling assumption of continuity in the examples, so we do not evaluate on them.
|
| 346 |
+
|
| 347 |
+
# G CONFIDENCE CALIBRATION
|
| 348 |
+
|
| 349 |
+
Models integrated into a decision making process should indicate when they are trustworthy, and such models should not have inordinate confidence in their predictions. In an effort to combat a false sense of certainty from overconfident models, we aim to calibrate model confidence. A model is calibrated if its predicted probabilities match empirical frequencies. Thus if a calibrated model predicts an event with $30 \%$ probability, then $30 \%$ of the time the event transpires. Prior research (Guo et al., 2017; Nguyen & O’Connor, 2015; Kuleshov & Liang, 2015) considers calibrating systems where test-time queries are samples from $\mathcal { D } _ { \mathrm { i n } }$ , but systems also encounter samples from Dtest and should also ascribe low confidence to these samples. Hence, we use OE to control the confidence on these samples.
|
| 350 |
+
|
| 351 |
+
# G.1 METRICS
|
| 352 |
+
|
| 353 |
+
In order to evaluate a multiclass classifier’s calibration, we present three metrics. First we establish context. For input example $X \in \mathcal { X }$ , let $Y \in \mathcal { Y } \overset { } { = } \{ 1 , 2 , \ldots , k \}$ be the ground truth class. Let $\widehat { Y }$ be the model’s class prediction, and let $C$ be the corresponding model confidence or prediction probability. Denote the set of prediction-label pairs made by the model with $S = \{ ( \widehat { y } _ { 1 } , \widehat { c } _ { 1 } ) , ( \widehat { y } _ { 2 } , \widehat { c _ { 2 } } ) , \ldots , ( \widehat { y } _ { n } , c _ { n } ) \}$ .
|
| 354 |
+
|
| 355 |
+
RMS and MAD Calibration Error. The Root Mean Square Calibration Error measures the square root of the expected squared difference between confidence and accuracy at a confidence level. It has the formula $\sqrt { \mathbb { E } _ { C } [ ( \mathbb { P } ( Y = \widehat { Y } | C = c ) - c ) ^ { 2 } ] }$ . A similar formulation which less severely penalizes large confidence-accuracy deviations is the Mean Absolute Value Calibration error, written $\mathbf { \dot { \mathbb { E } } } _ { C } [ | \mathbb { P } ( Y = \mathbf { \overline { { Y } } } | C = c ) - c | ]$ . The MAD Calibration Error is a lower bound of the RMS Calibration Error. To empirically estimate these miscalibration measures, we partition the $n$ samples of $S$ into $b$ bins $\{ B _ { 1 } , \bar { B } _ { 2 } , \dots , \bar { B } _ { b } \}$ with approximately 100 samples in each bin. Unlike Guo et al. (2017), bins are not equally spaced since the distribution of confidence values is not uniform but dynamic. Concretely, the RMS Calibration Error is estimated with the numerically stable formula
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\sqrt { \sum _ { i = 1 } ^ { b } \frac { | B _ { i } | } { n } \biggl ( \frac { 1 } { | B _ { i } | } \sum _ { k \in B _ { i } } \mathbb { 1 } \bigl ( y _ { k } = \widehat { y } _ { k } \bigr ) - \frac { 1 } { | B _ { i } | } \sum _ { k \in B _ { i } } c _ { k } \biggr ) ^ { 2 } } .
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Along similar lines, the MAD Calibration Error—which is an improper scoring rule due to its use of absolute differences rather than squared differences—is estimated with
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\sum _ { i = 1 } ^ { b } \frac { | B _ { i } | } { n } \bigg | \frac { 1 } { | B _ { i } | } \sum _ { k \in B _ { i } } \mathbb { 1 } ( y _ { k } = \widehat { y } _ { k } ) - \frac { 1 } { | B _ { i } | } \sum _ { k \in B _ { i } } c _ { k } \bigg | .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Soft F1 Score. If a classifier makes only a few mistakes, then most examples should have high confidence. But if the classifier gives all predictions high confidence, including its mistakes, then the previous metrics will indicate that the model is calibrated on the vast majority of instances, despite having systematic miscalibration. The Soft F1 score (Pastor-Pellicer et al., 2013; Hendrycks & Gimpel, 2017) is suited for measuring the calibration of a system where there is an acute imbalance between mistaken and correct decisions. Since we treat mistakes a positive examples, we can write the model’s confidence that the examples are anomalous with $c _ { a } = ( 1 - c _ { 1 } , 1 - c _ { 2 } , \ldots , 1 - c _ { n } )$ . To indicate that an example is positive (mistaken), we use the vector $m \in \{ 0 , 1 \} ^ { n }$ such that $m _ { i } =$ $\mathbb { 1 } ( y _ { i } \neq \widehat { y _ { i } } )$ for $1 \leq i \leq n$ . Then the Soft F1 score is
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
{ \frac { c _ { a } ^ { \mathsf { T } } m } { 1 ^ { \mathsf { T } } ( c _ { a } + m ) / 2 } } .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Table 12: Calibration results for the temperature tuned baseline and temperature tuning $+ \mathrm { O E }$ .
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan="2">Din</td><td>RMS Calib.</td><td>Error↓</td><td>MAD Calib.</td><td>Error↓</td><td>Soft F1 Score ↑</td></tr><tr><td>Temperature</td><td>+OE</td><td>Temperature</td><td>+OE</td><td>Temperature +OE</td></tr><tr><td>SVHN</td><td>22.3</td><td>4.8</td><td>10.9</td><td>2.4</td><td>52.1 87.9</td></tr><tr><td>CIFAR-10</td><td>19.4</td><td>9.3</td><td>12.6</td><td>5.6</td><td>39.9 69.7</td></tr><tr><td>CIFAR-100</td><td>14.7</td><td>8.2</td><td>11.3</td><td>6.5</td><td>52.8 65.8</td></tr><tr><td>Tiny ImageNet</td><td>12.0</td><td>6.9</td><td>9.0</td><td>4.8</td><td>62.9 72.2</td></tr></table>
|
| 376 |
+
|
| 377 |
+
# G.2 SETUP AND RESULTS
|
| 378 |
+
|
| 379 |
+
There are many ways to estimate a classifier’s confidence. One way is to bind a logistic regression branch onto the network, so that confidence values are in $[ 0 , 1 ]$ . Other confidence estimates use the model’s logits $l \in \mathbb { R } ^ { k }$ , such as the estimate $\sigma ( \operatorname* { m a x } _ { i } l _ { i } ) \ \bar { \in } \ [ 0 , 1 ]$ , where $\sigma$ is the logistic sigmoid. Another common confidence estimate is $\begin{array} { r } { \operatorname* { n a x } _ { i } \left[ \exp { ( l _ { i } ) } / \sum _ { j = 1 } ^ { k } \exp { ( l _ { j } ) } \right] } \end{array}$ . A modification of this estimate is our baseline.
|
| 380 |
+
|
| 381 |
+
Softmax Temperature Tuning. Guo et al. (2017) show that good calibration can be obtained by including a tuned temperature parameter into the softmax: $\begin{array} { r } { \exp ( l _ { i } / T ) / \sum _ { j = 1 } ^ { k } \exp ( l _ { j } / T ) } \end{array}$ . We tune $T$ bto maximize log likelihood on a validation set after the $ \widehat { p } ( y ~ = ~ i ~ | ~ x \rangle ~ =$
|
| 382 |
+
|
| 383 |
+
Results. In this calibration experiment, the baseline is confidence estimation with softmax temperature tuning. Therefore, we train SVHN, CIFAR-10, CIFAR-100, and Tiny ImageNet classifiers with 5000, 5000, 5000, and 10000 training examples held out, respectively. A copy of this classifier is fine-tuned with Outlier Exposure. Then we determine the optimal temperatures of the original and OE-fine-tuned classifiers on the held-out exampwe take equally many examples from a given in-distribution dataset $\mathcal { D } _ { \mathrm { i n } } ^ { \mathrm { t e s t } }$ To measure calibrand OOD dataset $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ Out-of-distribution points are understood to be incorrectly classified since their label is not in the model’s output space, so calibrated models should assign these out-of-distribution points low confidence. Results are in Table 12. Outlier Exposure noticeably improves model calibration.
|
| 384 |
+
|
| 385 |
+
# G.3 POSTERIOR RESCALING
|
| 386 |
+
|
| 387 |
+
While temperature tuning improves calibration, the confidence estimate ${ \widehat { p } } ( y = i \mid x )$ cannot be less than $1 / k$ , $k$ bthe number of classes. For an out-of-distribution example like Gaussian Noise, a good model should have no confidence in its prediction over $k$ classes. One possibility is to add a reject option, or a $( k + 1 ) \mathrm { s t }$ class, which we cover in Section 5. A simpler option we found is to perform an affine transformation of $\widehat { p } ( y = i \mid x ) \in [ 1 / k , 1 ]$ with the formula $( \widehat { p } ( \bar { y } = i \mid x ) - 1 / k ) / ( \bar { 1 } - 1 / k ) \in$ $[ 0 , 1 ]$ b b. This simple transformation makes it possible for a network to express no confidence on an out-of-distribution input and improves calibration performance. As Table 13 shows, this simple 0-1 posterior rescaling technique consistently improves calibration, and the model fine-tuned with OE using temperature tuning and posterior rescaling achieved large calibration improvements.
|
| 388 |
+
|
| 389 |
+
<table><tr><td></td><td colspan="3">RMS Calib.Error↓</td><td colspan="3">MAD Calib. Error↓</td><td colspan="3">Soft F1 Score ↑</td></tr><tr><td>Din</td><td>Temp</td><td colspan="2">+Rescale+OE</td><td>Temp</td><td colspan="2">+Rescale+OE</td><td>Temp</td><td colspan="2">+Rescale+OE</td></tr><tr><td>SVHN</td><td>22.3</td><td>20.8</td><td>3.0</td><td>10.9</td><td>10.1</td><td>1.0</td><td>52.1</td><td>56.1</td><td>92.7</td></tr><tr><td>CIFAR-10</td><td>19.4</td><td>17.8</td><td>6.7</td><td>12.6</td><td>11.7</td><td>4.1</td><td>39.9</td><td>42.8</td><td>73.9</td></tr><tr><td>CIFAR-100</td><td>14.7</td><td>14.4</td><td>8.1</td><td>11.3</td><td>11.1</td><td>6.4</td><td>52.8</td><td>53.1</td><td>66.1</td></tr><tr><td>Tiny ImageNet</td><td>12.0</td><td>11.9</td><td>6.9</td><td>9.0</td><td>8.8</td><td>4.8</td><td>62.9</td><td>63.1</td><td>72.3</td></tr></table>
|
| 390 |
+
|
| 391 |
+
Table 13: Calibration results for the softmax temperature tuning baseline, the same baseline after adding Posterior Rescaling, and temperature tuning $^ +$ Posterior Rescaling $+ \mathrm { O E }$ .
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 4: ROC curves with Tiny ImageNet as $\mathcal { D } _ { \mathrm { i n } }$ and Textures, Places365, LSUN, and ImageNet as $\mathcal { D } _ { \mathrm { o u t } } ^ { \mathrm { t e s t } }$ . Figures show the curves corresponding to the maximum softmax probability (MSP) baseline detector and the MSP detector with Outlier Exposure (OE).
|
| 395 |
+
|
| 396 |
+
In Figure 4, we show additional PR and ROC Curves using the Tiny ImageNet dataset and various anomalous distributions.
|
md/train/IpmfpAGoH2KbX/IpmfpAGoH2KbX.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep learning and the renormalization group
|
| 2 |
+
|
| 3 |
+
# Cedric B ´ eny ´
|
| 4 |
+
|
| 5 |
+
Institut fur Theoretische Physik ¨ Leibniz Universitat Hannover ¨ Appelstraße 2, 30167 Hannover, Germany cedric.beny@gmail.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Renormalization group (RG) methods, which model the way in which the effective behavior of a system depends on the scale at which it is observed, are key to modern condensed-matter theory and particle physics. We compare the ideas behind the RG on the one hand and deep machine learning on the other, where depth and scale play a similar role. In order to illustrate this connection, we review a recent numerical method based on the RG—the multiscale entanglement renormalization ansatz (MERA)—and show how it can be converted into a learning algorithm based on a generative hierarchical Bayesian network model. Under the assumption—common in physics—that the distribution to be learned is fully characterized by local correlations, this algorithm involves only explicit evaluation of probabilities, hence doing away with sampling.
|
| 10 |
+
|
| 11 |
+
Natural sciences extend the process by which we intuitively discover patterns in our sensory data to domains beyond our natural sensory abilities, but also beyond our intuitive reasoning abilities. Already, machine learning methods are becoming important in fields where the patterns are too complex to be modeled with simple equations, and too far removed from intuition to be comprehended without formal tools.
|
| 12 |
+
|
| 13 |
+
Physics may seem an unlikely candidate for application of machine learning, given that it specifically focuses on systems which can be understood with simple laws. Nevertheless, these very compact laws have to be compared to experiments, and hence require a “decompression” process which rapidly leads to overwhelming levels of complexity.
|
| 14 |
+
|
| 15 |
+
The renormalization group (RG) was designed to handle some of these complexities and had a tremendous influence in particle physics and condensed-matter physics [1]. It models the dependence of a system’s effective behavior on a parameter which is usually thought of as scale or energy, but which we will think of here as depth. Although the RG idea is not recent, new approaches have emerged which have the potential to fully automatize it [2–5]. These methods are designed for simulation rather than learning, but, because they are defined through clever representations of certain classes of (quantum) states, they can be adapted to learning tasks as well [6, 7].
|
| 16 |
+
|
| 17 |
+
In this paper, I will explain how one of these methods (the multiscale entanglement renormalization ansatz [8]) can be made into a deep learning algorithm for classical probability distributions, assuming no prior knowledge of RG or MERA, nor of quantum mechanics. The machine learning framework task that I am considering is that of building a representation of a probability distribution which optimizes the likelihood of the training data.
|
| 18 |
+
|
| 19 |
+
# 1 The renormalization group
|
| 20 |
+
|
| 21 |
+
Let us take the point of view of condensed matter physics, where the system of interest is a $d$ - dimensional lattice which we think of as a graph $\Gamma$ which could be embedded in $\mathbb { R } ^ { d }$ in such a way that the edges loosely indicate proximity of sites. Hence we can think of it as a discrete version of a $d$ -dimensional space. We take the graph as fixed once and for all, but we associate with each vertex $v$ , which we call a site, a random variable $X _ { v }$ which can take any of $n$ possible values. The joint probability distribution for all these variables will be referred to as the lattice’s state, and is the object that we want to model.
|
| 22 |
+
|
| 23 |
+
In the context of machine learning, an example would be a probability distribution over images. In this example, the dimension is $d = 2$ , the sites are pixels linked to their four neighbors, and the random variables are the pixels color values.
|
| 24 |
+
|
| 25 |
+
Physicists are often interested in such system at thermal equilibrium, where the state can be encoded in a ridiculously compact way through the system’s Hamiltonian, or energy function, which is proportional to the logarithm of the probability distribution. What makes this description compact is that the Hamiltonian is usually a sum of local functions, i.e., functions which depend only on a little group of neighboring sites. Hence, the state is a Markov random field with respect to the graph $\Gamma$ .
|
| 26 |
+
|
| 27 |
+
However, deducing any property of the state from the Hamiltonian (such as marginal probabilities) is generally very difficult. In fact, the large majority of the work done in theoretical physics is purely concerned with doing just that: deriving approximate properties of systems whose state is defined by a given Hamiltonian, i.e., decompressing the Hamiltonian description, so that predictions can be compared to experiments. In this sense, the Hamiltonian, although it is a compact representation of the state, is not very useful as a representation of what one knows about the system’s properties.
|
| 28 |
+
|
| 29 |
+
A Hamiltonian is not, however, entirely useless. Given a Hamiltonian, it is relatively easy to make predictions about short-range correlations. For instance, by sampling the distribution using a MonteCarlo simulation. However, the computational cost grows exponentially with the range of the correlations.
|
| 30 |
+
|
| 31 |
+
The RG approach is based on the observation that longer range correlations can often be summarized by an effective Hamiltonian on a smaller array of coarse-grained random variables which are, for instance, averages of neighboring sites. That is, one can build a stochastic map from the state of the system to that of coarser array of new variables in such a way that the new state can also be described by a local Hamiltonian. This process can be iterated, leading to a hierarchy of effective Hamiltonians labeled by a scale. This family, if it could be computed, would provide an efficient encoding of the system’s behavior at all scales.
|
| 32 |
+
|
| 33 |
+
The actual choice of “binning”, i.e., the form of the stochastic maps which implement the coarsegrainings, is an essential element of the process, as it selects the proper, emergent, order parameters which contain non-trivial information about the large-scale properties of the system. One may think of these local order parameters as higher-order concepts needed to understand the full state. Typically, the only variables left at the largest scale are the thermodynamic variables which are averages over the whole system. If the coarse-graining procedure is chosen correctly, those variables should identify in which thermodynamic phase the system finds itself.
|
| 34 |
+
|
| 35 |
+
This hierarchical scale-by-scale encoding of a probability distribution resembles, for instance, a deep encoding of an image whose features are defined by iteratively combining locale patterns into more complex—and larger—patterns. Where this analogy fails, however, is that the distribution to be learned in the context of image recognition is likely not generated by a local Hamiltonian. Nevertheless, we may still think of a local Hamiltonian which appropriately reproduces the shortrange correlations within neighboring pixels. For instance, this Hamiltonian could assign higher probabilities to edge filters. The edge orientations themselves may then be the next coarser variables governed by their own effective Hamiltonian which prefers certain assembly of neighboring edges, and so on until, at the deepest level, the only variables left encodes what the whole image represents, with an effective Hamiltonian yielding the relative frequency of the different classes in the learning data.
|
| 36 |
+
|
| 37 |
+
The renormalization “group” denotes the set of coarse-graining operations with composition as group operation, although it is rarely a group given that its elements typically have no inverse, and cannot all be composed together. It is more fruitful to think of it as a flow on the “manifold” of Hamiltonians (assuming a continuum of scales), where each possible Hamiltonian flows toward its effective version at larger and larger scales. This picture, however, relies on the Hamiltonian uniquely defining the state, and must be given up if we trust the Hamiltonians to encode only the short-range correlations.
|
| 38 |
+
|
| 39 |
+
The previous discussion is rather idealized, as a lot of work is needed to transform these ideas into concrete methods. This is why most techniques classified under the umbrella of RG are very modelspecific and hence of little use for us.
|
| 40 |
+
|
| 41 |
+
However, the study of quantum phase transitions (i.e. phase transitions at zero temperatures, where all fluctuations are quantum instead of thermal) has motivated the appearance of much more generic numerical methods based on an ansatz, i.e., a parameterization of a manageably small set of states which happen to nearly contain many of the interesting physical states. For instance, the very successful density-matrix renormalization group (DMRG) can be understood as an optimization method within the matrix product state (MPS) ansatz. Classically, an MPS can be thought of as a type of stochastic finite-state machine (although another classical version has been proposed [9]). This, however, only works on one-dimensional systems, at least in the quantum setting. In addition, the connection with the RG is somewhat weak (even though it is faithful to a proposal made in the seminal paper by Wilson on the renormalization group [1]).
|
| 42 |
+
|
| 43 |
+
Here, we will consider instead a more recent proposal which can be formulated in any dimension, and which more directly incorporates the idea of a multiscale description of the system.
|
| 44 |
+
|
| 45 |
+
# 2 Stochastic version of MERA
|
| 46 |
+
|
| 47 |
+
The multiscale entanglement renormalization ansatz (MERA) is an efficient parametrization of a certain subset of quantum states (which one may think of as probability distributions but where the probabilities take complex values). It is numerically efficient in two ways which are important for its use in physics. Firstly, the number of parameters involved typically grows linearly with the number $N$ of sites. Secondly, marginal distributions over a constant number of sites (not necessarily contiguous) can be explicitly computed in a time of order $\log N$ .
|
| 48 |
+
|
| 49 |
+
Instead of describing the full quantum MERA, I will only introduce a classical version of it. Since all entanglement (a.k.a. quantum correlations) is replaced by classical correlations, let us call it the correlation renormalization ansatz (CORA).
|
| 50 |
+
|
| 51 |
+
For simplicity, I will describe the model as it would apply to data living on a square $d$ -dimensional lattice, such as a time series for $d = 1$ or an image for $d = 2$ , and assume a renormalization model where the coarse-graining is done by grouping blocks of $2 \times 2 \times . . . = 2 ^ { d }$ neighboring sites. Generalization to other lattices or other coarse-graining scheme are rather straightforward.
|
| 52 |
+
|
| 53 |
+
Instead of starting with an algorithm per se, we start with a “knowledge representation”, that is, a parameterization of a certain set of probability distributions on the observed data. Provided that this parameterization can be stored efficiently, and that the cost function for the learning process be computable efficiently, then an algorithm can be devised to minimize the cost function.
|
| 54 |
+
|
| 55 |
+
We call $\Gamma _ { 0 }$ the original square lattice on which the data lives, and $\Gamma _ { j }$ , $j = 1 , 2 , \dots$ the successive coarse-graining of that lattice. Each site of $\Gamma _ { j }$ must be thought of as representing a block of $2 ^ { d }$ sites of $\Gamma _ { j - 1 }$ , in the sense that the neighborhood relations between the sites of $\Gamma _ { j }$ represent that of the corresponding blocks on $\Gamma _ { j - 1 }$ .
|
| 56 |
+
|
| 57 |
+
Since the number of sites of $\Gamma _ { j }$ is a constant fraction of that of $\Gamma _ { j - 1 }$ $( 1 / 2 ^ { d }$ in this case), the total number of coarse-graining steps is logarithmic in the total size $N$ of $\Gamma _ { 0 }$ , i.e. in the total number of variables.
|
| 58 |
+
|
| 59 |
+
By a state on $\Gamma _ { j }$ , we refer to a joint probability distribution for the values of the variables associated with each site of $\Gamma _ { j }$ . We denote the set of these distributions by $S ( \Gamma _ { j } )$ . The idea is to represent a state $\mu \in S ( \Gamma _ { 0 } )$ through a sequence of stochastic maps
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\pi _ { j } : S ( \Gamma _ { j } ) \to S ( \Gamma _ { j - 1 } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mu = \pi _ { 1 } \circ \pi _ { 2 } \circ \ldots \circ \pi _ { j _ { \mathrm { m a x } } } ( e ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\circ$ denotes composition, and $e$ is some fiducial state on the coarsest lattice $\Gamma _ { j _ { \mathrm { m a x } } }$ , e.g., the uniform distribution. In the original MERA, these maps $\pi _ { j }$ are isometric operator on a Hilbert space, which is the quantum equivalent of stochastic maps, in the sense that they are the most general maps preserving the basic properties of the states.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Example of a MERA for a one-dimensional lattice, where only two layers are represented. The boxes and triangles are arbitrary isometric maps between Hilbert spaces represented by the vertical lines. We obtain a CORA by replacing the boxes and triangles by stochastic maps between random variables. This diagram can then be read as an operational recipe to produce the state on the lattice $\Gamma _ { 0 }$ , from that of $\Gamma _ { 2 }$ : each vertical line represents some data, or random variable, and a box or triangle is a specific stochastic map which must be applied to the joint probability distribution of all its input(s) (the lines coming in from above) in order to produce the joint distribution of its outputs (represented by the lines coming out below it). This can be equivalently represented by the Bayesian network of Figure 2. The parameters of the model are the components of all the local stochastic maps (boxes and triangles), together with the initial state of the last layer $\Gamma _ { j _ { \mathrm { m a x } } }$ .
|
| 73 |
+
|
| 74 |
+
One may think of these $\pi _ { j }$ as the inverse of the coarse-graining channels defining the renormalization group. Indeed, instead of destroying information by mapping a precise lattice to a coarser one with fewer sites, it introduces information by creating additional sites, hence constructing the full state scale by scale. In this sense, MERA is a “generative” interpretation of the RG.
|
| 75 |
+
|
| 76 |
+
In the original MERA, these maps are specifically required to be implementable by local maps (stochastic maps in the classical case or isometries in the quantum case), such as represented in Figures 1 and 2 for a one-dimensional lattice. Such a given structure being fixed, the variational parameters left to be learned are the components of each local map.
|
| 77 |
+
|
| 78 |
+
The required decomposability of the maps $\pi _ { j }$ into local operations renders the number of variational parameters linear in the lattice size. Apart from this, however, the particular way in which the local maps are combined is not essential, except for the causal properties of the complete maps $\pi _ { j }$ allowed: Firstly, $\pi _ { j } : S ( \Gamma _ { j } ) \to S ( \Gamma _ { j - 1 } )$ must be such that, through it, each site of $\Gamma _ { j }$ can only causally influence the block of sites of $\Gamma _ { j - 1 }$ that it represents, or their neighbors as well, up to a constant distance. In Figure 1 for instance, it is apparent that a given site can only influence the values of the block of two sites that it represents, immediately below it, together with their nearest neighbors.
|
| 79 |
+
|
| 80 |
+
The concept of causality that is used is defined as follows: for a given stochastic matrix with several input and output variables, we say that the $i$ th input cannot causally influence the $j$ th output if the variable $i$ is not required for the calculation of the marginal over $j$ , no matter what the complete input is. That is, the marginal over $j$ can be computed purely from the marginal over all original input variables but the ith.
|
| 81 |
+
|
| 82 |
+
Secondly, something which is also apparent in Figure 1, is the fact that $\pi _ { j }$ cannot introduce any correlations between far-away sites if its input is uncorrelated, where “far-away” means that these output sites cannot be influenced by the same input site, in terms of the first causality condition.
|
| 83 |
+
|
| 84 |
+
It is in this sense that each layer $\pi _ { j }$ can only create, and therefore represent, correlations at a given scale.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Example of Figure 1 represented as a Bayesian network (only two layers are represented). The bottom nodes are observed. Note that the graph is truncated, as the nodes of $\Gamma _ { 2 }$ must be linked to the next layer which is not represented, as well as to each other, in the same manner as the two layers below it.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 3: Stochastic maps involved in the last two steps of the computation of the marginal state on 3 consecutive output sites. The lines ending abruptly indicates that the corresponding variable is summed over. The “past” of any region of $\Gamma _ { 0 }$ of size $L$ always involves just 3 sites before level Γ[log2(L)].
|
| 91 |
+
|
| 92 |
+
# 3 Learning CORA
|
| 93 |
+
|
| 94 |
+
The causal properties inherent in the definition of MERA/CORA imply that a marginal over any finite group of $L$ sites can be computed (explicitly, i.e., without sampling) in a time of order $e ^ { L } \log ( N )$ . Indeed, due to the particular causal structure of the maps $\pi _ { j }$ , the past of any set of sites of $\Gamma _ { j }$ , namely those sites of $\Gamma _ { j + 1 }$ on which their values depend explicitly through $\pi _ { j }$ , always ends up involving a constant number of sites independent of $N$ (and generally manageably small). This is illustrated in Figure 3.
|
| 95 |
+
|
| 96 |
+
In the quantum physical setting for which MERA was introduced, the state that we want to represent is not defined by samples, but instead by a Hamiltonian, or energy function, that it minimizes, i.e., the cost function itself. Most often, the Hamiltonians considered are local, which implies that the evaluation of their expectation only requires the use of marginal states over small clusters of neighboring sites. Therefore the cost function can be evaluated efficiently and exactly.
|
| 97 |
+
|
| 98 |
+
Such a procedure can be adapted to a situation where, instead of being handed the Hamiltonian, we are given samples from the unknown distribution: the training data. In physics, this situation presents itself when an experimentalists wants to reconstruct a state that he has access to only through experiments (which yields the samples), a process which is called “state tomography”. This is, of course, no different from a typical learning task.
|
| 99 |
+
|
| 100 |
+
A difference, however, is that in physics one is often interested in states which minimize some unknown local Hamiltonian. This assumptions implies that it is sufficient to work with the efficiently computable marginals over small groups of neighboring sites (so called reduced states in quantum theory). Therefore, we can set the parameters of the channels $\pi _ { j }$ by maximizing the probabilities that these reduced states assign to the training data. In the quantum context, this was proposed in Ref. [7]. For CORA, the cost function can be calculated in the same way, but the optimization procedure must be slightly modified to account for the fact that the constraints on the stochastic maps components are different from the quantum MERA.
|
| 101 |
+
|
| 102 |
+
# 3.1 States not determined by local laws
|
| 103 |
+
|
| 104 |
+
It is clear, however, that a MERA, or CORA, can represent a much vaster class of states, in particular states whose long-range correlation structure is not determined by the nature of the short range correlations, such as one would expect for natural or artificial images for instance. Indeed, the components of the stochastic maps $\pi _ { j }$ can be modified directly at any scale $j$ with minimal effect on the short range correlations.
|
| 105 |
+
|
| 106 |
+
Let us therefore consider learning in the more general situation. Mirroring our discussion of section 1, we can still use the efficiently computable local reduced states in order to optimize the component of the first channel $\pi _ { 1 }$ , since it cannot anyway encode information about longer ranged correlations. We say that we are working with training length $\epsilon _ { \mathrm { 0 } }$ , ignoring all correlations in the data at larger lengthscales.
|
| 107 |
+
|
| 108 |
+
This can be done in two different ways. We may simply optimize $\pi _ { 1 }$ by locally comparing the training data to $\pi _ { 1 } ( e )$ where $e$ is the uniform distribution, or any other prior (method 1), or we can already optimize all layers simultaneously as would be done for a tomography problem, focusing only on short-range correlation (method 2). This would have the advantage of already making long range—or deep—deductions from the data. For instance, if all neighboring pixels were the same color, this would already deduce that the whole image is uniform.
|
| 109 |
+
|
| 110 |
+
In a second pass, we need to compare the data to marginals generated over the new training length $\epsilon _ { 1 }$ associated with the next channel $\pi _ { 2 }$ . We do not want to do this by comparing the data to the full candidate state generated at the level of $\Gamma _ { 0 }$ , as the number of sites involved would grow by a factor $2 ^ { d }$ with a bad exponential increase in complexity. Instead, we want to directly compare the reduced state at level $\Gamma _ { 1 }$ to a coarse-grained (i.e., “renormalized”) version of the training data at that level.
|
| 111 |
+
|
| 112 |
+
Performing this step is where the difficulties lie, and could likely not be done quantum mechanically. Classically, however, it may be possible to use sampling in this step. This coarse-graining must be done by the Bayesian inverse of $\pi _ { 1 }$ , with prior $e$ (method 1), or a prior generated by the previous layers (method 2), which is possible because we really only need the prior over scale $\epsilon _ { 1 }$ . An example of the type of Bayesian networks involved is represented in Figure 2.
|
| 113 |
+
|
| 114 |
+
This process can be iterated until all ${ \mathcal { O } } ( \log N )$ layers/channels have been trained, and the training length covers the whole system. Further training passes can then be done in the same way in order to exploit the better priors generated by the already trained layers.
|
| 115 |
+
|
| 116 |
+
# Acknowledgments
|
| 117 |
+
|
| 118 |
+
Helpful discussions with Tobias Osborne are gratefully acknowledged. This work was supported by the cluster of excellence EXC 201 “Quantum Engineering and Space-Time Research”.
|
| 119 |
+
|
| 120 |
+
# References
|
| 121 |
+
|
| 122 |
+
[1] K.G. Wilson. The renormalization group and critical phenomena. Rev. Mod. Phys., 55(3):583, 1983. [2] G. Vidal. Entanglement renormalization. Physical Review Letters, 99:220405, 2007.
|
| 123 |
+
|
| 124 |
+
[3] G. Vidal. Class of quantum many-body states that can be efficiently simulated. Phys. Rev. Lett., 101:110501, 2008.
|
| 125 |
+
[4] D. Perez-Garcia, F. Verstraete, M.M. Wolf, and J.I. Cirac. ArXiv:quant-ph/0608197, 2006.
|
| 126 |
+
[5] F. Verstraete, M.M. Wolf, D. Perez-Garcia, and J.I. Cirac. Criticality, the area law, and the computational power of projected entangled pair states. Phys. Rev. Lett., 96(22):220601, 2006.
|
| 127 |
+
[6] M. Cramer, M. B. Plenio, S. T. Flammia, R. Somma, D. Gross, S. D. Bartlett, O. LandonCardinal, D. Poulin, and Y.-K. Liu. Efficient quantum state tomography. Nature Communications, 2010.
|
| 128 |
+
[7] O. Landon-Cardinal and D. Poulin. Practical learning method for multi-scale entangled states. New Journal of Physics, 2012.
|
| 129 |
+
[8] G. Vidal. Entanglement Renormalization: an introduction. ArXiv:0912.1651, 2009.
|
| 130 |
+
[9] Kristan Temme and Frank Verstraete. Stochastic matrix product states. Phys. Rev. Lett., 104:210502, 2010.
|
md/train/JWOiYxMG92s/JWOiYxMG92s.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FREE LUNCH FOR FEW-SHOT LEARNING: DISTRIBUTION CALIBRATION
|
| 2 |
+
|
| 3 |
+
Shuo $\mathbf { Y a n g ^ { 1 } }$ , Lu $\mathbf { L i u ^ { 2 } }$ , Min $\mathbf { X } \mathbf { u } ^ { 1 * }$ 1School of Electrical and Data Engineering, University of Technology Sydney, 2Australian Artificial Intelligence Institute, University of Technology Sydney {shuo.yang, lu.liu-10}@student.uts.edu.au, min.xu@uts.edu.au,
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Learning from a limited number of samples is challenging since the learned model can easily become overfitted based on the biased distribution formed by only a few training examples. In this paper, we calibrate the distribution of these fewsample classes by transferring statistics from the classes with sufficient examples. Then an adequate number of examples can be sampled from the calibrated distribution to expand the inputs to the classifier. We assume every dimension in the feature representation follows a Gaussian distribution so that the mean and the variance of the distribution can borrow from that of similar classes whose statistics are better estimated with an adequate number of samples. Our method can be built on top of off-the-shelf pretrained feature extractors and classification models without extra parameters. We show that a simple logistic regression classifier trained using the features sampled from our calibrated distribution can outperform the state-of-the-art accuracy on three datasets $5 \%$ improvement on miniImageNet compared to the next best). The visualization of these generated features demonstrates that our calibrated distribution is an accurate estimation. The code is available at: https://github.com/ShuoYang-1998/Few_ Shot_Distribution_Calibration
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Learning from a limited number of training samples has drawn increasing attention due to the high cost of collecting and annotating a large amount of data. Researchers have developed algorithms to improve the performance of models that have been trained with very few data. Finn et al. (2017); Snell et al. (2017) train models in a meta-learning fashion so that the model can adapt quickly on tasks with only a few training samples available. Hariharan & Girshick (2017); Wang et al. (2018) try to synthesize data or features by learning a generative model to alleviate the data insufficiency problem. Ren et al. (2018) propose to leverage unlabeled data and predict pseudo labels to improve the performance of fewshot learning.
|
| 12 |
+
|
| 13 |
+
Table 1: The class mean similarity (“mean sim”) and class variance similarity (“var sim”) between Arctic fox and different classes.
|
| 14 |
+
|
| 15 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Arctic fox</td></tr><tr><td>mean sim</td><td>var sim</td></tr><tr><td>white wolf</td><td>97%</td><td>97%</td></tr><tr><td>malamute</td><td>85%</td><td>78%</td></tr><tr><td>lion</td><td>81%</td><td>70%</td></tr><tr><td>meerkat</td><td>78%</td><td>70%</td></tr><tr><td> jellyfish</td><td>46%</td><td>26%</td></tr><tr><td>orange</td><td>40%</td><td>19%</td></tr><tr><td>beer bottle</td><td>34%</td><td>11%</td></tr></table>
|
| 16 |
+
|
| 17 |
+
While most previous works focus on developing stronger models, scant attention has been paid to the property of the data itself. It is natural that when the number of data grows, the ground truth distribution can be more accurately uncovered. Models trained with a wide coverage of data can generalize well during evaluation. On the other hand, when training a model with only a few training data, the model tends to overfit on these few samples by minimizing the training loss over these samples. These phenomena are illustrated in Figure 1. This biased distribution based on a few examples can damage the generalization ability of the model since it is far from mirroring the ground truth distribution from which test cases are sampled during evaluation.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Training a classifier from few-shot features makes the classifier overfit to the few examples (Left). Classifier trained with features sampled from calibrated distribution has better generalization ability (Right).
|
| 21 |
+
|
| 22 |
+
Here, we consider calibrating this biased distribution into a more accurate approximation of the ground truth distribution. In this way, a model trained with inputs sampled from the calibrated distribution can generalize over a broader range of data from a more accurate distribution rather than only fitting itself to those few samples. Instead of calibrating the distribution of the original data space, we try to calibrate the distribution in the feature space, which has much lower dimensions and is easier to calibrate (Xian et al. (2018)). We assume every dimension in the feature vectors follows a Gaussian distribution and observe that similar classes usually have similar mean and variance of the feature representations, as shown in Table 1. Thus, the mean and variance of the Gaussian distribution can be transferred across similar classes (Salakhutdinov et al. (2012)). Meanwhile, the statistics can be estimated more accurately when there are adequate samples for this class. Based on these observations, we reuse the statistics from many-shot classes and transfer them to better estimate the distribution of the few-shot classes according to their class similarity. More samples can be generated according to the estimated distribution which provides sufficient supervision for training the classification model.
|
| 23 |
+
|
| 24 |
+
In the experiments, we show that a simple logistic regression classifier trained with our strategy can achieve state-of-the-art accuracy on three datasets. Our distribution calibration strategy can be paired with any classifier and feature extractor with no extra learnable parameters. Training with samples selected from the calibrated distribution can achieve $12 \%$ accuracy gain compared to the baseline which is only trained with the few samples given in a 5way1shot task. We also visualize the calibrated distribution and show that it is an accurate approximation of the ground truth that can better cover the test cases.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORKS
|
| 27 |
+
|
| 28 |
+
Few-shot classification is a challenging machine learning problem and researchers have explored the idea of learning to learn or meta-learning to improve the quick adaptation ability to alleviate the few-shot challenge. One of the most general algorithms for meta-learning is the optimizationbased algorithm. Finn et al. (2017) and Li et al. (2017) proposed to learn how to optimize the gradient descent procedure so that the learner can have a good initialization, update direction, and learning rate. For the classification problem, researchers proposed simple but effective algorithms based on metric learning. MatchingNet (Vinyals et al., 2016) and ProtoNet (Snell et al., 2017) learned to classify samples by comparing the distance to the representatives of each class. Our distribution calibration and feature sampling procedure does not include any learnable parameters and the classifier is trained in a traditional supervised learning way.
|
| 29 |
+
|
| 30 |
+
Another line of algorithms is to compensate for the insufficient number of available samples by generation. Most methods use the idea of Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) or autoencoder (Rumelhart et al., 1986) to generate samples (Zhang et al. (2018); Chen et al. (2019b); Schwartz et al. (2018); Gao et al. (2018)) or features (Xian et al. (2018); Zhang et al. (2019)) to augment the training set. Specifically, Zhang et al. (2018) and Xian et al. (2018) proposed to synthesize data by introducing an adversarial generator conditioned on tasks. Zhang et al. (2019) tried to learn a variational autoencoder to approximate the distribution and predict labels based on the estimated statistics. The autoencoder can also augment samples by projecting between the visual space and the semantic space (Chen et al., 2019b) or encoding the intra-class deformations (Schwartz et al., 2018). Liu et al. (2019b) and Liu et al. (2019a) propose to generate features through the class hierarchy. While these methods can generate extra samples or features for training, they require the design of a complex model and loss function to learn how to generate. However, our distribution calibration strategy is simple and does not need extra learnable parameters.
|
| 31 |
+
|
| 32 |
+
Data augmentation is a traditional and effective way of increasing the number of training samples. Qin et al. (2020) and Antoniou & Storkey (2019) proposed the used of the traditional data augmentation technique to construct pretext tasks for unsupervised few-shot learning. Wang et al. (2018) and Hariharan & Girshick (2017) leveraged the general idea of data augmentation, they designed a hallucination model to generate the augmented version of the image with different choices for the model’s input, i.e., an image and a noise (Wang et al., 2018) or the concatenation of multiple features (Hariharan & Girshick, 2017). Park et al. (2020); Wang et al. (2019); Liu et al. (2020b) tried to augment feature representations by leveraging intra-class variance. These methods learn to augment from the original samples or their feature representation while we try to estimate the classlevel distribution and thus can eliminate the inductive bias from a single sample and provide more diverse generations from the calibrated distribution.
|
| 33 |
+
|
| 34 |
+
# 3 MAIN APPROACH
|
| 35 |
+
|
| 36 |
+
In this section, we introduce the few-shot classification problem definition in Section 3.1 and details of our proposed approach in Section 3.2.
|
| 37 |
+
|
| 38 |
+
# 3.1 PROBLEM DEFINITION
|
| 39 |
+
|
| 40 |
+
We follow a typical few-shot classification setting. Given a dataset with data-label pairs $\mathcal { D } =$ $\{ ( x _ { i } , y _ { i } ) \}$ where $\pmb { x } _ { i } \in \mathbb { R } ^ { d }$ is the feature vector of a sample and $y _ { i } \in C$ , where $C$ denotes the set of
|
| 41 |
+
classes. This set of classes is divided into base classes $C _ { b }$ and novel classes $C _ { n }$ , where $C _ { b } \cap C _ { n } = \emptyset$
|
| 42 |
+
and $C _ { b } \cup C _ { n } = C$ . The goal is to train a model on the data from the base classes so that the model
|
| 43 |
+
can generalize well on tasks sampled from the novel classes. In order to evaluate the fast adaptation
|
| 44 |
+
ability or the generalization ability of the model, there are only a few available labeled samples for
|
| 45 |
+
each task $\tau$ . The most common way to build a task is called an N-way-K-shot task (Vinyals et al.
|
| 46 |
+
(2016)), where $\mathbf { N }$ classes are sampled from the novel set and only $\mathbf { K }$ (e.g., 1 or 5) labeled samples are
|
| 47 |
+
provideand the for each class. The few available labeodel is evaluated on another query set set , wh $\boldsymbol { S } = \{ ( \boldsymbol { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N \times K }$ $\mathcal { Q } = \{ ( \pmb { x } _ { i } , y _ { i } ) \} _ { i = N \times K + 1 } ^ { N \times K + N \times q }$ $q$
|
| 48 |
+
query set of) multiple tasks sampled from the novel classes.
|
| 49 |
+
|
| 50 |
+
# 3.2 DISTRIBUTION CALIBRATION
|
| 51 |
+
|
| 52 |
+
As introduced in Section 3.1, the base classes have a sufficient amount of data while the evaluation tasks sampled from the novel classes only have a limited number of labeled samples. The statistics of the distribution for the base class can be estimated more accurately compared to the estimation based on few-shot samples, which is an ill-posed problem. As shown in Table 1, we observe that if we assume the feature distribution is Gaussian, the mean and variance with respect to each class are correlated to the semantic similarity of each class. With this in mind, the statistics can be transferred from the base classes to the novel classes if we learn how similar the two classes are. In the following sections, we discuss how we calibrate the distribution estimation of the classes with only a few samples (Section 3.2.2) with the help of the statistics of the base classes (Section 3.2.1). We will also elaborate on how do we leverage the calibrated distribution to improve the performance of few-shot learning (Section 3.2.3).
|
| 53 |
+
|
| 54 |
+
Note that our distribution calibration strategy is over the feature-level and is agnostic to any feature extractor. Thus, it can be built on top of any pretrained feature extractors without further costly finetuning. In our experiments, we use the pretrained WideResNet Zagoruyko & Komodakis (2016) following previous work (Mangla et al. (2020)). The WideResNet is trained to classify the base classes, along with a self-supervised pretext task to learn the general-purpose representations suitable for image understanding tasks. Please refer to their paper for more details on training the feature extractor.
|
| 55 |
+
|
| 56 |
+
# Algorithm 1 Training procedure for an N-way-K-shot task
|
| 57 |
+
|
| 58 |
+
$\pmb { S } = ( \pmb { x } _ { i } , y ) _ { i = 1 } ^ { N \times K }$ $\{ \pmb { \mu } _ { i } \} _ { i = 1 } ^ { | C _ { b } | } , \{ \pmb { \Sigma } _ { i } \} _ { i = 1 } ^ { | C _ { b } | }$
|
| 59 |
+
|
| 60 |
+
1: Transform $\left( \pmb { x } _ { i } \right) _ { i = 1 } ^ { N \times K }$ i=1 i=1with Tukey’s Ladder of Powers as Equation 3
|
| 61 |
+
2: for $( x _ { i } , y _ { i } ) \in S$ do
|
| 62 |
+
3: Calibrate the mean $\mu ^ { \prime }$ and the covariance $\pmb { \Sigma } ^ { \prime }$ for class $y _ { i }$ using $\mathbf { \Delta } \mathbf { x } _ { i }$ with Equation 6
|
| 63 |
+
4: Sample features for class $y _ { i }$ from the calibrated distribution as Equation 7
|
| 64 |
+
5: end for
|
| 65 |
+
6: Train a classifier using both support set features and all sampled features as Equation 8
|
| 66 |
+
|
| 67 |
+
# 3.2.1 STATISTICS OF THE BASE CLASSES
|
| 68 |
+
|
| 69 |
+
We assume the feature distribution of base classes is Gaussian. The mean of the feature vector from a base class $i$ is calculated as the mean of every single dimension in the vector:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mu _ { i } = \frac { \sum _ { j = 1 } ^ { n _ { i } } { \pmb x } _ { j } } { n _ { i } } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { j } }$ is a feature vector of the $j$ -th sample from the base class $i$ and $n _ { i }$ is the total number of samples in class $i$ . As the feature vector $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { j } }$ is multi-dimensional, we use covariance for a better representation of the variance between any pair of elements in the feature vector. The covariance matrix $\Sigma _ { i }$ for the features from class $i$ is calculated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\pmb { \Sigma } _ { i } = \frac { 1 } { n _ { i } - 1 } \sum _ { j = 1 } ^ { n _ { i } } \left( \pmb { x } _ { j } - \pmb { \mu } _ { i } \right) \left( \pmb { x } _ { j } - \pmb { \mu } _ { i } \right) ^ { T } .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
# 3.2.2 CALIBRATING STATISTICS OF THE NOVEL CLASSES
|
| 82 |
+
|
| 83 |
+
Here, we consider an N-way-K-shot task sampled from the novel classes.
|
| 84 |
+
|
| 85 |
+
# Tukey’s Ladder of Powers Transformation
|
| 86 |
+
|
| 87 |
+
To make the feature distribution more Gaussian-like, we first transform the features of the support set and query set in the target task using Tukey’s Ladder of Powers transformation (Tukey (1977)). Tukey’s Ladder of Powers transformation is a family of power transformations which can reduce the skewness of distributions and make distributions more Gaussian-like. Tukey’s Ladder of Powers transformation is formulated as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\tilde { \mathbf { x } } = \left\{ \begin{array} { l l } { x ^ { \lambda } } & { \mathrm { ~ i f ~ } \lambda \neq 0 } \\ { \log ( \pmb { x } ) } & { \mathrm { ~ i f ~ } \lambda = 0 } \end{array} \right.
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\lambda$ is a hyper-parameter to adjust how to correct the distribution. The original feature can be recovered by setting $\lambda$ as 1. Decreasing $\lambda$ makes the distribution less positively skewed and vice versa.
|
| 94 |
+
|
| 95 |
+
# Calibration through statistics transfer
|
| 96 |
+
|
| 97 |
+
Using the statistics from the base classes introduced in Section 3.2.1, we transfer the statistics from the base classes which are estimated more accurately on sufficient data to the novel classes. The transfer is based on the Euclidean distance between the feature space of the novel classes and the mean of the features from the base classes $\pmb { \mu _ { i } }$ as computed in Equation 1. Specifically, we select the top $k$ base classes with the closest distance to the feature of a sample $\tilde { \pmb x }$ from the support set:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\begin{array} { r } { \mathbb { S } _ { d } = \{ - \| \pmb { \mu } _ { i } - \tilde { \pmb { x } } \| ^ { 2 } | i \in C _ { b } \} , } \\ { \mathbb { S } _ { N } = \{ i | - \| \pmb { \mu } _ { i } - \tilde { \pmb { x } } \| ^ { 2 } \in t o p k ( \mathbb { S } _ { d } ) \} , } \end{array}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $t o p k ( \cdot )$ is an operator to select the top elements from the input distance set $\mathbb { S } _ { d }$ . $\mathbb { S } _ { N }$ stores the $k$ nearest base classes with respect to a feature vector $\tilde { \pmb x }$ . Then, the mean and covariance of the distribution is calibrated by the statistics from the nearest base classes:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\pmb { \mu } ^ { \prime } = \frac { \sum _ { i \in \mathbb { S } _ { N } } \pmb { \mu } _ { i } + \tilde { \pmb { x } } } { k + 1 } , \pmb { \Sigma } ^ { \prime } = \frac { \sum _ { i \in \mathbb { S } _ { N } } \pmb { \Sigma } _ { i } } { k } + \alpha ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Table 2: 5way1shot and 5way5shot classification accuracy $( \% )$ on miniImageNet and CUB with $9 5 \%$ confidence intervals. The numbers in bold have intersecting confidence intervals with the most accurate method.
|
| 110 |
+
|
| 111 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">miniImageNet</td><td colspan="2">CUB</td></tr><tr><td>5way1shot</td><td>5way5shot</td><td>5way1shot</td><td>5way5shot</td></tr><tr><td>Optimization-based</td><td></td><td></td><td></td><td></td></tr><tr><td>MAML (Finn et al. (2017))</td><td>48.70 ±1.84</td><td>63.10 ± 0.92</td><td>50.45 ±0.97 59.60 ± 0.84</td><td></td></tr><tr><td>Meta-SGD (Li et al. (2017))</td><td>50.47 ± 1.87</td><td>64.03 ±0.94</td><td>53.34± 0.97</td><td>67.59 ±0.82</td></tr><tr><td>LEO (Rusu et al. (2019))</td><td>61.76 ± 0.08</td><td>77.59 ± 0.12</td><td></td><td></td></tr><tr><td>E3BM (Liu et al. (2020c))</td><td>63.80 ±0.40</td><td>80.29 ±0.25</td><td></td><td></td></tr><tr><td>Metric-based</td><td></td><td></td><td></td><td></td></tr><tr><td>Matching Net (Vinyals et al. (2016))</td><td>43.56 ± 0.84</td><td>55.31 ± 0.73</td><td>56.53 ± 0.99</td><td>63.54 ± 0.85</td></tr><tr><td>Prototypical Net (Snell et al. (2017))</td><td>54.16 ± 0.82</td><td>73.68 ±0.65</td><td>72.99±0.88</td><td>86.64± 0.51</td></tr><tr><td>Baseline++ (Chen et al. (2019a))</td><td>51.87 ± 0.77</td><td>75.68 ± 0.63</td><td>67.02 ±0.90</td><td>83.58 ± 0.54</td></tr><tr><td>Variational Few-shot(Zhang et al. (2019))</td><td>61.23 ±0.26</td><td>77.69 ± 0.17</td><td></td><td></td></tr><tr><td>Negative-Cosine(Liu et al. (2020a))</td><td>62.33 ±0.82</td><td>80.94± 0.59</td><td>72.66 ± 0.85</td><td>89.40 ± 0.43</td></tr><tr><td>Generation-based</td><td></td><td></td><td></td><td></td></tr><tr><td>MetaGAN (Zhang et al. (2018))</td><td>52.71 ± 0.64</td><td>68.63±0.67</td><td></td><td></td></tr><tr><td>Delta-Encoder (Schwartz et al. (2018))</td><td>59.9</td><td>69.7</td><td>69.8</td><td>82.6</td></tr><tr><td>TriNet (Chen et al. (2019b))</td><td>58.12 ± 1.37</td><td>76.92 ±0.69</td><td>69.61± 0.46</td><td>84.10 ± 0.35</td></tr><tr><td>Meta Variance Transfer (Park etal. (2020))</td><td>-</td><td>67.67 ± 0.70</td><td>1</td><td>80.33 ±0.61</td></tr><tr><td>Maximum Likelihood with DC (Ours)</td><td>66.91± 0.17</td><td>80.74±0.48</td><td>77.22± 0.14</td><td>89.58±0.27</td></tr><tr><td>SVM with DC (Ours)</td><td>67.31 ± 0.83</td><td>82.30 ± 0.34</td><td>79.49 ± 0.33</td><td>90.26 ± 0.98</td></tr><tr><td>Logistic Regression with DC (Ours)</td><td>68.57 ± 0.55</td><td>82.88 ± 0.42</td><td>79.56 ± 0.87</td><td>90.67 ± 0.35</td></tr></table>
|
| 112 |
+
|
| 113 |
+
where $\alpha$ is a hyper-parameter that determines the degree of dispersion of features sampled from the calibrated distribution.
|
| 114 |
+
|
| 115 |
+
For few-shot learning with more than one shot, the aforementioned procedure of the distribution calibration should be undertaken multiple times with each time using one feature vector from the support set. This avoids the bias provided by one specific sample and potentially achieves more diverse and accurate distribution estimation. Thus, for simplicity, we denote the calibrated distribution as a set of statistics. For a class $y \in C _ { n }$ , we denote the set of statistics as $\mathbb { S } _ { y } = \{ ( \boldsymbol { \mu } _ { 1 } ^ { \prime } , \boldsymbol { \Sigma } _ { 1 } ^ { \prime } ) , . . . , ( \boldsymbol { \mu } _ { K } ^ { \prime } , \boldsymbol { \Sigma } _ { K } ^ { \prime } ) \}$ , where $\mu _ { i } ^ { ' } , \Sigma _ { i } ^ { ' }$ are the calibrated mean and covariance, respectively, computed based on the $i$ -th feature in the support set of class $y$ . Here, the size of the set is the value of $K$ for an $\mathbf { N } .$ -way-K-shot task.
|
| 116 |
+
|
| 117 |
+
# 3.2.3 HOW TO LEVERAGE THE CALIBRATED DISTRIBUTION?
|
| 118 |
+
|
| 119 |
+
With a set of calibrated statistics $\mathbb { S } _ { y }$ for class $y$ in a target task, we generate a set of feature vectors with label $y$ by sampling from the calibrated Gaussian distributions:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathbb { D } _ { y } = \{ ( \boldsymbol { x } , y ) | \boldsymbol { x } \sim \mathcal { N } ( \boldsymbol { \mu } , \boldsymbol { \Sigma } ) , \forall ( \boldsymbol { \mu } , \boldsymbol { \Sigma } ) \in \mathbb { S } ^ { y } \} .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Here, the total number of generated features per class is set as a hyperparameter and they are equally distributed for every calibrated distribution in $\mathbb { S } _ { y }$ . The generated features along with the original support set features for a few-shot task is then served as the training data for a task-specific classifier. We train the classifier for a task by minimizing the cross-entropy loss over both the features of its support set $s$ and the generated features $\mathbb { D } _ { y }$ :
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\ell = \sum _ { ( \pmb { x } , y ) \sim \tilde { S } \cup \mathbb { D } _ { y , y \in \mathcal { V } } \mathcal { T } } - \log \operatorname* { P r } ( y | \pmb { x } ; \theta ) ,
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
where $y ^ { \tau }$ is the set of classes for the task $\tau$ . $\tilde { \cal S }$ denotes the support set with features transformed by Turkey’s Ladder of Powers transformation and the classifier model is parameterized by $\theta$ .
|
| 132 |
+
|
| 133 |
+
# 4 EXPERIMENTS
|
| 134 |
+
|
| 135 |
+
In this section, we answer the following questions:
|
| 136 |
+
|
| 137 |
+
• How does our distribution calibration strategy perform compared to the state-of-the-art methods?
|
| 138 |
+
|
| 139 |
+
Table 3: 5way1shot and 5way5shot classification accuracy $( \% )$ on tieredImageNet (Ren et al., 2018). The numbers in bold have intersecting confidence intervals with the most accurate method.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Methods</td><td colspan="2">tieredImageNet</td></tr><tr><td></td><td>5way1shot</td><td>5way5shot</td></tr><tr><td>Matching Net (Vinyals et al. (2016))</td><td>68.50 ± 0.92</td><td>80.60±0.71</td></tr><tr><td>Prototypical Net (Snell et al. (2017))</td><td>65.65 ± 0.92</td><td>83.40 ± 0.65</td></tr><tr><td>LEO (Rusu et al. (2019))</td><td>66.33± ( 0.05</td><td>82.06 ±0.08</td></tr><tr><td>E3BM (Liu et al. (2020c))</td><td>71.20 士 0.40</td><td>85.30 ± 0.30</td></tr><tr><td>DeepEMD (Zhang et al., 2020)</td><td>71.16 ± 0.87</td><td>86.03 ± 0.58</td></tr><tr><td rowspan="2">MaximumLikelihood with DC (Ours) SVM with DC (Ours)</td><td>75.92 士 0.60</td><td>87.84 ± 0.65</td></tr><tr><td>77.93 ± ( 0.12</td><td>89.72 ± 0.37</td></tr><tr><td rowspan="2">Logistic Regression with DC (Ours)</td><td>78.19 ± 0.25</td><td>89.90 ± 0.41</td></tr><tr><td></td><td></td></tr></table>
|
| 142 |
+
|
| 143 |
+
• What does calibrated distribution look like? Is it an accurate approximation for this class? • How does Tukey’s Ladder of Power transformation interact with the feature generations? How important is each in relation to performance?
|
| 144 |
+
|
| 145 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 146 |
+
|
| 147 |
+
# 4.1.1 DATASETS
|
| 148 |
+
|
| 149 |
+
We evaluate our distribution calibration strategy on miniImageNet (Ravi & Larochelle (2017)), tieredImageNet (Ren et al. (2018)) and CUB (Welinder et al. (2010)). miniImageNet and tieredImageNet have a brand range of classes including various animals and objects while CUB is a more fine-grained dataset that includes various species of birds. Datasets with different levels of granularity may have different distributions for their feature space. We want to show the effectiveness and generality of our strategy on all three datasets.
|
| 150 |
+
|
| 151 |
+
miniImageNet is derived from ILSVRC-12 dataset (Russakovsky et al., 2014). It contains 100 diverse classes with 600 samples per class. The image size is $8 4 \times 8 4 \times 3$ . We follow the splits used in previous works (Ravi & Larochelle, 2017), which split the dataset into 64 base classes, 16 validation classes, and 20 novel classes.
|
| 152 |
+
|
| 153 |
+
tieredImageNet is a larger subset of ILSVRC-12 dataset (Russakovsky et al., 2014), which contains 608 classes sampled from hierarchical category structure. Each class belongs to one of 34 higherlevel categories sampled from the high-level nodes in the ImageNet. The average number of images in each class is 1281. We use 351, 97, and 160 classes for training, validation, and test, respectively.
|
| 154 |
+
|
| 155 |
+
CUB is a fine-grained few-shot classification benchmark. It contains 200 different classes of birds with a total of 11,788 images of size $8 4 \times 8 4 \times 3$ . Following previous works (Chen et al., 2019a), we split the dataset into 100 base classes, 50 validation classes, and 50 novel classes.
|
| 156 |
+
|
| 157 |
+
# 4.1.2 EVALUATION METRIC
|
| 158 |
+
|
| 159 |
+
We use the top-1 accuracy as the evaluation metric to measure the performance of our method. We report the accuracy on 5way1shot and 5way5shot settings for miniImageNet, tieredImageNet and CUB. The reported results are the averaged classification accuracy over 10,000 tasks.
|
| 160 |
+
|
| 161 |
+
# 4.1.3 IMPLEMENTATION DETAILS
|
| 162 |
+
|
| 163 |
+
For feature extractor, we use the WideResNet (Zagoruyko & Komodakis, 2016) trained following previous work (Mangla et al. (2020)). For each dataset, we train the feature extractor with base classes and test the performance using novel classes. Note that the feature representation is extracted from the penultimate layer (with a ReLU activation function) from the feature extractor, thus the values are all non-negative so that the inputs to Tukey’s Ladder of Powers transformation in Equation 3 are valid. At the distribution calibration stage, we compute the base class statistics and transfer them to calibrate novel class distribution for each dataset. We use the LR and SVM implementation of scikit-learn (Pedregosa et al. (2011)) with the default settings. We use the same hyperparameter value for all datasets except for $\alpha$ . Specifically, the number of generated features is 750; $k = 2$ and $\lambda = 0 . 5$ . $\alpha$ is 0.21, 0.21 and 0.3 for miniImageNet, tieredImageNet and CUB, respectively.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 2: t-SNE visualization of our distribution estimation. Different colors represent different classes. ‘F’ represents support set features, $\mathbf { \dot { x } } _ { } ,$ in figure (d) represents query set features, $\mathbf { \check { \Psi } } _ { \mathbf { A } } \mathbf { \Psi } ^ { * }$ in figure (b)(c) represents generated features.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 3: Left: Accuracy when increasing the power in Tukey’s transformation when training with (red) or without (blue) the generated features. Right: Accuracy when increasing the number of generated features with the features are transformed by Tukey’s transformation (red) and without Tukey’s transformation (blue).
|
| 170 |
+
|
| 171 |
+
# 4.2 COMPARISION TO STATE-OF-THE-ART
|
| 172 |
+
|
| 173 |
+
Table 2 and Table 3 presents the 5way1shot and 5way5shot classification results of our method on miniImageNet, tieredImageNet and CUB. We compare our method with the three groups of the fewshot learning method, optimization-based, metric-based, and generation-based. Our method can be built on top of any classifier, and we use two popular and simple classifiers, namely SVM and LR to prove the effectiveness of our method. Simple linear classifiers equipped with our method perform better than the state-of-the-art few-shot classification method and achieve the best performance on 1-shot and 5-shot settings of miniImageNet, tieredImageNet and CUB. The performance of our distribution calibration surpasses the state-of-the-art generation-based method by $10 \%$ for the 5way1shot setting, which proves that our method can handle extremely low-shot classification tasks better. Compared to other generation-based methods, which require the design of a generative model with extra training costs on the learnable parameters, simple machine learning classifier with DC is much more simple, effective and flexible and can be equipped with any feature extractors and classifier model structures. Specifically, we show three variants, i.e, Maximum likelihood with DC, SVM with DC, Logistic Regression with DC in Table 2 and Table 3. A simple maximum likelihood classifier based on the calibrated distribution can outperform previous baselines and training a SVM classifier or Logistic Regression classifier using the samples from the calibrated distribution can further improve the performance.
|
| 174 |
+
|
| 175 |
+
# 4.3 VISUALIZATION OF GENERATED SAMPLES
|
| 176 |
+
|
| 177 |
+
We show what the calibrated distribution looks like by visualizing the generated features sampled from the distribution. In Figure 2, we show the t-SNE representation (van der Maaten & Hinton (2008)) of the original support set (a), the generated features (b,c) as well as the query set (d). Based on the calibrated distribution, the sampled features form a Gaussian distribution and more samples (c) can have a more comprehensive representation of the distribution. Due to the limited number of examples in the support set, only 1 in this case, the samples from the query set usually cover a greater area and are a mismatch with the support set. This mismatch can be fixed to some extent by the generated features, i.e., the generated features in (c) can overlap areas of the query set. Thus, training with these generated features can alleviate the mismatch between the distribution estimated only from the few-shot samples and the ground truth distribution.
|
| 178 |
+
|
| 179 |
+
Table 4: Ablation study on miniImageNet 5way1shot and 5way5shot showing accuracy $( \% )$ with $9 5 \%$ confidence intervals.
|
| 180 |
+
|
| 181 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Tukey transformationTraining with generated features</td><td colspan="2">miniImageNet</td></tr><tr><td>5way1shot</td><td>5way5shot</td></tr><tr><td>X</td><td>X</td><td>56.37± 0.68</td><td>79.03 ± 0.51</td></tr><tr><td></td><td>X</td><td>64.30 ± 0.53</td><td>81.33 ± 0.35</td></tr><tr><td>X</td><td>√</td><td>63.70 ± 0.38</td><td>82.26 ± 0.73</td></tr><tr><td>√</td><td>~</td><td>68.57 ± 0.55</td><td>82.88 ± 0.42</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 5: 5way1shot classification accuracy $( \% )$ on miniImageNet with different backbones.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Backbones</td><td>without DC</td><td>with DC</td></tr><tr><td>conv4 (Chen et al., 2019a)</td><td>42.11 ± 0.71</td><td>54.62± 0.64 (个12.51)</td></tr><tr><td>conv6 (Chen et al., 2019a)</td><td>46.07 ± 0.26</td><td>57.14 ± 0.45 (个 11.07)</td></tr><tr><td>resnet18 (Chen et al., 2019a)</td><td>52.32 土 0.82</td><td>61.50 士 0.47 (个 9.180)</td></tr><tr><td>WRN28 (Mangla etal., 2020)</td><td>54.53± 0.56</td><td>64.38 士 0.63 (个 9.850)</td></tr><tr><td>WRN28 + Rotation Loss (Mangla et al., 2020)</td><td>56.37 ± 0.68</td><td>68.57 士 0.55 5(个12.20)</td></tr></table>
|
| 186 |
+
|
| 187 |
+
# 4.4 APPLICABILITY OF DISTRIBUTION CALIBRATION
|
| 188 |
+
|
| 189 |
+
# Applying distribution calibration on different backbones
|
| 190 |
+
|
| 191 |
+
Our distribution calibration strategy is agnostic to backbones $/$ feature extractors. Table 5 shows the consistent performance boost when applying distribution calibration on different feature extractors, i.e, four convolutional layers (conv4), six convolutional layers (conv6), resnet18, WRN28 and WRN28 trained with rotation loss. Distribution calibration achieves around $10 \%$ accuracy improvement compared to the backbones trained with different baselines.
|
| 192 |
+
|
| 193 |
+
# Applying distribution calibration on other baselines
|
| 194 |
+
|
| 195 |
+
A variety of works can benefit from training with the features generated by our distribution calibration strategy. We apply our distribution calibration strategy on two simple few-shot classification algorithms, Baseline (Chen et al., 2019a) and Baseline $^ { + + }$ (Chen et al., 2019a). Table 6 shows that our distribution calibration brings over $10 \%$ of accuracy improvement on both.
|
| 196 |
+
|
| 197 |
+
# 4.5 EFFECTS OF FEATURE TRANSFORMATION AND TRAINING WITH GENERATED FEATURES
|
| 198 |
+
|
| 199 |
+
# Ablation Study
|
| 200 |
+
|
| 201 |
+
Table 4 shows the performance when our model is trained without Tukey’s Ladder of Powers transformation for the features as in Equation 3 and when it is trained without the generated features as in Equation 7. It is clear that there is a severe decline in performance of over $10 \%$ if both are not used in the 5way1shot setting. The ablation of either one results in a performance drop of around $5 \%$ in the 5way1shot setting.
|
| 202 |
+
|
| 203 |
+
# Choices of Power for Tukey’s Ladder of Powers Transformation
|
| 204 |
+
|
| 205 |
+
The left side of Figure 3 shows the 5way1shot accuracy when choosing different powers for the Tukey’s transformation in Equation 3 when training the classifier with the generated features (red) and without (blue). Note that when the power $\lambda$ equals 1, the transformation keeps the original feature representations. There is a consistent general tendency for training with and without the generated features and in both cases, we found $\lambda = 0 . 5$ is the optimum choice. With the Tukey’s transformation, the distribution of query set features in target tasks become more aligned to the calibrated Gaussian distribution, thus benefits the classifier which is trained on features sampled from the calibrated distribution.
|
| 206 |
+
|
| 207 |
+
Table 6: 5way1shot classification accuracy $( \% )$ on miniImageNet with different baselines using distribution calibration.
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Method</td><td>without DC</td><td>with DC</td></tr><tr><td>Baseline (Chen et al.,2019a) Baseline++ (Chen et al.,2019a)</td><td>42.11±0.71 48.24 ± 0.75</td><td>54.62 ± 0.64 (个 12.51) 61.24 ± 0.37 (个13.00)</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# Number of generated features
|
| 212 |
+
|
| 213 |
+
The right side of Figure 3 analyzes whether more generated features results in consistent improvement in both cases, namely when the features of support and query set are transformed by Tukey’s transformation (red) and when they are not (blue). We found that when the number of generated features is below 500, both cases can benefit from more generated features. However, when more features are sampled, the performance of the classifier tested on untransformed features begins to decline. By training with the generated samples, the simple logistic regression classifier has a $12 \%$ relative performance improvement in a 1-shot classification setting.
|
| 214 |
+
|
| 215 |
+
# 4.6 OTHER HYPER-PARAMETERS
|
| 216 |
+
|
| 217 |
+
We select the hyperparameters based on the performance of the validation set. The $k$ base class statistics to calibrate the novel class distribution in Equation 5 is set to 2. Figure 4 shows the effect of different values of $k$ . The $\alpha$ in Equation 6 is a constant added on each element of the estimated covariance matrix, which can determine the degree of dispersion of features sampled from the calibrated distributions. An appropriate value of $\alpha$ can ensure a good decision boundary for the classifier. Different datasets have different statistics and an appropriate value of $\alpha$ may vary for different datasets. Figure 5 explores the effect of $\alpha$ on all three datasets, i.e. miniImageNet, tieredImageNet and CUB. We observe that in each dataset, the performance of the validation set and the novel (testing) set generally has the same tendency, which indicates that the variance is dataset-dependent and is not overfitting to a specific set.
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 4: The effect of different values of $k$ .
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure 5: The effect of different values of $\alpha$
|
| 224 |
+
|
| 225 |
+
# 5 CONCLUSION AND FUTURE WORKS
|
| 226 |
+
|
| 227 |
+
We propose a simple but effective distribution calibration strategy for few-shot classification. Without complex generative models, training loss and extra parameters to learn, a simple logistic regression trained with features generated by our strategy outperforms the current state-of-the-art methods by $\sim 5 \%$ on miniImageNet. The calibrated distribution is visualized and demonstrates an accurate estimation of the feature distribution. Future works will explore the applicability of distribution calibration on more problem settings, such as multi-domain few-shot classification, and more methods, such as metric-based meta-learning algorithms.
|
| 228 |
+
|
| 229 |
+
# REFERENCES
|
| 230 |
+
|
| 231 |
+
Antreas Antoniou and Amos J. Storkey. Assume, augment and learn: Unsupervised few-shot metalearning via random labels and data augmentation. CoRR, 2019.
|
| 232 |
+
|
| 233 |
+
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, 2019a.
|
| 234 |
+
|
| 235 |
+
Zitian Chen, Yanwei Fu, Yinda Zhang, Yu-Gang Jiang, Xiangyang Xue, and Leonid Sigal. Multilevel semantic feature augmentation for one-shot learning. TIP, 28(9):4594–4605, 2019b.
|
| 236 |
+
|
| 237 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 238 |
+
|
| 239 |
+
Hang Gao, Zheng Shou, Alireza Zareian, Hanwang Zhang, and Shih-Fu Chang. Low-shot learning via covariance-preserving adversarial augmentation networks. In NeurIPS, 2018.
|
| 240 |
+
|
| 241 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014.
|
| 242 |
+
|
| 243 |
+
Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In ICCV, 2017.
|
| 244 |
+
|
| 245 |
+
Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few shot learning. CoRR, 2017.
|
| 246 |
+
|
| 247 |
+
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, 2020a.
|
| 248 |
+
|
| 249 |
+
Jialun Liu, Yifan Sun, Chuchu Han, Zhaopeng Dou, and Wenhui Li. Deep representation learning on long-tailed data: A learnable embedding augmentation perspective. In CVPR, June 2020b.
|
| 250 |
+
|
| 251 |
+
Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, Lina Yao, and Chengqi Zhang. Prototype propagation networks (PPN) for weakly-supervised few-shot learning on category graph. In IJCAI, 2019a.
|
| 252 |
+
|
| 253 |
+
Lu Liu, Tianyi Zhou, Guodong Long, Jing Jiang, and Chengqi Zhang. Learning to propagate for graph meta-learning. In NeurIPS, 2019b.
|
| 254 |
+
|
| 255 |
+
Yaoyao Liu, Bernt Schiele, and Qianru Sun. An ensemble of epoch-wise empirical bayes for fewshot learning. In ECCV, 2020c.
|
| 256 |
+
|
| 257 |
+
Puneet Mangla, Nupur Kumari, Abhishek Sinha, Mayank Singh, Balaji Krishnamurthy, and Vineeth N Balasubramanian. Charting the right manifold: Manifold mixup for few-shot learning. In WACV, 2020.
|
| 258 |
+
|
| 259 |
+
Seong-Jin Park, Seungju Han, Ji-won Baek, Insoo Kim, Juhwan Song, Hae Beom Lee, Jae-Joon Han, and Sung Ju Hwang. Meta variance transfer: Learning to augment from the others. In ICML, 2020.
|
| 260 |
+
|
| 261 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 262 |
+
|
| 263 |
+
Tiexin Qin, Wenbin Li, Yinghuan Shi, and Yang Gao. Diversity helps: Unsupervised few-shot learning via distribution shift-based data augmentation, 2020.
|
| 264 |
+
|
| 265 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017.
|
| 266 |
+
|
| 267 |
+
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.
|
| 268 |
+
|
| 269 |
+
David E. Rumelhart, Geoffrey E. Hinton, and Ronald J. Williams. Learning Representations by Back-propagating Errors. Nature, 323:533–536, 1986.
|
| 270 |
+
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. CoRR, abs/1409.0575, 2014.
|
| 271 |
+
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.
|
| 272 |
+
Ruslan Salakhutdinov, Joshua Tenenbaum, and Antonio Torralba. One-shot learning with a hierarchical nonparametric bayesian model. In ICML workshop, 2012.
|
| 273 |
+
Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Abhishek Kumar, Rogerio Feris, Raja Giryes, and Alex Bronstein. Delta-encoder: an effective sample synthesis method for few-shot object recognition. In NeurIPS, 2018.
|
| 274 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017.
|
| 275 |
+
John W Tukey. Exploratory data analysis. Addison-Wesley Series in Behavioral Science. AddisonWesley, Reading, MA, 1977. URL https://cds.cern.ch/record/107005.
|
| 276 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 2008.
|
| 277 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In NeurIPS, 2016.
|
| 278 |
+
Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018.
|
| 279 |
+
Yulin Wang, Xuran Pan, Shiji Song, Hong Zhang, Gao Huang, and Cheng Wu. Implicit semantic data augmentation for deep networks. In NeurIPS, 2019.
|
| 280 |
+
P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech-UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010.
|
| 281 |
+
Yongqin Xian, Tobias Lorenz, Bernt Schiele, and Zeynep Akata. Feature generating networks for zero-shot learning. In CVPR, 2018.
|
| 282 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In BMVC, 2016.
|
| 283 |
+
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.
|
| 284 |
+
Jian Zhang, Chenglong Zhao, Bingbing Ni, Minghao Xu, and Xiaokang Yang. Variational few-shot learning. In ICCV, 2019.
|
| 285 |
+
Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In NeurIPS, 2018.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 6: We show the feature distribution of 5 base classes, and the feature distribution of 5 novel classes before/after Tukey’s Transformation.
|
| 289 |
+
|
| 290 |
+
Table 7: The comparison with nearest class feature augmentation.
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Training data</td><td>miniImageNet 5way1shot</td></tr><tr><td>Support set only</td><td>56.37±0.68</td></tr><tr><td>Support set + 1 feature from the nearest class</td><td>62.39 ± 0.49</td></tr><tr><td>Support set + 5 features from the nearest class</td><td>59.73 ± 0.42</td></tr><tr><td>Support set + 1O features from the nearest class</td><td>58.93 ± 0.49</td></tr><tr><td>Support set+1OO features from the nearest class</td><td>57.33 ± 0.48</td></tr><tr><td>Support set + 1OO features sampled from calibrated distribution</td><td>68.53 ± 0.32</td></tr></table>
|
| 293 |
+
|
| 294 |
+
# A AUGMENTATION WITH NEAREST CLASS FEATURES
|
| 295 |
+
|
| 296 |
+
Instead of sampling from the calibrated distribution, we can simply retrieve examples from the nearest class to augment the support set. Table 7 shows the comparison of training using samples from the calibrated distribution, the different number of retrieved features from the nearest class, and only using the support set. We found the retrieved features can improve the performance compared to only using the support set but can damage the performance when increasing the number of retrieved features, where the retrieved samples probably serve as noisy data for tasks targeting different classes.
|
| 297 |
+
|
| 298 |
+
# B DISTRIBUTION CALIBRATION WITHOUT NOVEL FEATURE
|
| 299 |
+
|
| 300 |
+
We calibrate the novel class mean by averaging the novel class mean and the retrieved base class means in Equation 6. Table 8 shows the distribution calibration without averaging novel feature, in which the calibrated mean is calculated as $\begin{array} { r } { \pmb { \mu } ^ { \prime } = \frac { \Sigma _ { i \in \mathbb { S } _ { N } } \pmb { \mu } _ { i } } { k } } \end{array}$ .
|
| 301 |
+
|
| 302 |
+
# C THE EFFECTS OF TUKEY’S TRANSFORMATION
|
| 303 |
+
|
| 304 |
+
Figure 6 shows the distribution of 5 base classes and 5 novel classes before/after Tukey’s transformation. It is observed that the base class distribution satisfies Gaussian assumption well (left) while the novel class distribution is more skew (middle). The novel class distribution after Tukey’s transformation (right) is more aligned with the Gaussian-like base class distribution.
|
| 305 |
+
|
| 306 |
+
Table 8: The comparison between distribution calibration with and without novel feature $\tilde { \pmb x }$ .
|
| 307 |
+
|
| 308 |
+
<table><tr><td></td><td>miniImageNet 5way1shot</td></tr><tr><td>Distribution Calibration w/o novel feature x</td><td>59.38 ± 0.73</td></tr><tr><td>Distribution Calibration w/ novel feature x</td><td>68.57 ± 0.55</td></tr></table>
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Novel class</td><td>Top-1 base class similarity</td><td>Top-2 base class similarity</td><td>DC improvement</td></tr><tr><td>malamute</td><td>93%</td><td>85%</td><td>↑21.30%</td></tr><tr><td>golden retriever</td><td>85%</td><td>74%</td><td>个 18.37%</td></tr><tr><td>ant</td><td>71%</td><td>67%</td><td>↑9.77%</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 9: Performance improvement with respect to the similarity level between a query novel class and the most similar base classes.
|
| 313 |
+
|
| 314 |
+
# D THE SIMILARITY LEVEL ANALYSIS
|
| 315 |
+
|
| 316 |
+
We found that the higher similarities between the retrieved base class distribution and the novel class ground-truth distribution, the higher the performance improvement our method will bring as shown in Table 9. The results in the table are under 5-way-1-shot setting.
|
md/train/JiYq3eqTKY/JiYq3eqTKY.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/KCd-3Pz8VjM/KCd-3Pz8VjM.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Automatic Unsupervised Outlier Model Selection
|
| 2 |
+
|
| 3 |
+
Yue Zhao Carnegie Mellon University zhaoy@cmu.edu
|
| 4 |
+
|
| 5 |
+
Ryan A. Rossi Adobe Research ryrossi@adobe.com
|
| 6 |
+
|
| 7 |
+
Leman Akoglu Carnegie Mellon University lakoglu@andrew.cmu.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Given an unsupervised outlier detection task on a new dataset, how can we automatically select a good outlier detection algorithm and its hyperparameter(s) (collectively called a model)? In this work, we tackle the unsupervised outlier model selection (UOMS) problem, and propose METAOD, a principled, data-driven approach to UOMS based on meta-learning. The UOMS problem is notoriously challenging, as compared to model selection for classification and clustering, since (i) model evaluation is infeasible due to the lack of hold-out data with labels, and $( i i )$ model comparison is infeasible due to the lack of a universal objective function. METAOD capitalizes on the performances of a large body of detection models on historical outlier detection benchmark datasets, and carries over this prior experience to automatically select an effective model to be employed on a new dataset without any labels, model evaluations or model comparisons. To capture task similarity within our meta-learning framework, we introduce specialized metafeatures that quantify outlying characteristics of a dataset. Extensive experiments show that selecting a model by METAOD significantly outperforms no model selection (e.g. always using the same popular model or the ensemble of many) as well as other meta-learning techniques that we tailored for UOMS. Moreover upon (meta-)training, METAOD is extremely efficient at test time; selecting from a large pool of $3 0 0 +$ models takes less than 1 second for a new task. We open-source1 METAOD and our meta-learning database for practical use and to foster further research on the UOMS problem.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
The lack of a universal learning model that performs well on all problem instances is well recognized [53]. Therefore, effort has been directed toward building a toolbox of various models and algorithms, which has given rise to the problem of algorithm selection and hyperparameter tuning (i.e., model selection). The same problem applies to outlier detection (OD); a long list of detectors has been developed in the last decades [2], with no universal “winners” [8].
|
| 16 |
+
|
| 17 |
+
In supervised learning, model selection can be done via performance evaluation of each trained model on labeled hold-out data. In contrast, unsupervised OD does not have access to any labels, nor is there a universal objective function that could guide model selection (cf. clustering where a loss function enables model comparison). Unsupervised model selection for OD is challenging exactly because both model evaluation and comparison are not feasible—which renders any trial-and-error techniques like grid search or iterative strategies like Bayesian hyperparameter optimization [57] inapplicable. Consequently, there has been no principled work on unsupervised outlier model selection—rather, the choice of a model for a new task (or dataset) remains “a black art”. A typical approach is to use popular OD algorithms, like LOF [6] and iForest [31] (often with default hyperparameters) which are shown to be competitive on average on many benchmark datasets. However, as noted earlier, none of these methods can universally outperform others on all tasks [8]. We argue that model selection is exactly how one can “break the performance ceiling” for OD.
|
| 18 |
+
|
| 19 |
+
In this work, we tackle the unsupervised outlier model selection (UOMS) problem systematically. To that end, we introduce (to the best of our knowledge) the first UOMS approach that selects an effective model to be employed on a new detection task without any model evaluation (using labels) or model comparison (via loss criteria). Our proposed method, called METAOD, is based on meta-learning, and stands on the prior performances of a large collection of existing detection models on an extensive corpora of historical outlier detection benchmark datasets. In a nutshell, the idea is to estimate a candidate model’s performance on the new task (with no labels) based on its prior performance on similar historical tasks. We remark that METAOD is strictly a model selection technique – that picks one model (a detector and its associated hyperparameter(s)) from a pool of (existing) candidate models – and not yet-another outlier detection algorithm itself.
|
| 20 |
+
|
| 21 |
+
In leveraging meta-learning, we establish a connection between the UOMS problem and the cold-start problem in collaborative filtering (CF), where the new task in UOMS is akin to a new user in CF (with no available evaluations, hence cold-start) and the model space is analogous to the item-set. Differently, OD necessitates the identification of a single best model (i.e., top-1 rank), whereas CF typically operates in a top- $k$ setting. In CF, future recommendations can be improved based on user feedback which is not applicable to OD. Moreover, METAOD requires the effective learning of task similarities based on characteristic dataset features (namely, meta-features) that capture the outlying properties within a dataset, whereas user features (location, age, etc.) in CF may be readily available.
|
| 22 |
+
|
| 23 |
+
In summary, the key contributions of this work include the following:
|
| 24 |
+
|
| 25 |
+
• First Approach to Unsupervised Outlier Model Selection: We propose METAOD, (to our knowledge) the first effort on unsupervised model selection for OD tasks. Notably, given a new dataset (i.e., at test time), it does not rely on any ground-truth labels for model evaluation or any loss or heuristic criterion for model comparison. METAOD stands on meta-learning in principle, and historical collections of outlier models and benchmark datasets in practice.
|
| 26 |
+
|
| 27 |
+
• Problem Formulation: We establish a correspondence between UOMS and CF under cold-start, where the new task “better likes” a model that performs better on similar historical tasks.
|
| 28 |
+
|
| 29 |
+
• Specialized Meta-features: We design novel meta-features to capture the outlying characteristics in a dataset toward effectively quantifying task similarity specifically among OD tasks.
|
| 30 |
+
|
| 31 |
+
• Effectiveness and Efficiency: Through extensive experiments on two benchmark testbeds that we have constructed, we show that selecting a model by METAOD for each given task significantly outperforms always using a popular model like iForest, as well as other possible meta-learning approaches that we tailored for UOMS. Moreover, METAOD incurs negligible run-time overhead ( $\cdot < 1$ second) at test time.
|
| 32 |
+
|
| 33 |
+
• Open-source Platform: We open-source1 METAOD and our meta-learning database for the community to use it for UOMS in practice, and to extend it with new datasets and models. We expect the growth of the database would make meta-learning based approaches, like METAOD, more powerful and also help foster further research on this new direction to an important problem.
|
| 34 |
+
|
| 35 |
+
# 2 Related Work
|
| 36 |
+
|
| 37 |
+
# 2.1 Model Selection for Outlier Detection (OD)
|
| 38 |
+
|
| 39 |
+
Most outlier mining work have focused on developing new, better methods for detection on different types of data [2]. In comparison, there are only a few work on the outlier model selection problem –which detector and hyperparameter(s) to use on a new task– all of which require some labeled data. Recent work include AutoOD [29] that focuses on automatic neural architecture search, however, it is limited to deep autoencoder based detection, and more importantly it relies on hold-out labeled data for evaluation. Similarly, PyODDS [30] and TODS [25] both require ground truth labels.
|
| 40 |
+
|
| 41 |
+
To our knowledge, there is no existing work on the general unsupervised outlier model selection (UOMS) problem, which is considerably more challenging, as (1) model evaluation is infeasible due to the lack of any ground truth labels, and (2) model comparison of different heterogeneous detectors is infeasible due to the lack of a universal OD loss function.
|
| 42 |
+
|
| 43 |
+
We note that some OD methods do have a loss function; e.g. auto-encoders [9, 63] aim to minimize reconstruction error for modeling the inliers, and one-class classification (OCSVM [38], SVDD [46], etc.) aims to maximize margin to the origin or minimize the radius of a data-enclosing hyperball. There is also work on model selection for one-class models [7, 54], however, those are limited to this specific family of methods and do not apply in the general case. Our proposed METAOD is not limited to one specific model family, but can select among any (heterogeneous) set of detectors.
|
| 44 |
+
|
| 45 |
+
# 2.2 Model Selection in ML, AutoML, Meta-Learning
|
| 46 |
+
|
| 47 |
+
Model selection refers to the process of algorithm selection and/or hyperparameter optimization (HO). With the advent of complex (e.g. deep) models, HO in high dimensions has become impractical to be human-powered [59]. As such, automating ML pipelines has seen a surge of attention [18]. Meta-learning has been a key contributor to the AutoML effort [41, 49, 58].
|
| 48 |
+
|
| 49 |
+
Supervised Model Selection: Most existing work focus on the supervised setting, and use hold-out data with labels. Randomized [3], bandit-based [27], and Bayesian optimization (BO) techniques [40] are various state-of-the-art (SOTA) approaches to HO. Specifically sequential model-based BO [19, 22] evaluates hold-out performance at various initial hyperparameter configurations (HC), where a (smooth) surrogate function is fit to the resulting $\langle \mathrm { H C }$ , performancei pairs, which is then used to strategically query other HCs, e.g., via hyper-gradient based search [15]. Meta-learning has also been employed [13, 52], e.g., to find promising initialization for (i.e. warm-starting) BO [14, 51].
|
| 50 |
+
|
| 51 |
+
Note that all of these approaches rely on multiple model evaluations (i.e., performance queries) for various HCs, and hence cannot be applied to the unsupervised outlier model selection problem.
|
| 52 |
+
|
| 53 |
+
Unsupervised Model Selection: Unsupervised ML tasks (e.g., clustering) poses additional challenges for model selection [12, 47]. Nonetheless, those exhibit established objective criteria that enable model comparison, unlike OD. For example, BO methods still apply where the surrogate can be trained on hHC, objective valuei pairs, for which meta-learning can provide favorable priors.
|
| 54 |
+
|
| 55 |
+
Task-independent meta-learning [1], that simply identifies the globally best model on historical tasks, applies to the unsupervised setting and hence OD. This can be refined by identifying the best model on not all, but similar tasks, where task similarity is measured in the meta-feature space via clustering [23] or nearest neighbors [33]. This type of similarity-based recommendations points to a connection between algorithm selection and collaborative filtering (CF), first recognized by Stern et al. [44]. The most related to UOMS is CF under cold start, where evaluations are not-available (in our case, infeasible) for a new user (in our case, task). There have been a number of work using meta-learning for the cold-start recommendation problem [4, 26, 50], and vice versa, using CF solutions for ML algorithm selection [32, 56]. We tailor these to UOMS and compare to METAOD in the experiments.
|
| 56 |
+
|
| 57 |
+
# 3 Unsupervised Outlier Model Selection via Meta-learning
|
| 58 |
+
|
| 59 |
+
# 3.1 Problem Statement
|
| 60 |
+
|
| 61 |
+
We consider the model selection problem for unsupervised outlier detection, which we refer to as UOMS (unsupervised outlier model selection) hereafter. Given a new dataset, without any labels, the problem is to select both (i) a detector/algorithm and $( i i )$ its associated hyperparameter(s) (HP). The former is a discrete choice, given the finite set of existing detection algorithms. The latter is continuous, and hence induces infinitely many candidate models.
|
| 62 |
+
|
| 63 |
+
Under certain assumptions, such as performance changing smoothly in the HP space, a HP configuration can be selected iteratively based on evaluations on several other carefully-chosen configurations. Importantly however, OD is not amenable for such iterative search over models—evaluations are not possible due to the lack of labels and absence of a universal objective criterion. The selection of a model, therefore, is to be done without building or evaluating any model on the new dataset. Given this constraint, we discretize the HP space for each candidate detector to make the search space tractable, which induces a finite pool of models denoted $\pmb { \mathcal { M } } = \{ M _ { 1 } , \dots , M _ { m } \}$ . Each model $M \in \mathcal { M }$ can be seen as a $\{$ {detector, configuration $\}$ pair, where the configuration depicts a specific set of values for the detector’s HP(s). (See Appendix A for details.) Then, the UOMS problem is stated as follows:
|
| 64 |
+
|
| 65 |
+
Problem 1 (Unsupervised Outlier Model Selection (UOMS)) Given a new input dataset (i.e., detection task) $\mathbf { D } _ { t e s t } \bar { = } \left( \mathbf { X } _ { t e s t } \right)$ without any labels, Select a model $M \in \mathcal { M }$ to employ on $\mathbf { X } _ { t e s t }$ .
|
| 66 |
+
|
| 67 |
+
# 3.2 Proposed METAOD
|
| 68 |
+
|
| 69 |
+
In this work we consider the UOMS problem and propose a meta-learning based solution, leveraging past experience on historical detection tasks. As such, our METAOD relies on
|
| 70 |
+
|
| 71 |
+
• a collection of historical outlier detection datasets $\mathbf { \mathcal { D } } _ { \mathrm { t r a i n } } = \{ \mathbf { D } _ { 1 } , \dots , \mathbf { D } _ { n } \}$ , namely, a meta-train
|
| 72 |
+
database with ground truth labels, i.e., $\{ \mathbf { D } _ { i } = ( \mathbf { X } _ { i } , \mathbf { y } _ { i } ) \} _ { i = 1 } ^ { n }$ , and
|
| 73 |
+
• the historical performances of the pool of candidate models, $\mathbf { \mathcal { M } }$ , on the meta-train datasets. We denote by $\mathbf { P } \in \mathbb { R } ^ { n \times m }$ the performance matrix, where $\mathbf { P } _ { i j }$ corresponds to the $j$ -th model $M _ { j }$ ’s performance2 on the $i$ -th meta-train dataset $\mathbf { D } _ { i }$ .
|
| 74 |
+
|
| 75 |
+
Note that model performance can be evaluated on the historical meta-train datasets as they contain ground truth labels, which however is not the case for any newcoming task at test time.
|
| 76 |
+
|
| 77 |
+
Our METAOD consists of two-phases: offline (meta-)training of the meta-learner on $\pmb { \mathcal { D } } _ { \mathrm { t r a i n } }$ , and online prediction that enables unsupervised model selection at test time for $\mathbf { D _ { \mathrm { t e s t } } }$ . Arguably, the running time of the offline phase is not critical. In contrast, model selection for a newcoming task should incur small run-time overhead, as it precedes the actual building of the selected OD model. Fig. 1 summarizes the process and the major components of METAOD, where we highlight the components transferred from offline (meta-learning) to online stage (model selection) in blue. We also provide the detailed steps of METAOD in pseudo-code, for both meta-training (offline) and model selection (online), in Appendix D Algo. 1.
|
| 78 |
+
|
| 79 |
+
# 3.2.1 (Meta-)Training (Offline)
|
| 80 |
+
|
| 81 |
+
In principle, meta-learning carries over prior experience on a set of historical tasks to “do better” on a new task. Such improvement can be unlocked only if the new task resembles and thus can build on at least some of the historical tasks (such as learning ice-skating given prior experience with roller-blading), rather than representing completely unrelated phenomena. This entails defining an effective way to capture task similarity between an input task and the historical tasks at hand.
|
| 82 |
+
|
| 83 |
+
In machine learning, similarity between meta-train and test datasets are quantified through characteristic features of a dataset, also known as meta-features. Those typically capture statistical properties of the data distributions. (See survey [49] for various types of meta-features.)
|
| 84 |
+
|
| 85 |
+
To capture prior experience, METAOD first constructs the performance matrix $\mathbf { P }$ by running/building and evaluating all the $m$ models in our defined model space $\mathbf { \mathcal { M } }$ on all the $n$ meta-train datasets $\mathcal { D } _ { \mathrm { t r a i n } }$ .3 To capture task similarity, it then extracts a set of $d$ meta-features from each meta-train dataset, denoted by $\mathbf { M } = \psi ( \{ \mathbf { X } _ { 1 } ^ { \cdot } , \dots , \mathbf { X } _ { n } \} ) \in \mathbb { R } ^ { n \times d }$ where $\psi ( \cdot )$ depicts the feature extraction module. We defer the details on the meta-feature specifics to $\ S 3 . 3$ .
|
| 86 |
+
|
| 87 |
+
At this stage, it is easy to recognize the connection between the UOMS and the collaborative filtering (CF) under cold start problems. Simply put, meta-train datasets are akin to existing users in CF that have prior evaluations on a set of models that are akin to the item-set in CF. The test task is akin to a newcoming user with no prior evaluations (and in our case, no possible future evaluation either), which however exhibits some pre-defined features.
|
| 88 |
+
|
| 89 |
+
Capitalizing on this connection, we take a matrix factorization based approach where $\mathbf { P }$ is approximated by the dot product of what-we-call dataset matrix $\mathbf { U } \in \mathbb { R } ^ { n \times k }$ and model matrix $\mathbf { V } \in \mathbf { \hat { \mathbb { R } } } ^ { m \times k }$ The intent is to capture the inherent dataset-to-model affinity via the dot product similarity in the $k$ -dimensional latent space, such that $\mathbf { P } _ { i j } \approx \mathbf { U } _ { i } \mathbf { V } _ { j } ^ { \ T }$ where matrix subscript denotes the row.
|
| 90 |
+
|
| 91 |
+
What loss criterion is suitable for the factorization? In CF the typical goal is top- $k$ item recommendation. In METAOD, we aim to select the model with the best performance on a task which demands top-1 optimization. Therefore, we discard least squares and instead optimize the rank-based (row- or dataset-wise) discounted cumulative gain (DCG) [21],
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\operatorname* { m a x } _ { { \bf U } , { \bf V } } \ \sum _ { i = 1 } ^ { n } \mathrm { D C G } _ { i } ( { \bf P } _ { i } , { \bf U } _ { i } { \bf V } ^ { T } ) \ .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
The factorization is solved via alternating optimization, where initialization plays an important role for such non-convex problems. We find that initializing $\mathbf { U }$ , denoted $\mathbf { U } ^ { ( 0 ) }$ , based on meta-features facilitates stable training, potentially by hinting at inherent similarities among datasets as compared to random initialization. Specifically, an embedding function $\phi ( \cdot )$ is used to set $\mathbf { U } ^ { ( 0 ) } : = \phi ( \mathbf { M } )$ for $\phi : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { k }$ , $k < d$ . Details on objective criteria and optimization are deferred to $\ S 3 . 4$ .
|
| 98 |
+
|
| 99 |
+
By construction, matrix factorization is transductive. On the other hand, we would need $\mathbf { U } _ { \mathrm { t e s t } }$ to be able to estimate performances of the model set $\mathbf { \mathcal { M } }$ on a new dataset $\mathbf { X } _ { \mathrm { t e s t } }$ . To this end, one can learn an (inductive) multi-output regression model that maps the meta-features onto the latent features. We simplify by learning a regression function $f : \mathbb { R } ^ { \dot { k } } \mapsto \mathbb { R } ^ { k }$ that maps the (lower dimensional) embedding features $\phi ( \mathbf { M } )$ (which are also used to initialize U) onto the final optimized U. Note that this requires an inductive embedding function $\phi ( \cdot )$ to be applicable to newcoming datasets. In implementation, we use PCA for $\phi ( \cdot )$ and a random forest regressor for $f ( \cdot )$ although METAOD is flexible to accommodate any others provided they are inductive.
|
| 100 |
+
|
| 101 |
+
Remark: METAOD improves over the existing methods that use CF in machine learning model selection (see $\ S 2 . 2 )$ in two aspects. First, METAOD builds specialized landmarker features tailored for capturing outlying characteristics of a dataset, while the existing ML model selection mainly uses generic statistical features (see $\ S 3 . 3 )$ . Second, METAOD uses a customized (backpropagatable/smooth) rank-based loss in CF for more effective top-1 optimization (see $\ S 3 . 4$ ), while existing approaches mainly leverage mean squared loss (MSE).
|
| 102 |
+
|
| 103 |
+
# 3.2.2 Prediction for Unsupervised Model Selection (Online)
|
| 104 |
+
|
| 105 |
+
Meta-training stage yields the estimated functions $\psi ( \cdot ) , \phi ( \cdot )$ , and $f ( \cdot )$ as well as the model matrix $\mathbf { V } \in \mathbb { R } ^ { m \times k }$ , which we save for test time (See Fig. 1). Given a new dataset $\mathbf { X } _ { \mathrm { t e s t } }$ for OD, METAOD first computes the corresponding meta-features as $\mathbf { \bar { M } } _ { \mathrm { t e s t } } : = \psi ( \mathbf { X } _ { \mathrm { t e s t } } ) \in \mathbb { R } ^ { d }$ . Those are then embedded via $\phi ( \mathbf { M } _ { \mathrm { t e s t } } ) \in \mathbb { R } ^ { k }$ , which are regressed to obtain the latent features, i.e., $\mathbf { U } _ { \mathrm { t e s t } } : = f ( \phi ( \mathbf { M } _ { \mathrm { t e s t } } ) ) \in \mathbb { R } ^ { k }$ Model set performances are predicted as $\mathbf { P } _ { \mathrm { t e s t } } : = \mathbf { U } _ { \mathrm { t e s t } } \mathbf { V } ^ { T } \in \mathbb { R } ^ { m }$ . Finally, the model with the largest predicted performance is outputted as the selected model, that is,
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\arg \operatorname* { m a x } _ { j } ~ \langle ~ f ( \phi ( \psi ( { \bf X } _ { \mathrm { t e s t } } ) ) ) , { \bf V } _ { j } ~ \rangle ~ .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Remark: Notice that model selection by Eq. (2) for a newcoming dataset is solely based on its meta-features and other pre-trained components from meta-learning. It does not rely on ground-truth labels or any OD model evaluations, therefore, METAOD provides unsupervised outlier model selection. Further, it does not require choosing or tuning any values at test time, and hence is fully automatic. In terms of computation, test-time embedding by $\phi$ (PCA) and regression by $f$ (regression trees) take near-constant time given the small number of meta-features, embedding dimensions, and trees of fixed depth. Moreover, we use meta-features with computational complexity linear in the dataset size as we describe next.
|
| 112 |
+
|
| 113 |
+
# 3.3 Meta-Features for Outlier Detection
|
| 114 |
+
|
| 115 |
+
A key part of METAOD is the extraction of meta-features that capture the important characteristics of an arbitrary dataset. Existing outlier detection models have different methodological designs (e.g., density, distance, angle, etc. based) and different assumptions around the topology of outliers (e.g., global, local, clustered). As a result, we expect different models to perform differently depending on the input dataset and the nature of outliers it exhibits—hence no “winner”. In our meta-learning approach, the goal is to identify the datasets in the meta-train database that exhibit similar characteristics to a given test dataset, and focus on models that do well on those similar datasets. This is akin to recommending to a new user those items liked by similar users.
|
| 116 |
+
|
| 117 |
+
To this end, we extract meta-features that can be organized into two categories: (1) statistical features, and (2) landmarker features. Broadly speaking, the former captures statistical properties of the underlying data distributions; e.g., min, max, variance, skewness, covariance, etc. of the features and feature combinations. (See Appendix B Table 3 for the complete list.) These kinds of meta-features have been commonly used in the AutoML literature [5].
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 1: METAOD overview; components that transfer from offline (meta-learning) to online (model selection) phase shown in blue; namely, meta-feature extractors $( \psi )$ , embedding model $( \phi )$ , regressor $f$ , dataset matrix $\mathbf { U }$ , and model matrix $\mathbf { V }$ . For the online phase, the input dataset $\mathbf { X } _ { \mathrm { t e s t } }$ and the predicted model performance $\mathbf { P _ { \mathrm { t e s t } } }$ are denoted in yellow.
|
| 121 |
+
|
| 122 |
+
The optimal set of meta-features has been shown to be application-dependent [49]. Therefore, perhaps more important are the landmarker features, which are problem-specific, and aim to capture the outlying characteristics of a dataset. The idea is to apply a few of the fast, easy-to-construct OD models on a dataset and extract features from (i) the structure of the estimated OD model, and (ii) its output outlier scores. For the OD-specific landmarkers, we use four OD algorithms: iForest [31], HBOS [17], LODA [34], and PCA [20] (reconstruction error as outlier score). We choose the four OD algorithms due to their efficiency and diversity (as a group). First, they are all fast algorithms and able to handle large, high-dimensional datasets [2]. This makes the meta-feature generation efficient and practical in the real world. Second, these four OD algorithms as a group show decent diversity (i.e., internal detection mechanism) to capture rich outlying characteristics. Consider iForest as an example. It creates a set of what-is-called extremely randomized trees that define the model structure, from which we extract structural features such as average horizontal and vertical tree imbalance. As another example, LODA builds on random-projection histograms from which we extract features such as entropy. In addition, based on the list of outlier scores from these models, we compute features such as dispersion, max consecutive gap in the sorted order, etc. We elaborate on the details of the landmarker features in Appendix B.2.
|
| 123 |
+
|
| 124 |
+
# 3.4 Meta-Learning Objective and Training
|
| 125 |
+
|
| 126 |
+
# 3.4.1 Rank-based Criterion
|
| 127 |
+
|
| 128 |
+
A typical loss criterion for matrix factorization is the mean squared error (MSE), a.k.a. the Frobenius norm of the error matrix $\mathbf { P } - \mathbf { U } \mathbf { V } ^ { T }$ . While having nice properties from an optimization perspective, MSE does not (at least directly) concern with the ranking quality. In contrast, our goal is to rank the models for each dataset row-wise, as model selection concerns with picking the best possible model to employ. Therefore, we use a rank-based criterion called DCG from the information retrieval literature [21]. For a given ranking, DCG is given as
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\mathrm { D C G } = \sum _ { r } { \frac { b ^ { r e l } - 1 } { \log _ { 2 } ( r + 1 ) } }
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where rel_ $\cdot ^ { r }$ depicts the true relevance of the item ranked at the $r$ -th position and $b$ is a scalar (typically set to 2). In our setting, we use the performance of a model to reflect its true relevance to a dataset. As such, DCG for dataset $i$ is re-written as
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\mathrm { D C G } _ { i } = \sum _ { j = 1 } ^ { m } { \frac { b ^ { \mathbf { P } _ { i j } } - 1 } { \log _ { 2 } ( 1 + \sum _ { k = 1 } ^ { m } \mathbb { 1 } [ { \widehat { \mathbf { P } } } _ { i j } \leq { \widehat { \mathbf { P } } } _ { i k } ] ) } }
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
where $\widehat { \mathbf { P } } _ { i j } = \langle \mathbf { U } _ { i } , \mathbf { V } _ { j } \rangle$ is the predicted performance that dictates the ranking order. Intuitively, ranking high-performing models at the top leads to higher DCG, and a larger $b$ increases the emphasis on the quality of models at the higher rank positions.
|
| 141 |
+
|
| 142 |
+
A challenge with DCG is that it is not differentiable, unlike MSE, as it involves ranking/sorting. Specifically, the sum term in the denominator of Eq. (4) uses the (nonsmooth) indicator function to obtain the position of model $j$ as ranked by the estimated performances. We circumvent this challenge by replacing the indicator function by the (smooth) sigmoid approximation [16] as follows.
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathrm { D C G } _ { i } \approx \mathrm { s D C G } _ { i } = \sum _ { j = 1 } ^ { m } \frac { b ^ { \mathbf { P } _ { i j } } - 1 } { \log _ { 2 } ( 1 + \sum _ { k = 1 } ^ { m } \sigma ( \widehat { \mathbf { P } } _ { i k } - \widehat { \mathbf { P } } _ { i j } ) ) }
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
# 3.4.2 Initialization & Alternating Optimization
|
| 149 |
+
|
| 150 |
+
Overall we optimize the smoothed criterion, sDCG, over all meta-train datasets $\mathbf { \mathcal { D } } _ { \operatorname { t r a i n } } = \{ \mathbf { D } _ { i } \} _ { i = 1 } ^ { n }$ as
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\operatorname* { m i n } _ { \mathbf { U } , \mathbf { V } } L = - \sum _ { i = 1 } ^ { n } \mathrm { s D C G } _ { i } ( \mathbf { P } _ { i } , \mathbf { U } _ { i } \mathbf { V } ^ { T } ) \ ,
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
by alternatingly solving for $\mathbf { U }$ as we fix $\mathbf { V }$ (and vice versa) by gradient descent. We initialize $\mathbf { U }$ by leveraging the meta-features, which are embedded to a space with the same size as U. By capturing the latent similarities among the datasets, such an initialization not only accelerates convergence [62] but also facilitates convergence to a better local optimum. $\mathbf { V }$ is initialized from a unit Normal.
|
| 157 |
+
|
| 158 |
+
As we aim to maximize the total dataset-wise DCG, we make a pass over meta-train datasets one by one at each epoch. For brevity, we give the gradients for $\mathbf { U } _ { i }$ and $\mathbf { V } _ { j }$ in Eq.s (7) and (8), respectively.
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
{ \frac { \partial L } { \partial \mathbf { U } _ { i } } } = \ln { ( 2 ) } \sum _ { j = 1 } ^ { m } \left[ { \frac { b ^ { \mathbf { P } _ { i j } } - 1 } { \beta _ { j } ^ { i } \ln ^ { 2 } { ( \beta _ { j } ^ { i } ) } } } \sum _ { k \neq j } \sigma ( w _ { j k } ^ { i } ) { ( 1 - \sigma ( w _ { j k } ^ { i } ) ) } ( \mathbf { V } _ { k } - \mathbf { V } _ { j } ) \right]
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\frac { \partial L } { \partial \mathbf { V } _ { j } } = - \ln { ( 2 ) } \sum _ { j = 1 } ^ { m } \left[ \frac { b ^ { \mathbf { P } _ { i j } } - 1 } { \beta _ { j } ^ { i } \ln ^ { 2 } { ( \beta _ { j } ^ { i } ) } } { \sum _ { k \neq j } { \sigma } ( w _ { j k } ^ { i } ) } ( 1 - \sigma ( w _ { j k } ^ { i } ) ) \mathbf { U } _ { i } \right]
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $w _ { j k } ^ { i } = \langle \mathbf { U } _ { i } , ( \mathbf { V } _ { k } - \mathbf { V } _ { j } ) \rangle$ and $\begin{array} { r } { \beta _ { j } ^ { i } = \frac { 3 } { 2 } + \sum _ { k \neq j } \sigma ( w _ { j k } ^ { i } ) } \end{array}$ ; see derivations in Appendix C.
|
| 169 |
+
|
| 170 |
+
# 4 Experiments
|
| 171 |
+
|
| 172 |
+
# 4.1 Experiment Setting
|
| 173 |
+
|
| 174 |
+
Model Set and Evaluation. We pair 8 SOTA OD algorithms and their corresponding hyperparameters to compose a model set $\mathbf { \mathcal { M } }$ with 302 unique models. (See Appendix A Table 2 for the complete list.) We evaluate METAOD and the baselines on 2 testbeds introduced below, resp. with 100 and 62 datasets, via cross-validation where datasets are split into meta-train/test in each fold. For each testbed, we first generate the performance matrix $\mathbf { P }$ , by evaluating the models from $\mathbf { \mathcal { M } }$ against the benchmark datasets in the testbed. For randomized detectors (random-split trees/random projections/etc.), we run five independent trials and record the average performance. For consistency, all models are built using the PyOD library [61] on an Intel i7-9700 $@ 3 . 0 0$ GHz, 64GB RAM, 8-core workstation. We compare two methods statistically, using the pairwise Wilcoxon signed rank test on performances across datasets (significance level $p < 0 . 0 5$ ).
|
| 175 |
+
|
| 176 |
+
Testbed Setup. Meta-learning works well if a new task can leverage prior knowledge; e.g., mastering motorcycle can benefit from bike riding experience. As such, METAOD relies on the assumption that a newcoming test dataset shares similarity with some meta-train datasets. We create two testbeds with different train/test dataset similarity, to systematically study the effect of task similarity.
|
| 177 |
+
|
| 178 |
+
1. Proof-of-Concept (POC) testbed contains 100 datasets that form clusters of similar datasets, where 5 different detection tasks (“siblings”) are created from each one of 20 “mothersets”. 2. Stress Testing (ST) testbed consists of 62 independent datasets from 3 different public-domain OD dataset repositories , which exhibit relatively lower similarity to one another.
|
| 179 |
+
|
| 180 |
+
We refer to Appendix E for the complete list of datasets and details on testbed generation. Fig. 2 illustrates the differences between POC and ST testbeds, where the meta-features of their constituting datasets are embedded to 2-D by t-SNE [48]. By construction, POC consists of clusters and hence exhibits higher task/dataset similarity as compared to ST.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 2: 2-D embedding of datasets in (left) POC and (right) ST. POC exhibits higher task similarity, wherein “siblings” (marked by same color) form clusters. ST contains independent datasets with no apparent clusters.
|
| 184 |
+
|
| 185 |
+
Baselines. Being the first work for UOMS, METAOD does not have immediate competing baselines. Therefore we employ simple ideas and tailor some existing methods for comparison. We also create 2 variations of METAOD (marked with $\dagger .$ ) for ablation analysis.
|
| 186 |
+
|
| 187 |
+
In Appendix F we give detailed descriptions of all 10 baselines. Briefly, they are organized as follows: (i) no model selection always employs the same popular model, namely (1) LOF [6] or (2) iForest [31], or the ensemble of all the models called (3) Mega Ensemble (ME); (ii) simple metalearners include (4) Global Best (GB) that selects the model with the largest avg. performance across meta-train datasets, (5) ISAC [23] and (6) ARGOSMART (AS) [33]; and (iii) optimization-based meta-learners include (7) Supervised Surrogates (SS) [55] and (8) ALORS [32].
|
| 188 |
+
|
| 189 |
+
Variants of METAOD are (9) $\mathbf { \dagger M E T A O D \_ C }$ where performance and meta-feature matrices are concatenated as $\mathbf { C } = [ \mathbf { P } , \mathbf { M } ] \in \mathbb { R } ^ { n \times ( m + d ) }$ , before factorization, $\mathbf { C } \approx \mathbf { U } \mathbf { V } ^ { T }$ . Given a test dataset, zeroconcatenated meta-features are projected and reconstructed as $[ \widehat { \mathbf { P } } _ { \mathrm { t e s t } } ; \widehat { \mathbf { M } } _ { \mathrm { t e s t } } ] : = [ 0 \ldots 0 ; \mathbf { M } _ { \mathrm { n e w } } ] \mathbf { V } \mathbf { V } ^ { T }$ ; and (10) $\mathbf { \dagger M E T A O D \_ F }$ where $\mathbf { U }$ is fixed at $\phi ( \mathbf { M } )$ after the embedding step and only $\mathbf { V }$ is optimized.
|
| 190 |
+
|
| 191 |
+
Additionally, we report Empirical Upper Bound (EUB) (only) for POC, as the performance of the best model on a dataset’s 4 “siblings”; this (valuable) information is not available in practice–hence “upper bound”. For ST with lower task similarity, we include Random Selection (RS) as baseline.
|
| 192 |
+
|
| 193 |
+
# 4.2 POC Testbed Results
|
| 194 |
+
|
| 195 |
+
Testbed Setting. POC testbed is built to simulate the scenario where there are similar meta-train tasks to a given test task. We use the benchmark datasets4 by Emmott et al. [11], who created “childsets” from 20 independent “mothersets” by sampling. Consequently, the childsets generated from the same motherset using the same generation properties (e.g., the frequency of anomalies) can be deemed as “siblings” with large similarity. We build the POC testbed by using 5 siblings from each motherset, resulting in 100 datasets. We split them into 5 folds for cross-validation, each test fold containing 20 independent childsets without siblings.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 3: Comparison of avg. rank (lower is better) of methods w.r.t. performance across datasets in POC. Mean AP across datasets (higher is better) shown on lines. METAOD is the topperforming meta-learner, and comparable to EUB.
|
| 199 |
+
|
| 200 |
+
Results. In Fig. 3, we observe that METAOD is superior to all baseline methods w.r.t. the average rank and mean average precision (MAP), and performs comparably to the Empirical Upper Bound (EUB). Table 1 (left) shows that METAOD is the only meta-learner that is not significantly different from both EUB $( \mathbf { M A P = } 0 . 2 0 5 1 )$ ) and the $_ { 4 - t h }$ best model (0.2185). Moreover, METAOD is significantly better than the baselines that do not employ any model selection (LOF (0.1282), iForest (0.1536), and ME (0.1382)), as well as all the other meta-learners including GB (0.1524), ISAC (0.1658) and ALORS (0.1728). For the full POC evaluation, see Appendix G.1.
|
| 201 |
+
|
| 202 |
+
Averaging all models (ME) does not lead to good performance as one may expect. As shown in Fig. 3, ME is the worst baseline by average rank in the POC testbed. Using a single detector, e.g., iForest, is significantly better. This is mainly because some models perform poorly on any given dataset, and ensembling all the models indiscriminately draws overall performance down. Using selective ensembles [36] could be beneficial, however, ensembles of many models are expensive to build in practice. In contrast, METAOD is fast at test time and selects without building any models.
|
| 203 |
+
|
| 204 |
+
<table><tr><td>Ours</td><td>Baseline</td><td>p-value</td><td>Ours</td><td>Baseline</td><td>p-value</td></tr><tr><td>MetaOD MetaOD</td><td>EUB 4-th Best</td><td>0.0522 0.0929</td><td>MetaOD MetaOD</td><td>58-th Best RS</td><td>0.0517 0.0001</td></tr><tr><td>MetaOD</td><td>LOF</td><td>0.0013</td><td>MetaOD</td><td>LOF</td><td>0.0001</td></tr><tr><td>MetaOD</td><td>iForest</td><td>0.0090</td><td>MetaOD</td><td>iForest</td><td>0.1129</td></tr><tr><td>MetaOD</td><td></td><td>0.0004</td><td>MetaOD</td><td></td><td>0.0001</td></tr><tr><td></td><td>ME</td><td></td><td></td><td>ME</td><td></td></tr><tr><td>MetaOD</td><td>GB</td><td>0.0051</td><td>MetaOD</td><td>GB</td><td>0.0030</td></tr><tr><td>MetaOD</td><td>ISAC</td><td>0.0019</td><td>MetaOD</td><td>ISAC</td><td>0.0006</td></tr><tr><td>MetaOD</td><td>AS</td><td>0.2959</td><td>MetaOD</td><td>AS</td><td>0.0009</td></tr><tr><td>MetaOD</td><td>SS</td><td>0.7938</td><td>MetaOD</td><td>SS</td><td>0.0190</td></tr><tr><td>MetaOD</td><td>ALORS</td><td>0.0025</td><td>MetaOD</td><td>ALORS</td><td>0.0001</td></tr><tr><td>MetaOD</td><td>MetaOD_C</td><td>0.6874</td><td>MetaOD</td><td>MetaOD_C</td><td>0.0001</td></tr><tr><td>MetaOD</td><td>MetaOD_F</td><td>0.1165</td><td>MetaOD</td><td>MetaOD_F</td><td>0.0001</td></tr></table>
|
| 205 |
+
|
| 206 |
+
Meta-learners perform significantly better than methods without model selection. In particular, four meta-learners (METAOD, SS, METAOD_C, METAOD_F) significantly outperform single outlier detection methods (LOF and iForest) as well as the Mega Ensemble (ME) that averages all the models. METAOD respectively has $5 8 . 7 4 \%$ , $3 2 . 4 8 \%$ , and $4 7 . 2 5 \%$ higher MAP over LOF, iForest, and ME. These results signify the benefits of model selection.
|
| 207 |
+
|
| 208 |
+
Optimization-based meta learners generally perform better than simple meta learners. Top-3 meta learners by average rank (METAOD, SS, and METAOD_C) are all optimization-based and significantly outperform simple meta-learners like ISAC as shown in Fig. 3. Simple meta-learners weigh meta-features equally for task similarity, whereas others learn which meta-features matter (e.g., regression on meta-features), leading to better results. We find that METAOD respectively achieves $3 3 . 5 3 \%$ , $2 2 . 7 4 \%$ , and $4 . 7 3 \%$ higher MAP than simple meta-learners including GB, ISAC, and AS.
|
| 209 |
+
|
| 210 |
+
# 4.3 ST Testbed Results
|
| 211 |
+
|
| 212 |
+
Testbed Setting. When meta-train datasets lack similarity to the test dataset, it is hard to capitalize on prior experience. In the extreme case, meta-learning may not perform better than no-model-selection baselines, e.g., a single detector. To investigate the impact of the train/test similarity on meta-learning performance, we build the ST testbed that consists of 62 public-domain datasets from 3 different repositories (See Appendix E Table 4) with relatively low similarity as shown in Fig. 2. For evaluation on ST, we use leave-one-out cross validation; each time using 61 datasets as meta-train.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Table 1: Pairwise statistical test results between METAOD and baselines by Wilcoxon signed rank test. Statistically better method shown in bold (both marked bold if no significance). In (left) POC, METAOD is the only meta-learner with no diff. from both EUB and the 4- th best model. In (right) ST, METAOD is the only meta-learner with no statistical diff. from the $5 8 – t h$ best model. It is statistically better than all except iForest.
|
| 216 |
+
Figure 4: Comparison of avg. rank (lower is better) of methods w.r.t. performance across datasets in ST. Mean AP (higher is better) shown on lines. METAOD outperforms all baselines.
|
| 217 |
+
|
| 218 |
+
Results. For the ST testbed, METAOD still outperforms all baseline methods w.r.t. average rank and MAP as shown in Fig. 4. Table 1 (right) shows that METAOD (0.3382) could select, from a pool of 302, the model that is as good as the $5 8 – t h$ best model (top $20 \%$ ) per dataset (0.3513) in this challenging testbed. The comparable model changes from the $4 { - } t h$ best per dataset in POC to $5 8 – t h$ best in ST, which is expected due to the lower task similarity to leverage in ST. Notably, all other baselines are worse than the $8 0 { - } t h$ best model with statistical significance. Moreover, METAOD is significantly better than all baselines except iForest. Note that METAOD also significantly outperforms RS, showing that it is able to exploit the meta-train database despite limited task similarity and not simply resorting to random picking. These results suggest that METAOD is a good choice under various extent of similarity among train/test datasets. We refer to Appendix G.2 for detailed ST results on individual ST datasets.
|
| 219 |
+
|
| 220 |
+
Training stability affects performance for optimization-based methods. Notably, several optimization-based meta-learners, such as ALORS and METAOD_C, do not perform well for ST. We find that the training process of matrix factorization is not stable when latent similarities are weak. In METAOD, we employ two strategies that help stabilize the training. First, we leverage meta-feature based (rather than random) initialization. Second, we use cyclical learning rates that help escape saddle points for better local optima [43]. Consequently, METAOD (0.3382) significantly outperforms ALORS (0.2981) and METAOD_C (0.1946) with $1 3 . 4 5 \%$ and $7 3 . 7 9 \%$ higher MAP.
|
| 221 |
+
|
| 222 |
+
Global methods outperform local methods under limited task similarity. In ST, datasets are less similar and simple meta-learners that leverage task similarity locally often perform poorly. For example, AS selects the model based on the 1-NN, and is likely to fail if the most similar meta-train task is still quite dissimilar to the current task. Notably, the global meta-learner GB outperforms AS and ISAC. Note the opposite ordering among these methods in POC as shown in Fig. 3. In short, effectiveness of simple meta-learners tends to be sensitive to the train/test dataset similarity, which makes them hard to use in general. In contrast, METAOD performs well in both settings.
|
| 223 |
+
|
| 224 |
+
# 4.4 Runtime Analysis
|
| 225 |
+
|
| 226 |
+
Empowered by meta-training, METAOD (meta-feature generation and model selection) takes less than 1 second on most test datasets, as shown in Fig. 5, where it incurs negligible overhead relative to building/training the selected outlier model ${ \approx } 1 0 \%$ on avg.). Fig. 6 corroborates the statement by showing the comparison on the 10 largest datasets in POC.
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 5: METAOD running time at test time in sec.s (left), and percentage of time relative to building the selected model (right). Notice that it is fast, and incurs negligible computational overhead.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 6: Time for METAOD vs. training of the selected model (on 10 largest datasets in POC). METAOD incurs only negligible overhead (diff. shown w/ black arrows).
|
| 233 |
+
|
| 234 |
+
Notably, meta-feature extraction may be trivially parallelized whereas the model selection is even faster, e.g., using SUOD [60], effectively taking constant time (See $\ S 3 . 2 . 2 )$ .
|
| 235 |
+
|
| 236 |
+
# 5 Conclusion
|
| 237 |
+
|
| 238 |
+
We addressed the unsupervised outlier model selection (UOMS) problem without relying on any labels, model evaluations or comparisons for the first time. Our proposed METAOD is a meta-learner, and builds on an extensive pool of historical outlier detection datasets and models. Given a new task, it selects a model based on the past performances of models on similar historical tasks. To effectively capture task similarity, we designed novel problem-specific meta-features. Importantly, METAOD is $( i )$ fully automatic, requiring no supervision at test time, and $( i i )$ lightweight, incurring relatively small selection time overhead prior to outlier model building. Extensive experiments on two large testbeds showed that METAOD significantly improves detection performance over always using some of the most popular outlier models as well as several other meta-learners tailored for UOMS.
|
| 239 |
+
|
| 240 |
+
We open-source1 METAOD and our meta-learning database for use in practice. We expect metalearning to become more powerful as the meta-train database grows. Therefore, we also share all our code and testbeds with the community to stimulate further advances in automating UOMS. Future work can address UOMS in the continuous hyperparameter space, leverage self-aware learning [28] and conformal prediction [39] to estimate the confidence in selection, and explore the potential bias and fairness issues in OD model selection [10, 42].
|
| 241 |
+
|
| 242 |
+
References
|
| 243 |
+
[1] S. M. Abdulrahman, P. Brazdil, J. N. van Rijn, and J. Vanschoren. Speeding up algorithm selection using average ranking and active testing by introducing runtime. Mach. Learn., 107(1):79–108, 2018.
|
| 244 |
+
[2] C. C. Aggarwal. Outlier Analysis. Springer, 2013.
|
| 245 |
+
[3] J. Bergstra and Y. Bengio. Random search for hyper-parameter optimization. J. Mach. Learn. Res., 13:281–305, 2012.
|
| 246 |
+
[4] H. Bharadhwaj. Meta-learning for user cold-start recommendation. In IJCNN, pages 1–8. IEEE, 2019.
|
| 247 |
+
[5] B. Bilalli, A. Abelló Gamazo, and T. Aluja Banet. On the predictive power of meta-features in OpenML. International Journal of Applied Mathematics and Computer Science, 27(4):697–712, 2017.
|
| 248 |
+
[6] M. M. Breunig, H.-P. Kriegel, R. T. Ng, and J. Sander. LOF: Identifying density-based local outliers. In SIGMOD Conference, pages 93–104. ACM, 2000. SIGMOD Record 29(2), June 2000.
|
| 249 |
+
[7] E. Burnaev, P. Erofeev, and D. Smolyakov. Model selection for anomaly detection. In ICMV, volume 9875 of SPIE Proceedings, page 987525. SPIE, 2015.
|
| 250 |
+
[8] G. O. Campos, A. Zimek, J. Sander, R. J. G. B. Campello, B. Micenková, E. Schubert, I. Assent, and M. E. Houle. On the evaluation of unsupervised outlier detection: measures, datasets, and an empirical study. Data Min. Knowl. Discov., 30(4):891–927, 2016.
|
| 251 |
+
[9] J. Chen, S. Sathe, C. C. Aggarwal, and D. S. Turaga. Outlier detection with autoencoder ensembles. In SDM, pages 90–98. SIAM, 2017.
|
| 252 |
+
[10] I. Davidson and S. S. Ravi. A framework for determining the fairness of outlier detection. In G. D. Giacomo, A. Catalá, B. Dilkina, M. Milano, S. Barro, A. Bugarín, and J. Lang, editors, ECAI 2020 - 24th European Conference on Artificial Intelligence, 29 August-8 September 2020, Santiago de Compostela, Spain, August 29 - September 8, 2020 - Including 10th Conference on Prestigious Applications of Artificial Intelligence (PAIS 2020), volume 325 of Frontiers in Artificial Intelligence and Applications, pages 2465–2472. IOS Press, 2020.
|
| 253 |
+
[11] A. Emmott, S. Das, T. G. Dietterich, A. Fern, and W.-K. Wong. Anomaly detection meta-analysis benchmarks. 2016.
|
| 254 |
+
[12] X. Fan, Y. Yue, P. Sarkar, and Y. X. R. Wang. A unified framework for tuning hyperparameters in clustering problems. CoRR, abs/1910.08018, 2019.
|
| 255 |
+
[13] M. Feurer, B. Letham, and E. Bakshy. Scalable meta-learning for bayesian optimization. CoRR, abs/1802.02219, 2018.
|
| 256 |
+
[14] M. Feurer, J. T. Springenberg, and F. Hutter. Initializing bayesian hyperparameter optimization via meta-learning. In AAAI, pages 1128–1135. AAAI Press, 2015.
|
| 257 |
+
[15] L. Franceschi, M. Donini, P. Frasconi, and M. Pontil. Forward and reverse gradient-based hyperparameter optimization. In ICML, volume 70 of Proceedings of Machine Learning Research, pages 1165–1173. PMLR, 2017.
|
| 258 |
+
[16] J. Fréry, A. Habrard, M. Sebban, O. Caelen, and L. He-Guelton. Efficient top rank optimization with gradient boosting for supervised anomaly detection. In ECML/PKDD, volume 10534, pages 20–35, 2017.
|
| 259 |
+
[17] M. Goldstein and A. Dengel. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. KI-2012: Poster and Demo Track, pages 59–63, 2012.
|
| 260 |
+
[18] X. He, K. Zhao, and X. Chu. Automl: A survey of the state-of-the-art. Knowl. Based Syst., 212:106622, 2021.
|
| 261 |
+
[19] F. Hutter, H. H. Hoos, and K. Leyton-Brown. Sequential model-based optimization for general algorithm configuration. In C. A. C. Coello, editor, LION, volume 6683 of Lecture Notes in Computer Science, pages 507–523. Springer, 2011.
|
| 262 |
+
[20] T. Idé and H. Kashima. Eigenspace-based anomaly detection in computer systems. In W. Kim, R. Kohavi, J. Gehrke, and W. DuMouchel, editors, KDD, pages 440–449. ACM, 2004.
|
| 263 |
+
[21] K. Järvelin and J. Kekäläinen. Cumulated gain-based evaluation of IR techniques. ACM Transactions on Information Systems (TOIS), 20(4):422–446, 2002.
|
| 264 |
+
[22] D. R. Jones, M. Schonlau, and W. J. Welch. Efficient global optimization of expensive black-box functions. J. Global Optimization, 13(4):455–492, 1998.
|
| 265 |
+
[23] S. Kadioglu, Y. Malitsky, M. Sellmann, and K. Tierney. Isac - instance-specific algorithm configuration. In ECAI, volume 215 of Frontiers in Artificial Intelligence and Applications, pages 751–756. IOS Press, 2010.
|
| 266 |
+
[24] H.-P. Kriegel, M. Schubert, and A. Zimek. Angle-based outlier detection in high-dimensional data. In Y. Li, B. Liu, and S. Sarawagi, editors, KDD, pages 444–452. ACM, 2008.
|
| 267 |
+
[25] K. Lai, D. Zha, G. Wang, J. Xu, Y. Zhao, D. Kumar, Y. Chen, P. Zumkhawaka, M. Wan, D. Martinez, and X. Hu. TODS: an automated time series outlier detection system. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 16060–16062. AAAI Press, 2021.
|
| 268 |
+
[26] H. Lee, J. Im, S. Jang, H. Cho, and S. Chung. MeLU: Meta-learned user preference estimator for cold-start recommendation. In KDD, pages 1073–1082. ACM, 2019.
|
| 269 |
+
[27] L. Li, K. G. Jamieson, G. DeSalvo, A. Rostamizadeh, and A. Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. J. Mach. Learn. Res., 18:185:1–185:52, 2017.
|
| 270 |
+
[28] L. Li, M. L. Littman, T. J. Walsh, and A. L. Strehl. Knows what it knows: a framework for self-aware learning. Mach. Learn., 82(3):399–443, 2011.
|
| 271 |
+
[29] Y. Li, Z. Chen, D. Zha, K. Zhou, H. Jin, H. Chen, and X. Hu. Autood: Neural architecture search for outlier detection. In 37th IEEE International Conference on Data Engineering, ICDE 2021, Chania, Greece, April 19-22, 2021, pages 2117–2122. IEEE, 2021.
|
| 272 |
+
[30] Y. Li, D. Zha, P. K. Venugopal, N. Zou, and X. Hu. Pyodds: An end-to-end outlier detection system with automated machine learning. In A. E. F. Seghrouchni, G. Sukthankar, T. Liu, and M. van Steen, editors, Companion of The 2020 Web Conference 2020, Taipei, Taiwan, April 20-24, 2020, pages 153–157. ACM / IW3C2, 2020.
|
| 273 |
+
[31] F. T. Liu, K. M. Ting, and Z.-H. Zhou. Isolation forest. In ICDM, pages 413–422. IEEE Computer Society, 2008.
|
| 274 |
+
[32] M. Misir and M. Sebag. Alors: An algorithm recommender system. Artif. Intell., 244:291–314, 2017.
|
| 275 |
+
[33] M. Nikolic, F. Maric, and P. Janicic. Simple algorithm portfolio for sat. Artif. Intell. Rev., 40(4):457–465, 2013.
|
| 276 |
+
[34] T. Pevný. Loda: Lightweight on-line detector of anomalies. Mach. Learn., 102(2):275–304, 2016.
|
| 277 |
+
[35] S. Ramaswamy, R. Rastogi, and K. Shim. Efficient algorithms for mining outliers from large data sets. In W. Chen, J. F. Naughton, and P. A. Bernstein, editors, SIGMOD Conference, pages 427–438. ACM, 2000. SIGMOD Record 29(2), June 2000.
|
| 278 |
+
[36] S. Rayana and L. Akoglu. Less is more: Building selective anomaly ensembles. ACM Trans. Knowl. Discov. Data, 10(4):42:1–42:33, 2016.
|
| 279 |
+
[37] B. Schölkopf, J. C. Platt, J. Shawe-Taylor, A. J. Smola, and R. C. Williamson. Estimating the support of a high-dimensional distribution. Neural Computation, 13(7):1443–1471, July 2001.
|
| 280 |
+
[38] B. Schölkopf, R. C. Williamson, A. J. Smola, J. Shawe-Taylor, and J. C. Platt. Support vector method for novelty detection. In NIPS, pages 582–588. The MIT Press, 1999.
|
| 281 |
+
[39] G. Shafer and V. Vovk. A tutorial on conformal prediction. J. Mach. Learn. Res., 9:371–421, 2008.
|
| 282 |
+
[40] B. Shahriari, K. Swersky, Z. Wang, R. P. Adams, and N. de Freitas. Taking the human out of the loop: A review of bayesian optimization. Proc. IEEE, 104(1):148–175, 2016.
|
| 283 |
+
[41] R. E. Shawi, M. Maher, and S. Sakr. Automated machine learning: State-of-the-art and open challenges. CoRR, abs/1906.02287, 2019.
|
| 284 |
+
[42] S. Shekhar, N. Shah, and L. Akoglu. Fairod: Fairness-aware outlier detection. In M. Fourcade, B. Kuipers, S. Lazar, and D. K. Mulligan, editors, AIES ’21: AAAI/ACM Conference on AI, Ethics, and Society, Virtual Event, USA, May 19-21, 2021, pages 210–220. ACM, 2021.
|
| 285 |
+
[43] L. N. Smith. Cyclical learning rates for training neural networks. In WACV, pages 464–472. IEEE Computer Society, 2017.
|
| 286 |
+
[44] D. H. Stern, H. Samulowitz, R. Herbrich, T. Graepel, L. Pulina, and A. Tacchella. Collaborative expert portfolio management. In AAAI. AAAI Press, 2010.
|
| 287 |
+
[45] J. Tang, Z. Chen, A. W. Fu, and D. W. Cheung. Enhancing effectiveness of outlier detections for low density patterns. In PAKDD, volume 2336 of Lecture Notes in Computer Science, pages 535–548, 2002.
|
| 288 |
+
[46] D. M. J. Tax and R. P. W. Duin. Support vector data description. Mach. Learn., 54(1):45–66, 2004.
|
| 289 |
+
[47] S. Vaithyanathan and B. Dom. Generalized model selection for unsupervised learning in high dimensions. In NIPS, pages 970–976. The MIT Press, 1999.
|
| 290 |
+
[48] L. van der Maaten and G. Hinton. Visualizing high-dimensional data using t-sne. J. of Mach. Lear. Res., 9:2579–2605, 2008.
|
| 291 |
+
[49] J. Vanschoren. Meta-learning. In Automated Machine Learning, pages 35–61. Springer, 2019.
|
| 292 |
+
[50] M. Vartak, A. Thiagarajan, C. Miranda, J. Bratman, and H. Larochelle. A meta-learning perspective on cold-start recommendations for items. In NeurIPS, pages 6904–6914, 2017.
|
| 293 |
+
[51] M. Wistuba, N. Schilling, and L. Schmidt-Thieme. Learning hyperparameter optimization initializations. In DSAA, pages 1–10. IEEE, 2015.
|
| 294 |
+
[52] M. Wistuba, N. Schilling, and L. Schmidt-Thieme. Scalable gaussian process-based transfer surrogates for hyperparameter optimization. Mach. Learn., 107(1):43–78, 2018.
|
| 295 |
+
[53] D. H. Wolpert and W. G. Macready. No free lunch theorems for optimization. IEEE Trans. Evolutionary Computation, 1(1):67–82, 1997.
|
| 296 |
+
[54] Y. Xiao, H. Wang, L. Zhang, and W. Xu. Two methods of selecting gaussian kernel parameters for one-class SVM and their application to fault detection. Knowl. Based Syst., 59:75–84, 2014.
|
| 297 |
+
[55] L. Xu, F. Hutter, J. Shen, H. H. Hoos, and K. Leyton-Brown. Satzilla2012: Improved algorithm selection based on cost-sensitive classification models. Proceedings of SAT Challenge, pages 57–58, 2012.
|
| 298 |
+
[56] C. Yang, Y. Akimoto, D. W. Kim, and M. Udell. OBOE: collaborative filtering for AutoML model selection. In KDD, pages 1173–1183. ACM, 2019.
|
| 299 |
+
[57] L. Yang and A. Shami. On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing, 415:295–316, 2020.
|
| 300 |
+
[58] Q. Yao, M. Wang, H. J. Escalante, I. Guyon, Y. Hu, Y. Li, W. Tu, Q. Yang, and Y. Yu. Taking human out of learning applications: A survey on automated machine learning. CoRR, abs/1810.13306, 2018.
|
| 301 |
+
[59] T. Yu and H. Zhu. Hyper-parameter optimization: A review of algorithms and applications. CoRR, abs/2003.05689, 2020.
|
| 302 |
+
[60] Y. Zhao, X. Hu, C. Cheng, C. Wang, C. Wan, W. Wang, J. Yang, H. Bai, Z. Li, C. Xiao, Y. Wang, Z. Qiao, J. Sun, and L. Akoglu. SUOD: Accelerating large-scale unsupervised heterogeneous outlier detection. Proceedings of Machine Learning and Systems, 2021.
|
| 303 |
+
[61] Y. Zhao, Z. Nasrullah, and Z. Li. PyOD: A python toolbox for scalable outlier detection. J. Mach. Learn. Res., 20:96:1–96:7, 2019.
|
| 304 |
+
[62] Z. Zheng, J. Yang, and Y. Zhu. Initialization enhancer for non-negative matrix factorization. Eng. Appl. Artif. Intell., 20(1):101–110, 2007.
|
| 305 |
+
[63] C. Zhou and R. C. Paffenroth. Anomaly detection with robust deep autoencoders. In KDD, pages 665–674. ACM, 2017.
|
md/train/LXMSvPmsm0g/LXMSvPmsm0g.md
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LONG LIVE THE LOTTERY: THE EXISTENCE OF WINNING TICKETS IN LIFELONG LEARNING
|
| 2 |
+
|
| 3 |
+
Tianlong $\mathbf { C h e n ^ { 1 ^ { * } } }$ , Zhenyu Zhang2\*, Sijia $\mathbf { L i u } ^ { 3 , 4 }$ , Shiyu Chang4, Zhangyang Wang1 1University of Texas at Austin,2University of Science and Technology of China 3Michigan State University, 4MIT-IBM Watson AI Lab, IBM Research {tianlong.chen,atlaswang}@utexas.edu, zzy19969@mail.ustc.edu.cn liusiji5@msu.edu, shiyu.chang@ibm.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The lottery ticket hypothesis states that a highly sparsified sub-network can be trained in isolation, given the appropriate weight initialization. This paper extends that hypothesis from one-shot task learning, and demonstrates for the first time that such extremely compact and independently trainable sub-networks can be also identified in the lifelong learning scenario, which we call lifelong tickets. We show that the resulting lifelong ticket can further be leveraged to improve the performance of learning over continual tasks. However, it is highly non-trivial to conduct network pruning in the lifelong setting. Two critical roadblocks arise: i) As many tasks now arrive sequentially, finding tickets in a greedy weight pruning fashion will inevitably suffer from the intrinsic bias, that the earlier emerging tasks impact more; ii) As lifelong learning is consistently challenged by catastrophic forgetting, the compact network capacity of tickets might amplify the risk of forgetting. In view of those, we introduce two pruning options, e.g., top-down and bottom-up, for finding lifelong tickets. Compared to the top-down pruning that extends vanilla (iterative) pruning over sequential tasks, we show that the bottomup one, which can dynamically shrink and (re-)expand model capacity, effectively avoids the undesirable excessive pruning in the early stage. We additionally introduce lottery teaching that further overcomes forgetting via knowledge distillation aided by external unlabeled data. Unifying those ingredients, we demonstrate the existence of very competitive lifelong tickets, e.g., achieving $3 - 8 \%$ of the dense model size with even higher accuracy, compared to strong class-incremental learning baselines on CIFAR-10/CIFAR-100/Tiny-ImageNet datasets. Codes available at https://github.com/VITA-Group/Lifelong-Learning-LTH.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The lottery ticket hypothesis (LTH) (Frankle & Carbin, 2019) suggests the existence of an extremely sparse sub-network, within an overparameterized dense neural network, that can reach similar performance as the dense network when trained in isolation with proper initialization. Such a subnetwork together with the used initialization is called a winning ticket (Frankle & Carbin, 2019). The original LTH studies the sparse pattern of neural networks with a single task (classification), leaving the question of generalization across multiple tasks open. Following that, a few works (Morcos et al., 2019; Mehta, 2019) have explored LTH in transfer learning. They study the transferability of a winning ticket found in a source task to another target task. This provides insights on one-shot transferability of LTH. In parallel, lifelong learning not only suffers from notorious catastrophic forgetting over sequentially arriving tasks but also often comes at the price of increasing model capacity. With those in mind, we ask a much more ambitious question:
|
| 12 |
+
|
| 13 |
+
Does LTH hold in the setting of lifelong learning when different tasks arrive sequentially?
|
| 14 |
+
|
| 15 |
+
Intuitively, a desirable “ticket” sub-network in lifelong learning (McCloskey & Cohen, 1989; Parisi et al., 2019) needs to be: 1) independently trainable, same as the original LTH; 2) trained to perform competitively to the dense lifelong model, including both maintaining the performance of previous tasks, and quickly achieving good generalization at newly added tasks; 3) found online, as the tasks sequentially arrive without any pre-assumed order. We define such a sub-network with its initialization as a lifelong lottery ticket.
|
| 16 |
+
|
| 17 |
+
This paper seeks to locate the lifelong ticket in class-incremental learning (CIL) (Wang et al., 2017; Rosenfeld & Tsotsos, 2018; Kemker & Kanan, 2017; Li & Hoiem, 2017; Belouadah & Popescu, 2019; 2020), a popular, realistic and challenging setting of lifelong learning. A natural idea to extend the original LTH is to introduce sequential pruning: we continually prune the dense network until the desired sparsity level, as new tasks are incrementally added. However, we show that the direct application of the iterative magnitude pruning (IMP) used in LTH fails in the scenario of CIL since the pruning schedule becomes critical when tasks arrive sequentially. To circumvent this challenge, we generalize IMP to incorporate a curriculum pruning schedule. We term this technique top-down lifelong pruning. When the total number of tasks is pre-known and small, then with some “lottery” initialization (achieved by rewinding (Frankle et al., 2019) or similar), we find that the pruned sparse ticket can be re-trained to similar performance as the dense network. However, if the number of tasks keeps increasing, the above ticket will soon witness performance collapse as its limited capacity cannot afford the over-pruning.
|
| 18 |
+
|
| 19 |
+
The limitation of top-down lifelong pruning reminds us of two unique dilemmas that might challenge the validity of lifelong tickets. i) Greedy weight pruning v.s. all tasks’ performance: While the sequential pruning has to be performed online, its greedy nature inevitably biases against later arriving tasks, as earlier tasks apparently will contribute to shaping the ticket more (and might even use up the sparsity budget). ii) Catastrophic forgetting v.s. small ticket size: To overcome the notorious catastrophic forgetting (McCloskey & Cohen, 1989; Tishby & Zaslavsky, 2015), many lifelong learning models have to frequently consolidate weights to carefully re-assign the model capacity (Zhang et al., 2020) or even grow model size as tasks come in (Wang et al., 2017). Those seem to contradict our goal of pruning by seeing more tasks.
|
| 20 |
+
|
| 21 |
+
To address the above two limitations, we propose a novel bottom-up lifelong pruning approach, which allows for re-growing the model capacity to compensate for any excessive pruning. It therefore flexibly calibrates between increasing and decreasing tickets throughout the entire learning process, alleviating the intrinsic greedy bias caused by the top-down pruning. We additionally introduce lottery teaching to overcome forgetting, which regularizes previous task models’ soft logit outputs by using free unlabeled data. That is inspired by lifelong knowledge preservation techniques (Castro et al., 2018; He et al., 2018; Javed & Shafait, 2018; Rebuffi et al., 2017).
|
| 22 |
+
|
| 23 |
+
For validating our proposal, we conduct extensive experiments on CIFAR-10, CIFAR-100, and TinyImageNet datasets for class-incremental learning (Rebuffi et al., 2017). The results demonstrate the existence and the high competitiveness of lifelong tickets. Our best lifelong tickets (found by bottom-up pruning and lottery teaching) achieve comparable or better performance across all sequential tasks, with as few as $3 . 6 4 \%$ parameters, compared to state-of-the-art dense models. Our contributions can be summarized as:
|
| 24 |
+
|
| 25 |
+
• The problem of lottery tickets is formulated and studied in lifelong learning (class incremental learning) for the first time.
|
| 26 |
+
• Top-down pruning: a generalization of iterative weight magnitude pruning used in the original LTH over continual learning tasks.
|
| 27 |
+
• Bottom-up pruning: a novel pruning method, which is unique to allow for re-growing model capacity, throughout the lifelong process.
|
| 28 |
+
• Extensive experiments and analyses demonstrating the promise of lifelong tickets, in achieving superior yet extremely light-weight lifelong learners.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Lifelong Learning A lifelong learning system aims to continually learn sequential tasks and accommodate new information while maintaining previously learned knowledge (Thrun & Mitchell, 1995). One of its major challenges is called catastrophic forgetting (McCloskey & Cohen, 1989; Kirkpatrick et al., 2017; Hayes & Kanan, 2020), i.e., the network cannot maintain expertise on tasks that they have not experienced for a long time.
|
| 33 |
+
|
| 34 |
+
This paper’s study subject is class-incremental learning (CIL) (Rebuffi et al., 2017; Elhoseiny et al., 2018): a popular, realistic, albeit challenging setting of lifelong learning. CIL requires the model to recognize new classes emerging over time while maintaining recognizing ability over old classes without access to the previous data. Typical solutions are based on regularization (Li & Hoiem, 2017; Kirkpatrick et al., 2017; Zenke et al., 2017; Aljundi et al., 2018a; Ebrahimi et al., 2019), for example, knowledge distillation (Hinton et al., 2015) is a common regularizer to inherit previous knowledge through preserving soft logits of those samples (Li & Hoiem, 2017) while learning new tasks. Besides, several approaches are learning with memorized data (Castro et al., 2018; Javed & Shafait, 2018; Rebuffi et al., 2017; Belouadah & Popescu, 2019; 2020; Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2018). And some generative lifelong learning methods (Liu et al., 2020; Shin et al., 2017) mitigate catastrophic forgetting by generating simulated data of previous tasks. There also exist a few architecture-manipulation-based lifelong learning methods (Rajasegaran et al., 2019; Aljundi et al., 2018b; Hung et al., 2019; Abati et al., 2020; Rusu et al., 2016; Kemker & Kanan, 2017), while their target is dividing a dense model into task-specific parts for lifelong learning, rather than localizing sparse networks and the lottery tickets.
|
| 35 |
+
|
| 36 |
+
Pruning and Lottery Ticket Hypothesis It is well-known that deep networks could be pruned of excess capacity (LeCun et al., 1990b). Pruning algorithms can be categorized into unstructured (Han et al., 2015b; LeCun et al., 1990a; Han et al., 2015a) and structured pruning (Liu et al., 2017; He et al., 2017; Zhou et al., 2016). The former sparsifies weight elements based on magnitudes, while the latter removes network sub-structures such as channels for more hardware friendliness.
|
| 37 |
+
|
| 38 |
+
LTH (Frankle & Carbin, 2019) advocates the existence of an independently trainable sparse subnetwork from a dense network. In addition to image classification (Frankle & Carbin, 2019; Liu et al., 2019; Wang et al., 2020; Evci et al., 2019; Frankle et al., 2020; Savarese et al., 2020; You et al., 2020; Ma et al., 2021; Chen et al., 2020a), LTH has been explored widely in numerous contexts, such as natural language processing (Gale et al., 2019; Chen et al., 2020b), reinforcement learning (Yu et al., 2019), generative adversarial networks (Chen et al., 2021b), graph neural networks (Chen et al., 2021a), and adversarial robustness (Cosentino et al., 2019). Most of them adopt unstructured weight magnitude pruning (Han et al., 2015a; Frankle & Carbin, 2019) to obtain the ticket, which we also follow in this work. (Frankle et al., 2019) analyzes large models and datasets, and presents a rewinding technique that re-initializes ticket training from the early training stage rather than from scratch. (Renda et al., 2020) further compares different retraining techniques and endorses the effectiveness of rewinding. (Mehta, 2019; Morcos et al., 2019; Desai et al., 2019) pioneer to study the transferability of the ticket identified on one source task to another target task, which delivers insights on one-shot transferability of LTH.
|
| 39 |
+
|
| 40 |
+
One latest work (Golkar et al., 2019) aimed at lifelong learning in fixed-capacity models based on pruning neurons of low activity. The authors observed that a controlled way of “graceful forgetting” after training each task can regain network capacity for new tasks, meanwhile not suffering from forgetting. Sokar et al. (2020) further compresses the sparse connections of each task during training, which reduces the interference between tasks and alleviates forgetting.
|
| 41 |
+
|
| 42 |
+
# 3 LOTTERY TICKET FROM SINGLE-TASK LEARNING TO CIL
|
| 43 |
+
|
| 44 |
+
# 3.1 PROBLEM SETUP
|
| 45 |
+
|
| 46 |
+
In CIL, a model continuously learns from a sequential data stream in which new tasks (namely, classification tasks with new classes) are added over time, as shown in Figure 1. At the inference stage, the model can operate without having access to the information of task IDs. Following (Castro et al., 2018; He et al., 2018; Rebuffi et al., 2017), a handful of samples from previous classes are stored in a fixed memory buffer.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 1: Basic CIL Setting.
|
| 50 |
+
|
| 51 |
+
More formally, let $\mathcal { T } _ { 1 } , \mathcal { T } _ { 2 } , \cdots$ represent a sequence of tasks, and the ith task $\mathcal { T } _ { i }$ contains data that fall into $\left( k _ { i } - k _ { i - 1 } \right)$ classes $\mathcal { C } _ { i } = \{ c _ { k _ { i - 1 } + 1 } , c _ { k _ { i - 1 } + 2 } , \cdot \cdot \cdot , c _ { k _ { i } } \}$ , where $k _ { 0 } = 0$ by convention. Let $\Theta ^ { ( i ) } = \{ \pmb { \theta } ^ { ( i ) } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } \}$ denote the model of the learner used at task $i$ , where $\pmb \theta ^ { ( i ) }$ corresponds to the base model cross all tasks from $\mathcal { T } _ { 1 }$ to $\mathcal { T } _ { i }$ , and $\pmb { \theta } _ { \mathrm { c } } ^ { ( i ) }$ denotes the task-specific classification head at $\mathcal { T } _ { i }$ .
|
| 52 |
+
|
| 53 |
+
Thus, the size of $\pmb \theta ^ { ( i ) }$ is fixed, but the dimension of $\theta _ { \mathrm { c } } ^ { ( i ) }$ aligns with the number of classes, which have been seen at $\mathcal { T } _ { i }$ . In general, the learner has access to two types of information at task $i$ : the current training data $\mathcal { D } ^ { ( i ) }$ , and certain previous information $\mathscr { P } ^ { ( i ) }$ . The latter includes a small amount of data from previous tasks $\{ \mathcal T _ { j } \} _ { 1 } ^ { i - 1 }$ stored in the memory buffer, and the previous model $\Theta ^ { ( i - 1 ) }$ at task $\mathcal { T } _ { i - 1 }$ . This is commonly used to overcome the catastrophic forgetting issue of the current task $i$ against the previous tasks. Based on the aforementioned setting, we state the CIL problem as below.
|
| 54 |
+
|
| 55 |
+
Problem of CIL. At the current task $i$ , we aim to learn a full model $\Theta ^ { ( i ) } = \{ \pmb { \theta } ^ { ( i ) } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } \}$ based on the information $( \mathcal { D } ^ { ( i ) } , \mathcal { P } ^ { ( i ) } )$ such that $\Theta ^ { ( i ) }$ not only $( I )$ yields the generalization ability to the newly added data at task $\mathcal { T } _ { i }$ but also $( I I )$ does not lose its power to the previous tasks $\{ \mathcal { T } _ { j } \} _ { 1 } ^ { i - 1 }$ .
|
| 56 |
+
|
| 57 |
+
We note that the aforementioned problem statement applies to CIL with any fixed-length learning period. That is, for $n$ time stamps (one task per time), the validity of the entire trajectory $\{ \Theta ^ { ( i ) } \} _ { 1 } ^ { n }$ is justified by each $\Theta ^ { ( i ) }$ from the CIL criteria $( I )$ and $( I I )$ stated in ‘Problem of CIL’.
|
| 58 |
+
|
| 59 |
+
# 3.2 LIFELONG LOTTERY TICKETS
|
| 60 |
+
|
| 61 |
+
It was shown by LTH (Frankle & Carbin, 2019) that a standard (unstructured) pruning technique can uncover the so-called winning ticket, namely, a sparse sub-network together with proper initialization that can be trained in isolation and reach similar performance as the dense network. In this paper, we aim to prune the base model $\pmb \theta ^ { ( i ) }$ over time. And we ask: Do there exist winning tickets in lifelong learning? If yes, how to obtain them? To answer these questions, a prerequisite is to define the notion of lottery tickets in lifelong learning, which we call lifelong lottery tickets.
|
| 62 |
+
|
| 63 |
+
Following LTH (Frankle & Carbin, 2019), a lottery ticket consists of two parts: 1) a binary mask $\mathbf { m } \in \{ 0 , 1 \} ^ { \| \pmb { \theta } ^ { ( i ) } \| _ { 0 } }$ obtained from a one-shot or iterative pruning algorithm, and 2) initial weights or rewinding weights $\theta _ { 0 }$ . The ticket $( \mathbf { m } , \theta _ { 0 } )$ is a winning ticket if training the subnetwork $\mathbf { m } \odot \pmb { \theta } _ { 0 }$ ( $\odot$ denotes element-wise product), identified by the sparse pattern m with initialization $\pmb { \theta } _ { 0 }$ , wins the initialization lottery to match the performance of the original (fully trained) network. In CIL, at the presence of sequential tasks $\{ \mathcal { T } ^ { ( i ) } \} _ { i = 1 , 2 , \dots }$ , we define lifelong lottery tickets $( \mathbf { m } ^ { ( i ) } , \pmb { \theta } _ { 0 } ^ { ( i ) } )$ recursively from the perspective of dynamical system:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \mathbf { m } ^ { ( i ) } = \mathbf { m } ^ { ( i - 1 ) } + A ( \mathcal { D } ^ { ( i ) } , \mathcal { P } ^ { ( i ) } , \mathbf { m } ^ { ( i - 1 ) } ) , \quad \mathrm { a n d } \quad \pmb { \theta } _ { 0 } ^ { ( i ) } \in \{ \pmb { \theta } ^ { ( 0 ) } , \pmb { \theta } _ { \mathrm { r w } } ^ { ( i ) } \} , } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathcal { A }$ denotes a pruning algorithm used at the current task $\mathscr { T } ^ { ( i ) }$ based on the information $\mathcal { D } ^ { ( i ) }$ , $\mathscr { P } ^ { ( i ) }$ and $\mathbf { m } ^ { ( i - 1 ) }$ , $\pmb { \theta } ^ { ( 0 ) }$ denotes the initialization prior to training the model at $\tau ^ { ( 1 ) }$ , and $\theta _ { \mathrm { r w } } ^ { ( i ) }$ denotes a rewinding point at $\mathscr { T } ^ { ( i ) }$ . In Eq. (1), we interpret the (non-trivial) pruning operation $\mathcal { A }$ by weight perturbations, with values drawn from $\{ - 1 , 0 , 1 \}$ , to the previous binary mask. Here $- 1$ denotes the removal of a weight, 0 signifies to keep a weight intact, and 1 represents the addition of a weight. Moreover, the introduction of weight rewinding is spurred by the so-called rewinding ticket (Renda et al., 2020; Frankle et al., 2020). For example, if $\begin{array} { r } { \bar { \pmb { \theta } } _ { \mathrm { r w } } ^ { ( i ) } = \bar { \pmb { \theta } } ^ { ( i - 1 ) } } \end{array}$ , then we pick the model weights learnt at the previous task $\mathcal { T } ^ { ( i - 1 ) }$ to initialize the training at $\mathscr { T } ^ { ( i ) }$ . We also note that $\pmb { \theta } ^ { ( 0 ) }$ can be regarded as the point rewound to the earliest stage of the lifelong learning. Based on Eq. (1), we then state the definition of winning tickets in CIL.
|
| 70 |
+
|
| 71 |
+
Lifelong winning tickets. Given a sequence of tasks $\{ \mathcal { T } _ { i } \} _ { 1 } ^ { n }$ , the lifelong lottery tickets $\{ ( \mathbf { m } ^ { ( i ) } , \pmb { \theta } _ { 0 } ^ { ( i ) } ) \} _ { 1 } ^ { n }$ given by $( l )$ are winning tickets if they can be trained in isolation to match the CIL performance (i.e., criteria I and II) of the corresponding full model $\{ \pmb { \theta } ^ { ( i ) } \} _ { 1 } ^ { n }$ , where $n \in \mathbb { N } ^ { + }$ .
|
| 72 |
+
|
| 73 |
+
In the next section, we will design the lifelong pruning algorithm $\mathcal { A }$ , together with ticket initialization schemes formulated in Eq. (1)
|
| 74 |
+
|
| 75 |
+
# 4 PROPOSED PRUNING METHOD TO FIND LIFELONG WINNING TICKETS
|
| 76 |
+
|
| 77 |
+
4.1 REVISITING IMP OVER SEQUENTIAL TASKS: TOP-DOWN (TD) PRUNING
|
| 78 |
+
|
| 79 |
+
In order to find the potential tickets at the current task $\mathscr { T } ^ { ( i ) }$ , it is natural to specify $\mathcal { A }$ in Eq. (1) as the iterative magnitude pruning (IMP) algorithm (Han et al., 2015a) to prune the model from $\mathbf { m } ^ { ( i - 1 ) } \odot \pmb \theta ^ { ( i - 1 ) }$ . Following (Frankle & Carbin, 2019; Renda et al., 2020), IMP iteratively prunes $p ^ { \frac { 1 } { n ^ { ( i ) } } }$ $( \% )$ non-zero weights of $\mathbf { m } ^ { ( i - 1 ) } \odot \pmb \theta ^ { ( i - 1 ) }$ over $\boldsymbol { n } ^ { ( i ) }$ rounds at $\mathscr { T } ^ { ( i ) }$ . Thus, the number of nonzero weights in the obtained mask $\mathbf { m } ^ { ( i ) }$ is given by $( ( 1 - p ^ { \frac { 1 } { n ^ { ( i ) } } } ) ^ { n ^ { ( i ) } } \cdot \| \mathbf { m } ^ { ( i - 1 ) } \| _ { 0 } )$ . However, in the application of IMP to the sequential tasks $\{ \mathcal T ^ { ( i ) } \}$ , we find that the schedule of IMP over sequential tasks, in terms of $\{ n ^ { ( i ) } \}$ , is critical to make pruning successful in lifelong learning. We refer readers to Appendix A2.1 for detailed justifications.
|
| 80 |
+
|
| 81 |
+
Curriculum schedule of TD pruning is a key to success The conventional method is to set $\{ n ^ { ( i ) } \}$ as a uniform schedule, namely, IMP prunes a fixed portion of non-zeros at each task. However, this direct application fails quickly as the number of incremental tasks increases, implying that “not all tasks are created equal” in the learning/pruning schedule. Inspired by the recent observation that training with more classes helps consolidate a more robust sparse model (Morcos et al., 2019), we propose a curriculum pruning schedule, in which IMP is conducted more aggressively for new tasks arriving later, with $n ^ { ( \bar { i } ) } \geq n ^ { ( i - 1 ) }$ , until reaching the desired sparsity. For example, if there are 12 times of pruning on five sequentially arrived tasks, we arrange them in a linearly increasing way, i.e., $( { T _ { 1 } } \colon 1 , { T _ { 2 } } \colon 1 , { T _ { 3 } } \colon 2 , { T _ { 4 } } \colon 3 , { T _ { 5 } } \colon 5 )$ . Note that TD pruning relies on the heuristic curriculum schedule, and thus inevitably greedy and suboptimal over continual learning tasks. In what follows, we propose a more advanced pruning scheme, bottom-up (BU) pruning, that obeys a different principle of design.
|
| 82 |
+
|
| 83 |
+
# 4.2 BOTTOM-UP (BU) LIFELONG PRUNING: AN ADVANCED SCHEME
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 2: Framework of our proposed bottom-up (BU) lifelong pruning which is based on sparse model consolidation. Tickets founded by BU pruning keep expanding for each newly added task.
|
| 87 |
+
|
| 88 |
+
Why we need more than top-down pruning? TD pruning is inevitably greedy and suboptimal. Earlier added tasks contribute more to shaping the final mask, due to the nested dependency between intermediate masks. In the later training stage, we often observe the network is already too heavily pruned to learn more tasks. Inspired by the recently proposed model consolidation (Zhang et al., 2020), we propose the BU alternative of lifelong pruning, to dynamically compensate for the excessive pruning by re-growing previously reduced networks.
|
| 89 |
+
|
| 90 |
+
Full reference model & rewinding point For BU lifelong pruning, we maintain a full (unpruned) model $\theta _ { \mathrm { r e f } } ^ { ( i ) }$ as a reference throughout lifelong learning. First, $\theta _ { \mathrm { r e f } } ^ { ( i ) }$ provides a reference performance $\mathcal { R } _ { \mathrm { r e f } } ^ { ( i ) }$ obtained at $\mathscr { T } ^ { ( i ) }$ . Once the validation accuracy of the current sparse model is no worse than the reference performance, the sparse model is considered to still have sufficient capacity and can be further pruned. Otherwise, capacity expansion is needed. On the other hand, the reference model offers a rewinding point for network parameters, which preserves knowledge of all previous tasks prior to $\mathscr { T } ^ { ( i ) }$ . It naturally extends the rewinding concept (Frankle et al., 2019) to lifelong learning.
|
| 91 |
+
|
| 92 |
+
BU pruning method BU lifelong pruning expands the previous mask $\mathbf { \delta } _ { m } ( i - 1 )$ to $\mathbf { m } ^ { ( i ) }$ . Different from TD pruning, the model size grows along the task sequence, namely, $\| \mathbf { m } ^ { ( i ) } \| _ { 0 } \geq \| \mathbf { m } ^ { ( i - 1 ) } \| _ { 0 }$ . Thus, BU pruning enforces $\mathcal { A }$ in Eq. (1) to draw non-negative perturbations. As illustrated in Figure 2, for each newly added $\tau _ { i }$ , we first re-train the previous sparse model $\mathbf { m } ^ { ( i - 1 ) } \odot \pmb \theta ^ { ( i - 1 ) }$ under the current information $( \mathcal { D } ^ { ( i ) } , \mathcal { P } ^ { ( i ) } )$ and calculate the validation accuracy $\mathcal { R } ^ { ( i ) }$ . If $\mathcal { R } ^ { ( i ) }$ is above than the reference performance $\mathcal { R } _ { \mathrm { r e f } } ^ { ( i ) }$ , we proceed to keep the sparse mask $\mathbf { m } ^ { ( i ) } = \mathbf { m } ^ { ( i - 1 ) }$ intact and use re-trained $\pmb \theta ^ { ( i - 1 ) }$ as $\pmb \theta ^ { ( i ) }$ at $\mathcal { T } _ { i }$ . Otherwise, an expansion from $\mathbf { m } ^ { ( i - 1 ) }$ is required to ensure sufficient learning capacity. To do so, we restart from the full reference model $\theta _ { \mathrm { r e f } } ^ { ( i ) }$ and iteratively prune its weights using IMP until the performance gets just below $\mathcal { R } _ { \mathrm { r e f } } ^ { ( i ) }$ . Here the previous non-zero weights localized by $\mathbf { m } ^ { ( i - 1 ) }$ are excluded from the pruning scope of IMP but the values of those non-zero weights could be re-trained. As a result, IMP will yield the updated mask $\mathbf { m } ^ { ( i ) }$ with a larger size than $\mathbf { m } ^ { ( i - 1 ) }$ . We repeat the aforementioned BU pruning method when a new task arrives.
|
| 93 |
+
|
| 94 |
+
Although never observed in our CIL experiments, a potential corner case of expansion is that the ticket size may hit the size of the full model. We consider this as an artifact of limited model capacity and suggest future work of combining lifelong tickets with (full) model growing (Wang et al., 2017).
|
| 95 |
+
|
| 96 |
+
Ticket initialization Given the pruning mask found by the BU (or TD) pruning method, we next determine the initialization scheme of a lifelong ticket. We consider three specifications of $\pmb { \theta } _ { 0 } ^ { ( i ) }$ in Eq. (1) to initialize the sparse model $\mathbf { m } ^ { ( i ) }$ for re-training the found tickets. They include: (I) $\pmb { \theta } _ { 0 } ^ { ( i ) } = \pmb { \theta } ^ { ( 0 ) }$ , i.e., the original “from the same random” initialization (Frankle & Carbin, 2019), (II) a random re-initialization $\theta _ { \mathrm { r e i n i t } }$ which is independent of $\pmb { \theta } ^ { ( 0 ) }$ , and (III) previous-task rewinding, i.e., $\pmb { \theta } _ { 0 } ^ { ( i ) } = \pmb { \theta } ^ { ( i - 1 ) }$ . The initialization schemes I-III together with $\mathbf { m } ^ { ( i ) }$ yield the following tickets $\mathbf { m } ^ { ( i ) }$ at $\mathscr { T } ^ { ( i ) }$ : (1) BU (or TD) tickets, namely, $\mathbf { m } ^ { ( i ) }$ found by BU (or TD) pruning with initialization I; (2) random BU (or TD) tickets, namely, $\mathbf { m } ^ { ( i ) }$ with initialization II; (3) task-rewinding BU (or TD) tickets, namely, $\mathbf { m } ^ { ( i ) }$ with initialization III. In experiments, we will show that both $B U \left( o r T D \right)$ tickets and their task-rewinding $( T R )$ counterparts are winning tickets, which outperform unpruned full CIL models. Compared BU with TD pruning, TR-BU tickets surpass the best $T D$ tickets.
|
| 97 |
+
|
| 98 |
+
# 4.3 LOTTERY TEACHING: A PLUG-IN REGULARIZATION
|
| 99 |
+
|
| 100 |
+
Catastrophic forgetting poses a severe challenge to class-incremental learning, especially for compact models. (Castro et al., 2018; He et al., 2018; Javed & Shafait, 2018; Rebuffi et al., 2017) are early attempts for undertaking the forgetting dilemma by introducing knowledge distillation regularization (Hinton et al., 2015), which employs a handful of stored previous data in addition to new task data. (Zhang et al., 2020) takes advantage of unlabeled data to handle the forgetting quandary.
|
| 101 |
+
|
| 102 |
+
We adapt their philosophy (Li & Hoiem, 2017; Hinton et al., 2015; Zhang et al., 2020) to presenting lottery teaching, enforcing previous information into the new tickets via a knowledge distillation term on external unlabeled data. Lottery teaching consists of two steps: i) we query more similar unlabeled data “for free” from a public source, by utilizing a small number of prototype samples from previous tasks’ training data. In this way, the storage required for previous tasks could be minimal, while the queried surrogate data functions similarly for our purpose; ii) we then enforce the output soft logits of the current subnetwork $\{ \mathbf { m } ^ { ( i ) } { \odot } \pmb { \theta } ^ { ( i ) } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } \}$ on each queried unlabeled sample $\mathbf { x }$ to be close to the logits from previously trained subnetwork $\{ \mathbf { m } ^ { ( i - 1 ) } \odot \pmb \theta ^ { ( i - 1 ) } , \pmb \theta _ { \mathrm { c } } ^ { ( i - 1 ) } \}$ , via knowledge distillation (KD) regularization based on the ${ \mathrm { K } } { \mathrm { - } } { \mathrm { L } }$ divergence. For all experiments of our methods hereinafter, we by default append the lottery teaching as it is widely beneficial. An ablation study will also follow in Section 5.3.
|
| 103 |
+
|
| 104 |
+
# 5 EXPERIMENTS
|
| 105 |
+
|
| 106 |
+
Experimental Setup We briefly discuss the key facts used in our experiments and refer readers to Appendix A2.3 for more implementation details. We evaluate our proposed lifelong tickets on three datasets: CIFAR-10, CIFAR-100, and Tiny-ImageNet. We adopt ResNet18 (He et al., 2016) as our backbone. We evaluate the model performance by standard testing accuracy (SA) averaged over three independent runs.
|
| 107 |
+
|
| 108 |
+
CIL baseline: We consider a strong baseline framework derived from (Zhang et al., 2019), a recent state-of-the-art (SOTA) method introduced for imbalanced data training (see more illustrations in Appendix A1.1). We implement (Zhang et al., 2019) for CIL, and compare with two latest CIL
|
| 109 |
+
|
| 110 |
+
SOTAs: iCaRL (Rebuffi et al., 2017) and IL2M (Belouadah & Popescu, 2019)1. Our results demonstrate the adapted CIL method from (Zhang et al., 2019) outperforms the others significantly, $( 1 . 6 5 \%$ SA better than IL2M and $4 . 8 8 \%$ SA better than iCaRL on CIFAR-10)2, establishing a new SOTA bar. The proposed lottery teaching further improves the performance of the baseline adapted from Zhang et al. (2019), given by $4 . 4 \%$ SA improvements on CIFAR-10. Thus, we use (Zhang et al., 2019), combined with/without lottery teaching, to train the original (unpruned) CIL model.
|
| 111 |
+
|
| 112 |
+
CIL pruning: To the best of our knowledge, we are not aware of any effective CIL pruning baseline comparable to ours. Thus, we focus on the comparison among different variants of our methods. We also compare the proposal with the ordinary IMP, showing its incapability in CIL pruning. Furthermore, we demonstrate that given our proposed pruning frameworks, standard pruning methods such as IMP and $\ell _ { 1 }$ pruning (by imposing $\ell _ { 1 }$ sparsity regularization) then turn to be successful.
|
| 113 |
+
|
| 114 |
+
Results on TD tickets We begin by showing that TD pruning is non-trivial in CIL. We find that the ordinary IMP (Han et al., 2015a) fails: It leads to $1 0 . 2 1 \%$ SA degradation (from $7 2 . 7 9 \%$ to $6 2 . 5 8 \%$ for SA) with $4 . 4 0 \%$ parameters left. By contrast, our proposed lifelong tickets yield substantially better performance which even surpasses the full dense model, with fewer parameters left than the ordinary IMP (Han et al., 2015a).
|
| 115 |
+
|
| 116 |
+
In what follows, We evaluate TD lifelong pruning using different weight rewindings, namely, i) $T D$ tickets; ii) random TD tickets; iii) task-rewinding TD tickets; iv) late-rewinding $T D$ tickets; and v) Fine-tuning. The late-rewinding tickets is a strong baseline claimed in Mehta (2019).
|
| 117 |
+
|
| 118 |
+
Figure 3 and Table A4 demonstrate the high competitiveness of our proposed TD ticket (blue lines). It matches and most of the time outperforms the full model3 (black dash lines). Even with only $6 . 8 7 \%$ model parameters left, the TD ticket still surpasses the dense model by $0 . 4 9 \%$ SA. The task-rewinding tickets, in second place, exceeds the dense model until reaching the extreme sparsity of $4 . 4 0 \%$ . Moreover, we see late-rewinding TD tickets dominate over other rewinding/fine-tuning options, echoing the finding in single-task learning (Frankle et al., 2019).
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Evaluation performance (standard accuracy) of top-down lifelong tickets on CIFAR-10.
|
| 122 |
+
|
| 123 |
+
However, TD pruning cannot afford a lot more incremental tasks due to its greedy weight (over)pruning. Our results show that $T D$ tickets pruned from only tasks $\mathcal { T } _ { 1 }$ and $\mathcal { T } _ { 2 }$ clearly overfit the first two tasks, even after incrementally learning the remaining three tasks. In this inappropriate pruning schedule (in contrast to $\mathcal { T } _ { 1 } \sim \mathcal { T } _ { 5 }$ scheme), the resultant ticket drops to $5 9 . 2 8 \%$ SA which is $1 3 . 5 1 \%$ lower than the dense model, as shown in Table A3. More results can be found in the appendix. Therefore, bottom-up lifelong pruning is proposed, as a remedy for relieving laborious tuning of pruning schedules.
|
| 124 |
+
|
| 125 |
+
Results on BU lifelong tickets The bottom-up lifelong pruning allows the sparse network to regret if they could not deal with the newly added tasks, which compensates for the excessive pruning and reaches a substantially better trade-off between sparsity and generalization ability. Compared to TD pruning, it does not require any heuristic pruning schedules.
|
| 126 |
+
|
| 127 |
+
In Table 1, we first present the performance of $B U$ tickets, random BU tickets, and task-rewinding BU (TR-BU) tickets, as mentioned in Section 4.2. As we can see, TR-BU tickets obtain the supreme performance. A possible explanation is that task-rewinding (i.e., $\pmb { \theta } _ { 0 } ^ { ( i ) } = \pmb { \theta } ^ { ( i - 1 ) } )$ maintains full information of learned tasks which mitigates the catastrophic forgetting, while other weight rewinding points lack sufficient task information to prevent compact models from forgetting. Next, we observe that TR-BU tickets significantly outperform the full dense model by $0 . 5 \hat { 2 } \%$ SA with only $3 . 6 4 \%$ parameters left and $\ell _ { 1 }$ BU tickets obtain matched performance to the full dense model with $5 . 1 6 \%$ remaining parameters. It suggests that IMP, $\ell _ { 1 }$ and even other adequate pruning algorithms can be plugged into our proposed BU pruning framework to identify the lifelong tickets.
|
| 128 |
+
|
| 129 |
+
Table 1: Comparison results across full dense model, BU Tickets with different ticket initialization, and $\ell _ { 1 } \ : B U$ Tickets when training incrementally on CIFAR-10. $\mathcal { T } _ { 1 \sim i }$ denotes the learned sequential tasks $\mathcal { T } _ { 1 } \sim \mathcal { T } _ { i }$ .
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Dataset Settings</td><td colspan="5">CIFAR-10 (Standard Accuracy /Remaining Weights </td></tr><tr><td></td><td>Ti (%)/100%</td><td>Ti~2 (%)/100%</td><td>Ti~3 (%)/100%</td><td>T1~4 (%)/100%</td><td>Ti~5 (%)/100%</td></tr><tr><td>Full Dense Model</td><td>97.75</td><td>89.10</td><td>82.83</td><td>76.99</td><td>72.79</td></tr><tr><td></td><td>Ti (%) / 2.81%</td><td>T1~2 (%)/3.11%</td><td>T1~3 (%)/3.40%</td><td>T1~4 (%)/3.64%</td><td>T1~5 (%)/3.64%</td></tr><tr><td rowspan="3">BU tickets random BU tickets TR-BU tickets</td><td>98.05</td><td>86.77</td><td>75.87</td><td>70.81</td><td>68.77</td></tr><tr><td>96.55</td><td>82.08</td><td>77.97</td><td>72.84</td><td>71.17</td></tr><tr><td>98.05</td><td>88.90</td><td>81.37</td><td>74.66</td><td>73.31</td></tr><tr><td></td><td>T1 (%)/1.80%</td><td>T1~2 (%)/2.93%</td><td>T1~3 (%) / 2.93%</td><td>T1~4 (%)/4.05%</td><td>T1~5 (%)/5.16%</td></tr><tr><td>lBU tickets</td><td>96.80</td><td>87.05</td><td>77.58</td><td>74.53</td><td>72.88</td></tr></table>
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 4: Performance and sparsity comparison between TR-BU tickets and $T D$ tickets when training models incrementally. Left: CIFAR-10. Right: CIFAR-100. Upper: Comparison of SA. Bottom: Comparison of remaining weights in tickets. Above all, tickets located by TD pruning continue to shrink with the growth of incremental tasks. On the contrary, tickets founded by BU pruning keep expanding for each newly added task.
|
| 135 |
+
|
| 136 |
+
In Figure 4, we present the performance comparison between TR-BU tickets (the best subnetworks in Table 1) and TD tickets. TR-BU tickets are identified through bottom-up lifelong pruning, whose sparse masks continue to subtly grow along with the incremental tasks, from sparsity $2 . 8 \mathrm { i } \%$ at the first task to sparsity $3 . 6 4 \%$ at the last task. As we can see, at any incremental learning stage, TR-BU tickets attain a superior performance with significantly fewer parameters. Particularly, after learning all tasks, TR-BU tickets surpass $T D$ tickets by $1 . 0 1 \%$ SA with $0 . 7 6 \%$ fewer weights on CIFAR-10; $3 . 0 7 \%$ with $2 . 4 6 \%$ fewer weights on CIFAR-100. Results demonstrate TR-BU tickets have a better generalization ability and parameter-efficiency compared with $T D$ tickets. In addition, on TinyImageNet in Table A7, TR-BU tickets outperform full model with only $1 2 . 0 8 \%$ remaining weights. It is worth to mention that both TR-BU tickets and TD tickets have a superior performance than full dense model. We refer readers to Table A5 and A6 in the appendix for more detailed results.
|
| 137 |
+
|
| 138 |
+
From the above results, we further observe that TR-BU tickets achieve comparable accuracy to full models which have more than $\mathbf { 3 0 } \times$ times in network capacity, implying that bottom-up lifelong pruning successfully discovers extremely sparse sub-networks, and yet they are powerful enough to inherit previous knowledge and generalize well on newly added tasks. Furthermore, our proposed lifelong pruning schemes can be directly plugged into other CIL models to identify the lifelong ticket, as shown in Appendix A1.
|
| 139 |
+
|
| 140 |
+
Ablation studies In what follows, we summarize our results on ablation studies and refer readers to the appendix A1.2.1 for more details. In Figure 5, we show the essential role of the curriculum schedule in TD pruning compared to the uniform pruning schedule. We notice that the curriculum pruning scheme generates stronger $T D$ tickets than the uniform pruning in terms of accuracy, which confirms our motivation that pruning heavier in the late stage of lifelong learning with more classes is beneficial. In Table A8, we demonstrate the effectiveness of our proposals against different numbers of incremental tasks. In the Figure 5, we show that lottery teaching injects previous knowledge through applying knowledge distillation on external unlabeled data, and greatly alleviates the catastrophic forgetting issue in lifelong pruning (i.e., after learning all tasks, utilizing lottery teaching obtains a $\bar { 4 . 3 4 \% }$ SA improvement on CIFAR-10). It is worth mentioning that we set a buffer of fixed storage capacity to store 128 unlabeled images queried from public sources at each training iteration. We find that leveraging newly queried unlabeled data offers a better generalization-ability than storing historical data in past tasks. The latter only reaches $7 0 . 6 0 \%$ SA on CIFAR-10, which is $2 . 1 9 \%$ worse than the use of unlabeled data.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 5: Left: the results of $T D$ Tickets with/without lottery teaching. Right: the comparison of $T D$ tickets $( 1 0 . 7 4 \% )$ obtained from uniform and curriculum pruning schedule. Experiments are conducted on CIFAR-10.
|
| 144 |
+
|
| 145 |
+
# 6 CONCLUSION
|
| 146 |
+
|
| 147 |
+
We extend the Lottery Ticket Hypothesis to lifelong learning, in which networks incrementally learn from sequential tasks. We pose top-down and bottom-up lifelong pruning algorithms to identify lifelong tickets. Systematical experiments are conducted to validate that located tickets obtain strong(er) generalization ability across all incremental learned tasks, compared with unpruned models. Our future work aims to explore lifelong tickets with the (full) model growing approach.
|
| 148 |
+
|
| 149 |
+
# REFERENCES
|
| 150 |
+
|
| 151 |
+
Davide Abati, Jakub Tomczak, Tijmen Blankevoort, Simone Calderara, Rita Cucchiara, and Babak Ehteshami Bejnordi. Conditional channel gated networks for task-aware continual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3931–3940, 2020.
|
| 152 |
+
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, 2018a.
|
| 153 |
+
Rahaf Aljundi, Marcus Rohrbach, and Tinne Tuytelaars. Selfless sequential learning. arXiv preprint arXiv:1806.05421, 2018b.
|
| 154 |
+
Anonymous. Why lottery ticket wins? a theoretical perspective of sample complexity on sparse neural networks. In Submitted to International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $=$ 8pz6GXZ3YT. under review.
|
| 155 |
+
Eden Belouadah and Adrian Popescu. Il2m: Class incremental learning with dual memory. In The IEEE International Conference on Computer Vision (ICCV), October 2019.
|
| 156 |
+
Eden Belouadah and Adrian Popescu. Scail: Classifier weights scaling for class incremental learning. In The IEEE Winter Conference on Applications of Computer Vision, pp. 1266–1275, 2020.
|
| 157 |
+
Francisco M Castro, Manuel J Mar´ın-Jimenez, Nicol ´ as Guil, Cordelia Schmid, and Karteek Alahari. ´ End-to-end incremental learning. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 233–248, 2018.
|
| 158 |
+
|
| 159 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018.
|
| 160 |
+
|
| 161 |
+
Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, and Zhangyang Wang. The lottery tickets hypothesis for supervised and self-supervised pre-training in computer vision models. arXiv preprint arXiv:2012.06908, 2020a.
|
| 162 |
+
|
| 163 |
+
Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The lottery ticket hypothesis for pre-trained bert networks. arXiv preprint arXiv:2007.12223, 2020b.
|
| 164 |
+
|
| 165 |
+
Tianlong Chen, Yongduo Sui, Xuxi Chen, Aston Zhang, and Zhangyang Wang. A unified lottery ticket hypothesis for graph neural networks, 2021a.
|
| 166 |
+
|
| 167 |
+
Xuxi Chen, Zhenyu Zhang, Yongduo Sui, and Tianlong Chen. $\{ \mathrm { G A N } \} \mathrm { s }$ can play lottery tickets too. In International Conference on Learning Representations, 2021b. URL https: //openreview.net/forum?id $=$ 1AoMhc_9jER.
|
| 168 |
+
|
| 169 |
+
Justin Cosentino, Federico Zaiter, Dan Pei, and Jun Zhu. The search for sparse, robust neural networks. arXiv preprint arXiv:1912.02386, 2019.
|
| 170 |
+
|
| 171 |
+
Shrey Desai, Hongyuan Zhan, and Ahmed Aly. Evaluating lottery tickets under distributional shifts. arXiv preprint arXiv:1910.12708, 2019.
|
| 172 |
+
|
| 173 |
+
Sayna Ebrahimi, Mohamed Elhoseiny, Trevor Darrell, and Marcus Rohrbach. Uncertainty-guided continual learning with bayesian neural networks. arXiv preprint arXiv:1906.02425, 2019.
|
| 174 |
+
|
| 175 |
+
Mohamed Elhoseiny, Francesca Babiloni, Rahaf Aljundi, Marcus Rohrbach, Manohar Paluri, and Tinne Tuytelaars. Exploring the challenges towards lifelong fact learning. In Asian Conference on Computer Vision, pp. 66–84. Springer, 2018.
|
| 176 |
+
|
| 177 |
+
Utku Evci, Fabian Pedregosa, Aidan Gomez, and Erich Elsen. The difficulty of training sparse neural networks. arXiv preprint arXiv:1906.10732, 2019.
|
| 178 |
+
|
| 179 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ rJl-b3RcF7.
|
| 180 |
+
|
| 181 |
+
Jonathan Frankle, Gintare Karolina Dziugaite, Daniel M Roy, and Michael Carbin. The lottery ticket hypothesis at scale. arXiv preprint arXiv:1903.01611, 2019.
|
| 182 |
+
|
| 183 |
+
Jonathan Frankle, David J. Schwab, and Ari S. Morcos. The early phase of neural network training. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } = \underline { { \underline { { \mathbf { \delta \pi } } } } } .$ Hkl1iRNFwS.
|
| 184 |
+
|
| 185 |
+
Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
|
| 186 |
+
|
| 187 |
+
Siavash Golkar, Michael Kagan, and Kyunghyun Cho. Continual learning via neural pruning. arXiv preprint arXiv:1903.04476, 2019.
|
| 188 |
+
|
| 189 |
+
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.
|
| 190 |
+
|
| 191 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1135–1143. Curran Associates, Inc., 2015b.
|
| 192 |
+
|
| 193 |
+
Tyler L Hayes and Christopher Kanan. Lifelong machine learning with deep streaming linear discriminant analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 220–221, 2020.
|
| 194 |
+
|
| 195 |
+
Chen He, Ruiping Wang, Shiguang Shan, and Xilin Chen. Exemplar-supported generative reproduction for class incremental learning. In British Machine Vision Conference, 2018.
|
| 196 |
+
|
| 197 |
+
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.
|
| 198 |
+
|
| 199 |
+
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.
|
| 200 |
+
|
| 201 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 202 |
+
|
| 203 |
+
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.
|
| 204 |
+
|
| 205 |
+
Khurram Javed and Faisal Shafait. Revisiting distillation and incremental classifier learning. In Asian Conference on Computer Vision, pp. 3–17. Springer, 2018.
|
| 206 |
+
|
| 207 |
+
Ronald Kemker and Christopher Kanan. Fearnet: Brain-inspired model for incremental learning. arXiv preprint arXiv:1711.10563, 2017.
|
| 208 |
+
|
| 209 |
+
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, 114(13):3521–3526, 2017.
|
| 210 |
+
|
| 211 |
+
A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 212 |
+
|
| 213 |
+
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.
|
| 214 |
+
|
| 215 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In D. S. Touretzky (ed.), Advances in Neural Information Processing Systems 2, pp. 598–605. Morgan-Kaufmann, 1990a. URL http://papers.nips.cc/paper/250-optimal-brain-damage.pdf.
|
| 216 |
+
|
| 217 |
+
Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pp. 598–605, 1990b.
|
| 218 |
+
|
| 219 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
|
| 220 |
+
|
| 221 |
+
Xialei Liu, Chenshen Wu, Mikel Menta, Luis Herranz, Bogdan Raducanu, Andrew D Bagdanov, Shangling Jui, and Joost van de Weijer. Generative feature replay for class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 226–227, 2020.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $=$ rJlnB3C5Ym.
|
| 226 |
+
|
| 227 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in neural information processing systems, pp. 6467–6476, 2017.
|
| 228 |
+
|
| 229 |
+
Haoyu Ma, Tianlong Chen, Ting-Kuei Hu, Chenyu You, Xiaohui Xie, and Zhangyang Wang. Good students play big lottery better. arXiv preprint arXiv:2101.03255, 2021.
|
| 230 |
+
|
| 231 |
+
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.
|
| 232 |
+
|
| 233 |
+
Rahul Mehta. Sparse transfer learning via winning lottery tickets. arXiv preprint arXiv:1905.07785, 2019.
|
| 234 |
+
|
| 235 |
+
Ari Morcos, Haonan Yu, Michela Paganini, and Yuandong Tian. One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers. In Advances in Neural Information Processing Systems, pp. 4933–4943, 2019.
|
| 236 |
+
|
| 237 |
+
German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 2019.
|
| 238 |
+
|
| 239 |
+
Jathushan Rajasegaran, Munawar Hayat, Salman H Khan, Fahad Shahbaz Khan, and Ling Shao. Random path selection for continual learning. In Advances in Neural Information Processing Systems, pp. 12669–12679, 2019.
|
| 240 |
+
|
| 241 |
+
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, 2017.
|
| 242 |
+
|
| 243 |
+
Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id ${ . } = { }$ S1gSj0NKvB.
|
| 244 |
+
|
| 245 |
+
Amir Rosenfeld and John K Tsotsos. Incremental learning through deep adaptation. IEEE transactions on pattern analysis and machine intelligence, 2018.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Pedro Savarese, Hugo Silva, and Michael Maire. Winning the lottery with continuous sparsification, 2020. URL https://openreview.net/forum?id ${ . } = { }$ BJe4oxHYPB.
|
| 250 |
+
|
| 251 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pp. 2990–2999, 2017.
|
| 252 |
+
|
| 253 |
+
Ghada Sokar, Decebal Constantin Mocanu, and Mykola Pechenizkiy. Spacenet: Make free space for continual learning. arXiv preprint arXiv:2007.07617, 2020.
|
| 254 |
+
|
| 255 |
+
Sebastian Thrun and Tom M Mitchell. Lifelong robot learning. Robotics and autonomous systems, 15(1-2):25–46, 1995.
|
| 256 |
+
|
| 257 |
+
Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In 2015 IEEE Information Theory Workshop (ITW), pp. 1–5. IEEE, 2015.
|
| 258 |
+
|
| 259 |
+
Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE transactions on pattern analysis and machine intelligence, 30(11):1958–1970, 2008.
|
| 260 |
+
|
| 261 |
+
Chaoqi Wang, Guodong Zhang, and Roger Grosse. Picking winning tickets before training by preserving gradient flow. arXiv preprint arXiv:2002.07376, 2020.
|
| 262 |
+
|
| 263 |
+
Yu-Xiong Wang, Deva Ramanan, and Martial Hebert. Growing a brain: Fine-tuning by increasing model capacity. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2471–2480, 2017.
|
| 264 |
+
|
| 265 |
+
Haoran You, Chaojian Li, Pengfei Xu, Yonggan Fu, Yue Wang, Xiaohan Chen, Richard G. Baraniuk, Zhangyang Wang, and Yingyan Lin. Drawing early-bird tickets: Toward more efficient training of deep networks. In International Conference on Learning Representations, 2020. URL https: //openreview.net/forum?id $=$ BJxsrgStvr.
|
| 266 |
+
|
| 267 |
+
Haonan Yu, Sergey Edunov, Yuandong Tian, and Ari S Morcos. Playing the lottery with rewards and multiple languages: lottery tickets in rl and nlp. arXiv preprint arXiv:1906.02768, 2019.
|
| 268 |
+
|
| 269 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. Proceedings of machine learning research, 70:3987, 2017.
|
| 270 |
+
|
| 271 |
+
Junjie Zhang, Lingqiao Liu, Peng Wang, and Chunhua Shen. To balance or not to balance: A simple-yet-effective approach for learning with long-tailed distributions. arXiv, pp. arXiv–1912, 2019.
|
| 272 |
+
|
| 273 |
+
Junting Zhang, Jie Zhang, Shalini Ghosh, Dawei Li, Serafettin Tasci, Larry Heck, Heming Zhang, and C-C Jay Kuo. Class-incremental learning via deep model consolidation. In The IEEE Winter Conference on Applications of Computer Vision, pp. 1131–1140, 2020.
|
| 274 |
+
|
| 275 |
+
Hao Zhou, Jose M Alvarez, and Fatih Porikli. Less is more: Towards compact cnns. In European Conference on Computer Vision, pp. 662–677. Springer, 2016.
|
| 276 |
+
|
| 277 |
+
# A1 MORE EXPERIMENT RESULTS
|
| 278 |
+
|
| 279 |
+
# A1.1 MORE BASELINE RESULTS
|
| 280 |
+
|
| 281 |
+
Comparison with the Latest CIL SOTAs We find (Zhang et al., 2019) can be naturally introduced to class-incremental learning, which tackles the intrinsic training bias between a handful of previously stored data and a large amount of newly added data. It adopts random and class-balanced sampling strategies, combined with an auxiliary classifier, to alleviate the negative impact from imbalanced classes. Extensive results, shown in Table A2, demonstrates that adopting (Zhang et al., 2019) as the simple baseline surpasses previous SOTAs iCaRL (Rebuffi et al., 2017) and IL2M (Belouadah & Popescu, 2019) by a significant performance margin $( 1 . 6 5 \% / 0 . 5 7 \%$ SA better than IL2M and $4 . 8 8 \% / 7 . 6 0 \%$ SA better than iCaRL on CIFAR-10/CIFAR-100, respectively)4, establishing a new SOTA bar. With the assistance of lottery teaching, (Zhang et al., 2019) obtains an extra performance boost, $4 . 4 \%$ SA on CIFAR-10 and $7 . 3 4 \%$ SA on CIFAR-100.
|
| 282 |
+
|
| 283 |
+
It is worth mentioning that a lifelong ticket also exists in other CIL models. Take IL2M on CIFAR-10 as an example, bottom-up (BU) ticket achieves accuracy $6 8 . 9 2 \%$ with $1 1 . 9 7 \%$ parameters vs. the dense unpruned model with an accuracy of $6 6 . 7 4 \%$ .
|
| 284 |
+
|
| 285 |
+
Table A2: Comparison between our dense model and two previous SOTA CIL methods on CIFAR10 and CIFAR-100. Reported performance it the final accuracy for each task $\tau$ . Simple baseline donates the dense CIL model (Zhang et al., 2019). Full model represents our proposed framework which combines lottery teaching technique with the simple baseline.
|
| 286 |
+
|
| 287 |
+
<table><tr><td colspan="3">Methods</td><td>T1 (%)</td><td>T2 (%)</td><td>T(%)</td><td></td><td>T4 (%)</td><td>T5 (%)</td><td>Average (%)</td><td></td></tr><tr><td colspan="3"></td><td>76.45 78.20</td><td>79.00 64.05</td><td>75.70 60.40</td><td></td><td>50.85 38.95</td><td>35.55 92.10</td><td>63.51 66.74</td><td></td></tr><tr><td colspan="3">Simple Baseline Full Model</td><td>75.05</td><td>71.50</td><td>54.25</td><td></td><td>52.05</td><td>89.10</td><td>68.39</td><td></td></tr><tr><td colspan="3">CIFAR-100</td><td>79.70</td><td>79.12</td><td></td><td>68.23</td><td>63.45</td><td>73.43</td><td>72.79</td><td></td></tr><tr><td colspan="2">Methods iCaRL</td><td>T1(%) T(%)</td><td>T (%)</td><td>T4(%)</td><td>T5(%)</td><td>T6(%)</td><td>T7(%)</td><td>T8 (%)</td><td>Tg(%) T10 (%)</td><td>Average (%)</td></tr><tr><td colspan="2">IL2M</td><td>5.90 7.50 19.90</td><td>4.50</td><td>2.80</td><td>9.00</td><td>8.00</td><td>28.20</td><td>38.50</td><td>59.60 80.20 40.30</td><td>24.42 31.45</td></tr><tr><td colspan="2">Simple Baseline</td><td>24.10</td><td>19.80</td><td>12.90</td><td>21.30</td><td>21.70</td><td>29.90</td><td>34.80</td><td>89.80</td><td></td></tr><tr><td colspan="2">Full Model</td><td>21.20 32.10 29.04</td><td>23.00</td><td>22.70</td><td>21.70</td><td>31.70</td><td>39.60</td><td>33.80</td><td>54.30</td><td>32.02</td></tr><tr><td colspan="2"></td><td></td><td></td><td></td><td></td><td></td><td></td><td>40.20</td><td></td><td></td></tr><tr><td colspan="2"></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="2"></td><td></td><td></td><td></td><td>32.74</td><td>29.64</td><td></td><td></td><td></td><td></td></tr><tr><td colspan="2"></td><td>33.94</td><td>32.54</td><td>27.94</td><td></td><td></td><td>47.94</td><td>45.34 47.24</td><td>67.24</td><td>39.36</td></tr></table>
|
| 288 |
+
|
| 289 |
+
Pruning Schedule is Important As shown in Table A3, an inappropriate pruning schedule across $\mathcal { T } _ { 1 } \sim \mathcal { T } _ { 2 }$ , the resultant ticket drops to $5 9 . 2 8 \%$ accuracy which is $1 3 . 5 1 \%$ lower than the dense model. On the contrary, the adequate scheme across $\mathcal { T } _ { 1 } \sim \mathcal { T } _ { 5 }$ in Table A3, generates a TD winning ticket with a higher test accuracy $( + 0 . 4 9 \%$ SA) and extreme fewer parameters $( 6 . 8 7 \% )$ , compared with the dense CIL model.
|
| 290 |
+
|
| 291 |
+
Table A3: Evaluation performance of TD tickets $( 6 . 8 7 \% )$ ) pruned from different task ranges.
|
| 292 |
+
|
| 293 |
+
<table><tr><td rowspan="2">Pruning Schedule</td><td colspan="6">TD Tickets (6.87%) on CIFAR-10</td></tr><tr><td>T1(%)</td><td>T(%)</td><td>T(%)</td><td>T4(%)</td><td>T5(%)</td><td>Average (%)</td></tr><tr><td>Prune acrossT1 ~ T2</td><td>74.05</td><td>88.80</td><td>78.25</td><td>28.40</td><td>26.90</td><td>59.28</td></tr><tr><td>Prune acrossT1 ~ T5</td><td>78.90</td><td>82.15</td><td>71.55</td><td>63.80</td><td>70.00</td><td>73.28</td></tr></table>
|
| 294 |
+
|
| 295 |
+
# A1.2 MORE LIFELONG TICKETS RESULTS
|
| 296 |
+
|
| 297 |
+
Top-down Lifelong Tickets We also report several performance reference baselines: (a) Full model, denoting the achievable performance of the dense CIL model (Zhang et al., 2019) combined with lottery teaching. (b) $\mathrm { C I L } _ { \mathrm { l o w e r } }$ denoting a vanilla CIL model without using lottery teaching nor storing/utilizing previous data in any form; (c) $\mathbf { M T } _ { \mathrm { u p p e r } }$ training a dense model using full data from all tasks simultaneously in a multi-task learning scheme. While it is not CIL (and much easier to learn), we consider $\mathbf { M T } _ { \mathrm { u p p e r } }$ as an accuracy “upper bound” for (dense) CIL ; (d) $\mathbf { M T } _ { \mathrm { L T } }$ by directly pruning $\mathbf { M T } _ { \mathrm { u p p e r } }$ to obtain its lottery ticket (Frankle & Carbin, 2019). The detailed evaluation performance of $T D$ tickets at different sparsity levels on CIFAR-10 are collected in Table A4.
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
Figure A6: Evaluation performance (standard accuracy) of top-down lifelong tickets. The right figure zooms in the red dash-line box in the left figure.
|
| 301 |
+
|
| 302 |
+
Table A4: Evaluation performance of $T D$ tickets at different sparsity levels on CIFAR-10. Reported performance is the final accuracy for each task $\tau$ . Differences $( + / - )$ are calculated w.r.t. the full/dense model performance.
|
| 303 |
+
|
| 304 |
+
<table><tr><td rowspan="2">Remaining Weights</td><td colspan="6">TD Tickets on CIFAR-10</td></tr><tr><td>T1 (%)</td><td>T2 (%)</td><td>T (%)</td><td>T4 (%)</td><td>T5 (%)</td><td>Average (%)</td></tr><tr><td>MTupper : (100.00%)</td><td>97.48</td><td>97.48</td><td>93.33</td><td>90.83</td><td>94.03</td><td>94.63</td></tr><tr><td>CILlower (100.00%)</td><td>0.00</td><td>0.00</td><td>0.00</td><td>0.00</td><td>93.70</td><td>18.74</td></tr><tr><td>100.00%</td><td>79.70</td><td>79.12</td><td>68.23</td><td>63.45</td><td>73.43</td><td>72.79</td></tr><tr><td>32.77%</td><td>84.30</td><td>80.05</td><td>70.70</td><td>67.75</td><td>69.55</td><td>74.47 + 1.68</td></tr><tr><td>10.74%</td><td>78.90</td><td>77.75</td><td>76.30</td><td>63.55</td><td>71.05</td><td>73.51 + 0.72</td></tr><tr><td>6.87%</td><td>78.90</td><td>82.15</td><td>71.55</td><td>63.80</td><td>70.00</td><td>73.28 + 0.49</td></tr><tr><td>4.40%</td><td>82.25</td><td>78.55</td><td>65.10</td><td>65.38</td><td>70.23</td><td>72.30 - 0.49</td></tr><tr><td>2.25%</td><td>78.20</td><td>78.30</td><td>69.50</td><td>58.20</td><td>65.00</td><td>69.84 - 2.45</td></tr></table>
|
| 305 |
+
|
| 306 |
+
Bottom-up Lifelong Tickets As shown in Table A5 and Table A6, even compared with the best TD tickets in terms of the trade-off between sparsity and accuracy, TR-BU tickets consistently remain prominent on both CIFAR-10 (a slightly higher accuracy and ${ \mathrm { { \bar { 3 } . 2 3 \% } } }$ fewer weights) and CIFAR100 $( 2 . 3 7 \%$ higher accuracy and $4 . { \bar { 8 } } 8 \%$ fewer weights). From the results, we further observe that TR-BU tickets achieve comparable accuracy to full models which have more than $\mathbf { 3 0 } \times$ times in network capacity, implying that bottom-up lifelong pruning successfully discovers extremely sparse sub-networks, and yet they are powerful enough to inherit previous knowledge and generalize well on newly added tasks.
|
| 307 |
+
|
| 308 |
+
# A1.2.1 MORE ABLATION RESULTS
|
| 309 |
+
|
| 310 |
+
Uniform v.s. Curriculum Lifelong Pruning We discuss different pruning schedules of top-down lifelong pruning, which play an essential role in the performance of $T D$ tickets. From the right figure in Figure A7, we notice that the curriculum pruning scheme generates stronger $T D$ tickets than the uniform pruning in terms of accuracy, which confirms our motivation that pruning heavier in the late stage of lifelong learning with more classes is beneficial.
|
| 311 |
+
|
| 312 |
+
The Number of Incremental Tasks Here we study the influence of increment times in our lifelong learning settings. Table A8 shows the results of $T R \mathrm { - } B U _ { \mathrm { 2 0 } }$ tickets incrementally learn from 20 tasks (5 classes per task); Table A6 presents the results of $T R \mathrm { - } B U _ { 1 0 }$ tickets incrementally learn from 10 tasks (10 classes per task). Comparing between two tickets, $T R \mathrm { - } B U _ { 1 0 }$ tickets reach $6 . 5 5 \%$ higher accuracy at the expense of $1 . 7 7 \%$ more parameters. Possible reasons behind it are that: i) the increasing of incremental learning times aggravates the forgetting issue, which causes $T R \mathrm { - } B U _ { 2 0 }$ tickets fall in a
|
| 313 |
+
|
| 314 |
+
Table A5: Evaluation performance of TR-BU/TD tickets on CIFAR-10. $\mathcal { T } _ { 1 \sim i }$ , $i \in \{ 1 , 2 , 3 , 4 , 5 \}$ donates that models have learned from $\tau _ { 1 } , \cdots , \tau _ { i }$ incrementally. $\frac { | | { \pmb m } | | _ { 0 } } { | | { \pmb \theta } | | _ { 0 } }$ represents the current network sparsity.
|
| 315 |
+
|
| 316 |
+
<table><tr><td rowspan="2">Compact Weights</td><td colspan="10">CIFAR-10</td></tr><tr><td>T1(%)</td><td>mlle Tllo</td><td>T1~2(%)</td><td>mlle Tllo</td><td>T1~3(%)</td><td>mllo T0llo</td><td>T1~4 (%)</td><td>mllo Tllo</td><td>T1~5 (%)</td><td>Umllo T0ll</td></tr><tr><td>MTupper</td><td>=</td><td>-</td><td>=</td><td>-</td><td>=</td><td>-</td><td>-</td><td>-</td><td>94.63</td><td>100.00%</td></tr><tr><td>CILlower</td><td>97.60</td><td>100.00%</td><td>49.80</td><td>100.00%</td><td>32.57</td><td>100.00%</td><td>23.23</td><td>100.00%</td><td>18.74</td><td>100.00%</td></tr><tr><td>Full Model</td><td>97.75</td><td>100.00%</td><td>89.10</td><td>100.00%</td><td>82.83</td><td>100.00%</td><td>76.99</td><td>100.00%</td><td>72.79</td><td>100.00%</td></tr><tr><td>TD tickets (6.87%)</td><td>98.05</td><td>80.00%</td><td>87.55</td><td>64.00%</td><td>80.20</td><td>40.96%</td><td>73.21</td><td>16.78%</td><td>73.28</td><td>6.87%</td></tr><tr><td>TD tickets (4.40%)</td><td>98.10</td><td>80.00%</td><td>87.83</td><td>64.00%</td><td>79.30</td><td>32.77%</td><td>72.34</td><td>13.42%</td><td>72.30</td><td>4.40%</td></tr><tr><td>TR-BU tickets (3.64%)</td><td>96.80</td><td>2.81%</td><td>88.90</td><td>3.11%</td><td>81.37</td><td>3.40%</td><td>74.66</td><td>3.64%</td><td>73.31</td><td>3.64%</td></tr></table>
|
| 317 |
+
|
| 318 |
+
Table A6: Evaluation performance of TR-BU/TD tickets when training incrementally on CIFAR-100.
|
| 319 |
+
|
| 320 |
+
<table><tr><td rowspan="2">Compact Weights</td><td colspan="9">CIFAR-100</td></tr><tr><td>T1 (%)</td><td>mllo Tl</td><td>T1~2 (%)</td><td>mlle Tl</td><td>T1~3 (%)</td><td>mlle T101l</td><td>T1~4 (%)</td><td>mlle Tl</td><td>T1~5 (%) mll T0ll</td></tr><tr><td>MTupper</td><td>-</td><td>-</td><td>=</td><td>=</td><td>=</td><td></td><td>- =</td><td></td><td></td></tr><tr><td>CILlower</td><td>87.40</td><td>100.00%</td><td>44.65</td><td>100.00%</td><td>28.67 100.00%</td><td>20.08</td><td>100.00%</td><td>17.44</td><td>100.00%</td></tr><tr><td>Full Model</td><td>88.30</td><td>100.00%</td><td>74.90</td><td>100.00%</td><td>63.70</td><td>100.00% 53.58</td><td>100.00%</td><td>48.52</td><td>100.00%</td></tr><tr><td>TD Tickets (12.08%)</td><td>88.34</td><td>80.00%</td><td>71.60</td><td>64.00%</td><td>58.80</td><td>51.2% 48.88</td><td>40.96%</td><td>43.60</td><td>32.77%</td></tr><tr><td>TD Tickets (9.66%)</td><td>88.20</td><td>80.00%</td><td>71.50</td><td>64.00%</td><td>58.73</td><td>51.2%</td><td>48.45 40.96%</td><td>44.08</td><td>32.77%</td></tr><tr><td>BU Tickets (7.20%)</td><td>85.70</td><td>5.50%</td><td>74.75</td><td>5.78%</td><td>65.93</td><td>6.07%</td><td>53.15 6.07%</td><td>48.18</td><td>6.07%</td></tr><tr><td>Compact Weights</td><td>T1~6 (%)</td><td></td><td>T~7(%)</td><td>事</td><td>T1~8(%)</td><td>喜 T~9(%)</td><td>事</td><td>T1~10 (%)</td><td></td></tr><tr><td>MTupper</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>74.11</td><td>100.00%</td></tr><tr><td>CILlower</td><td>14.07</td><td>100.00%</td><td>12.64</td><td>100.00%</td><td>10.91</td><td>- 100.00% 9.66</td><td>100.00%</td><td>8.64</td><td>100.00%</td></tr><tr><td>Full Model</td><td>45.82</td><td>100.00%</td><td>44.07</td><td>100.00%</td><td>42.35</td><td>100.00% 40.93</td><td>100.00%</td><td>39.36</td><td>100.00%</td></tr><tr><td>TD Tickets (12.08%)</td><td>41.50</td><td>26.21%</td><td>38.19</td><td>20.97%</td><td>37.28</td><td>16.78% 37.63</td><td>13.42%</td><td>37.42</td><td>12.08%</td></tr><tr><td>TD Tickets (9.66%)</td><td>41.18</td><td>26.21%</td><td>39.37</td><td>20.97%</td><td>38.06</td><td>16.78%</td><td>37.30 13.42%</td><td>36.72</td><td>9.66%</td></tr><tr><td>BU Tickets (7.20%)</td><td>47.58</td><td>6.35%</td><td>43.59</td><td>6.63%</td><td>41.35</td><td>6.63%</td><td>39.80</td><td>6.92%</td><td>39.79 7.20%</td></tr></table>
|
| 321 |
+
|
| 322 |
+
Table A7: Evaluation performance of TR-BU/TD tickets when training incrementally on TinyImageNet.
|
| 323 |
+
|
| 324 |
+
<table><tr><td rowspan="2">Compact Weights</td><td colspan="10">CIFAR-100</td></tr><tr><td>T1 (%)</td><td>喜</td><td>T1~2(%)</td><td>d</td><td>T1~3(%)</td><td></td><td>T1~4 (%)</td><td>事</td><td>T1~5 (%)</td><td></td></tr><tr><td>Full Model</td><td>73.70</td><td>100.00%</td><td>59.60</td><td>100.00%</td><td>52.07</td><td>100.00%</td><td>43.85</td><td>100.00%</td><td>41.32</td><td>100.00%</td></tr><tr><td>BU Tickets (12.08%)</td><td>75.00</td><td>10.74%</td><td>58.60</td><td>11.01%</td><td>54.93</td><td>11.28%</td><td>47.23</td><td>11.28%</td><td>43.36</td><td>11.28%</td></tr><tr><td>Compact Weights</td><td>T1~6(%)</td><td>mlle T0lo</td><td>T1~7 (%)</td><td></td><td>T1~8(%)</td><td></td><td>T1~9 (%)</td><td></td><td>T1~10 (%)</td><td>ml </td></tr><tr><td>Full Model</td><td>37.32</td><td>100.00%</td><td>34.69</td><td>100.00%</td><td>30.23</td><td>100.00%</td><td>29.94</td><td>100.00%</td><td>28.29</td><td>100.00%</td></tr><tr><td>BU Tickets (12.08%)</td><td>36.93</td><td>11.28%</td><td>36.43</td><td>11.54%</td><td>32.41</td><td>11.54%</td><td>29.16</td><td>11.81%</td><td>28.33</td><td>12.08%</td></tr></table>
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure A7: Left: the results of $T D$ Tickets with/without lottery teaching. Right: the comparison of $T D$ tickets $( 1 0 . 7 4 \% )$ obtained from uniform and curriculum pruning schedule. Experiments are conducted on CIFAR-10.
|
| 328 |
+
|
| 329 |
+
Table A8: Evaluation performance of TR-BU Tickets when models incrementally learn 20 tasks on CIFAR-100.
|
| 330 |
+
|
| 331 |
+
<table><tr><td rowspan="2">Compact Weights</td><td colspan="10">CIFAR-100</td></tr><tr><td>Ti (%)</td><td>mllo T</td><td>T1~2(%)</td><td>Imlle Tl。</td><td>T1~3(%)</td><td>Imlle Tlo</td><td>T1~4 (%)</td><td>lmllo Tl</td><td>T1~5 (%)</td><td>mlle T10ll</td></tr><tr><td>Full Model</td><td>89.20</td><td>100.00%</td><td>73.60</td><td>100.00%</td><td>67.33</td><td>100.00%</td><td>59.40</td><td>100.00%</td><td>52.16</td><td>100.00%</td></tr><tr><td>TR-BU Tickets (5.43%)</td><td>86.80</td><td>2.81%</td><td>75.20</td><td>3.11%</td><td>66.47</td><td>3.40%</td><td>60.75</td><td>3.40%</td><td>53.68</td><td>3.40%</td></tr><tr><td>Compact Weights</td><td>T1~6 (%)</td><td>事</td><td>T1~7(%)</td><td></td><td>T~8(%)</td><td>喜</td><td>T1~9(%)</td><td></td><td>T1~10(%)</td><td></td></tr><tr><td>Full Model TR-BU Tickets (5.43%)</td><td>50.10 50.40</td><td>100.00%</td><td>46.80</td><td>100.00%</td><td>43.35</td><td>100.00%</td><td>41.71</td><td>100.00%</td><td>38.62</td><td>100.00%</td></tr><tr><td></td><td></td><td>3.40%</td><td>47.11</td><td>3.69%</td><td>44.10</td><td>3.98%</td><td>43.29</td><td>4.27%</td><td>38.70</td><td>4.27% mlle</td></tr><tr><td>Compact Weights</td><td>T1~11 (%)</td><td></td><td>T1~12 (%)</td><td>Lmlle 1101l</td><td>T1~13 (%)</td><td></td><td>T1~14 (%)</td><td>mlle 10lo</td><td>T~15(%)</td><td>10</td></tr><tr><td>FullModel TR-BU Tickets (5.43%)</td><td>36.38</td><td>100.00%</td><td>35.77</td><td>100.00%</td><td>35.14</td><td>100.00%</td><td>34.66</td><td>100.00%</td><td>35.41</td><td>100.00%</td></tr><tr><td></td><td>37.35</td><td>4.27%</td><td>35.88</td><td>4.27%</td><td>34.62</td><td>4.27%</td><td>33.87</td><td>4.27%</td><td>35.48</td><td>4.56%</td></tr><tr><td>Compact Weights</td><td>T1~16 (%)</td><td>lmllo T101l</td><td>T1~17 (%)</td><td>mll T0</td><td>T1~18 (%)</td><td>mle 1101l0</td><td>T1~19 (%)</td><td>mllo T10l</td><td>T1~20 (%)</td><td>mllo 10l</td></tr><tr><td>Full Model TR-BU Tickets (5.43%)</td><td>34.43 34.64</td><td>100.00% 4.56%</td><td>33.98 34.13</td><td>100.00% 4.85%</td><td>34.14 33.69</td><td>100.00% 5.14%</td><td>32.65 31.84</td><td>100.00% 5.14%</td><td>33.13 33.24</td><td>100.00% 5.43%</td></tr></table>
|
| 332 |
+
|
| 333 |
+
worse accuracy decay; ii) at each incremental stage, $T R \mathrm { - } B U _ { 1 0 }$ tickets learn more knowledge (10 v.s.
|
| 334 |
+
5 classes per task), which requires a large network capacity.
|
| 335 |
+
|
| 336 |
+
With v.s. Without Lottery Teaching Comparison results between $T D$ tickets with lottery teaching and the ones without lottery teaching are collected in this section. As shown in Figure A7 (left figure), the performance of $T D$ tickets without lottery teaching (black dash curves), quickly falls into a worse decay along with the times of incremental learning increase. After learning all tasks, utilizing lottery teaching obtains a $4 . 3 4 \%$ accuracy improvement on CIFAR-10. It suggests that our proposed lottery teaching injects previous knowledge through applying knowledge distillation on external unlabeled data, and greatly alleviates the catastrophic forgetting issue.
|
| 337 |
+
|
| 338 |
+
# A2 MORE METHODOLOGY AND IMPLEMENTATION DETAILS
|
| 339 |
+
|
| 340 |
+
# A2.1 MORE LIFELONG PRUNING DETAILS
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure A8: Framework of our proposed top-down lifelong pruning algorithms. The top-down (TD) lifelong pruning performs like iterative magnitude pruning (IMP) by unrolling the sequential tasks. Tickets located by TD pruning continue to shrink with the growth of incremental tasks.
|
| 344 |
+
|
| 345 |
+
More Technical Details of Top-down Pruning In our implementation, we set $p ^ { \frac { 1 } { n ^ { ( i ) } } } = 2 0 \%$ as (Frankle & Carbin, 2019; Renda et al., 2020) and adjust $\bar { \{ n ^ { ( i ) } \} }$ to control the pruning schedule of IMP over sequential tasks. The aforementioned lifelong pruning method is illustrated in Figure A8, and we call it top-down lifelong pruning since the model size is sequentially reduced, namely, $\| \mathbf { m } ^ { ( i ) } \| _ { 0 } \leq \| \mathbf { m } ^ { ( i - 1 ) } \| _ { 0 }$ .
|
| 346 |
+
|
| 347 |
+
Pruning Algorithms We summarize the workflow of the top-down pruning and bottom-up pruning in Algorithm 1 and 2, respectively. For pruning hyperparameters, we follow the original LTH’s setting (Frankle & Carbin, 2019), i.e. $\Delta p \overset { \cdot } { = } 2 0 \%$ . If we change $\Delta p$ to $4 0 \%$ , it will drop $2 . 0 4 \%$ accuracy at the same sparsity level on CIFAR-10.
|
| 348 |
+
|
| 349 |
+
# A2.2 MORE CLASS-INCREMENTAL LEARNING DETAILS
|
| 350 |
+
|
| 351 |
+
Lottery teaching regularization In order to mitigate the catastrophic forgetting effect, we apply knowledge distillation (Hinton et al., 2015) ${ \mathcal { R } } _ { \mathrm { K D } }$ to enforce the similarity between previous $\hat { \pmb { y } }$ and
|
| 352 |
+
|
| 353 |
+
current $\textbf { { y } }$ soft logits on unlabeled data. We state ${ \mathcal { R } } _ { \mathrm { K D } }$ as follows:
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r l } { \mathcal { R } _ { \mathrm { K D } } ( { \pmb y } , \hat { \pmb y } ) = - \mathcal { H } ( t ( \pmb { y } ) , t ( \hat { \pmb y } ) ) } & { { } } \\ { = - \displaystyle \sum _ { j } t ( \pmb { y } ) _ { j } \log t ( \hat { \pmb y } ) _ { j } } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
where $\begin{array} { r } { t ( \pmb { y } ) _ { i } = \frac { ( \pmb { y } _ { i } ) ^ { 1 / \operatorname { T } } } { \sum _ { j } ( \pmb { y } _ { j } ) ^ { 1 / \operatorname { T } } } } \end{array}$ = (yi)1/TPj (yj )1/T , T = 2 in our case, following the standard setting in (Hinton et al., 2015;
|
| 360 |
+
Li & Hoiem, 2017).
|
| 361 |
+
|
| 362 |
+
# Algorithm 1: Top-Down Pruning
|
| 363 |
+
|
| 364 |
+
Input: Full dense model $f ( \pmb { \theta } _ { 0 } , \pmb { \theta } _ { \mathrm { c } } ^ { ( 0 ) } ; { \bf x } )$ , a desired sparsity $P _ { m }$ , samples $\mathbf { x }$ from a storage $s$ and sequential tasks $\mathcal { T } _ { 1 \sim n }$ , soft logits from previous model on queried unlabeled data, pruning ratio $\Delta p$ Output: An updated sparse model $f ( \pmb \theta \odot m , \pmb \theta _ { \mathrm { c } } ^ { ( n ) } ; \mathbf x )$
|
| 365 |
+
1 Set $i = 1$ and mask $m = \mathbf { 1 } \in \mathbb { R } ^ { | | \pmb \theta | | _ { 0 } }$
|
| 366 |
+
2 Train $f ( \pmb { \theta } _ { 0 } \odot \pmb { m } , \pmb { \theta } _ { \mathrm { c } } ^ { ( 0 ) } ; \mathbf { x } )$ with data from $s$ and $\mathcal { T } _ { 1 }$ .
|
| 367 |
+
3 while $\begin{array} { r } { 1 - \frac { | | { \boldsymbol m } | | _ { 0 } } { | | { \boldsymbol \theta } | | _ { 0 } } \leq P _ { m } } \end{array}$ and $i \leq n$ do
|
| 368 |
+
4 Iterative weight magnitude (IMP) pruning $\Delta p$ and obtaining new mask $\tilde { m }$ , where $| | \tilde { m } | | _ { 0 } < | | m | | _ { 0 }$
|
| 369 |
+
5 Rewind weight to $\pmb { \theta } _ { 0 }$
|
| 370 |
+
6 $\scriptstyle { m = m }$
|
| 371 |
+
7 Retrain $f ( \pmb { \theta } _ { 0 } \odot \pmb { m } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } ; \mathbf { x } )$ on the current task $\mathcal { T } _ { i }$ and $s$ . Lottery teaching is applied (A knowledge distillation constrain with soft logits)
|
| 372 |
+
8 Set $i = i + 1$
|
| 373 |
+
9 end
|
| 374 |
+
|
| 375 |
+
# Algorithm 2: Bottom-Up Pruning
|
| 376 |
+
|
| 377 |
+
Input: $f ( \pmb { \theta } _ { 0 } , \pmb { \theta } _ { \mathrm { c } } ^ { ( 0 ) } ; { \bf x } )$ , $P _ { m }$ , x, soft logits and $\Delta p$ defined in Algorithm 1, $f ( \pmb \theta _ { i } , \pmb \theta _ { \mathrm { c } } ^ { ( i ) } ; { \bf x } )$ has learned $\mathcal { T } _ { 1 \sim i }$ and has performance $\mathcal { R } _ { i } ^ { * }$ , $i \in \{ 1 , \cdots , n \}$ Output: An updated sparse model $f ( \pmb \theta \odot \tilde { m } , \pmb \theta _ { \mathrm { c } } ^ { ( \bar { n } ) } ; { \bf x } )$ 1 Set i = 1 and mask m˜ = 0 ∈ R||θ||0 2 Train $f ( \pmb { \theta } _ { 0 } \odot \tilde { m } , \pmb { \theta } _ { \mathrm { c } } ^ { ( 0 ) } ; \mathbf { x } )$ with data from $s$ and $\mathcal { T } _ { 1 }$ . Calculate accuracy $\mathcal { R } _ { 1 }$ . 3 while $i \leq n$ and $| | \tilde { m } | | _ { 0 } < | | \pmb { \theta } | | _ { 0 } \ \mathbf { d o }$ 4 if $\mathcal { R } _ { i } \geq \mathcal { R } _ { i } ^ { * }$ or $| | \tilde { m } | | _ { 0 } = | | \pmb { \theta } | | _ { 0 }$ then 5 Continue 6 else 7 Start from $f ( \pmb { \theta } _ { i } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } ; \mathbf { x } ) , \pmb { m } = 1$ 8 repeat 9 pruning $\Delta p$ of $\pmb { \theta } _ { i } \odot ( \pmb { m } - \tilde { \pmb { m } } )$ , obtain new mask $m ^ { * }$ , where $| | m ^ { * } | | _ { 0 } \geq | | \tilde { m } | | _ { 0 }$ and $\tilde { \pmb { m } } \in \ b { m } ^ { * }$ 10 Retrain $f ( \pmb { \theta } _ { i - 1 } \odot \pmb { m } ^ { * } , \pmb { \theta } _ { \mathrm { c } } ^ { ( i ) } ; \mathbf { x } )$ and calculate accuracy $\mathcal { R } _ { i }$ 11 m = m∗ 12 until $\mathcal { R } _ { i } \sim \mathcal { R } _ { i } ^ { * }$ and set $\tilde { m } = m ^ { * }$ ; 13 end 14 Set $i = i + 1$ 15 end
|
| 378 |
+
|
| 379 |
+
Our Dense Full CIL Model We consider a strong baseline framework derived from (Zhang et al., 2019) with our proposed lottery teaching as our dense full CIL model. It adopts random and classbalanced sampling strategies, an auxiliary classifier, and the knowledge distillation regularizer ${ \mathcal { R } } _ { \mathrm { K D } }$ . For incrementally learning task $\mathcal { T } _ { i }$ , the training objective is depicted as:
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\mathcal { L } _ { \mathrm { C I L } } ( \pmb { \theta } , \pmb { \theta } _ { c } ^ { ( i ) } , \pmb { \theta } _ { a } ^ { ( i ) } ) = \gamma _ { 2 } \times \mathcal { L } ( \pmb { \theta } , \pmb { \theta } _ { c } ^ { ( i ) } ) + \mathcal { L } ( \pmb { \theta } , \pmb { \theta } _ { a } ^ { ( i ) } )
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \mathcal { L } ( \pmb { \theta } , \pmb { \theta } _ { c } ^ { ( i ) } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } _ { b } } \left[ \mathcal { L } _ { \mathrm { X E } } ( f ( \pmb { \theta } , \pmb { \theta } _ { c } ^ { ( i ) } , \mathbf { x } ) , \mathbf { y } ) \right] } \\ & { \quad \quad \quad \quad + \gamma _ { 1 } \times \mathbb { E } _ { \mathbf { x } \in \mathcal { D } _ { u } } \left[ \mathcal { R } _ { \mathrm { K D } } ( f ( \pmb { \theta } , \pmb { \theta } _ { c } ^ { ( i ) } , \mathbf { x } ) , \hat { \pmb { y } } _ { c } ) \right] , } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { r l } & { \mathcal { L } ( \pmb { \theta } , \pmb { \theta } _ { a } ^ { ( i ) } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { D } _ { r } } \left[ \mathcal { L } _ { \mathrm { X E } } ( f ( \pmb { \theta } , \pmb { \theta } _ { a } ^ { ( i ) } , \mathbf { x } ) , \mathbf { y } ) \right] } \\ & { ~ + ~ \gamma _ { 1 } \times \mathbb { E } _ { \mathbf { x } \in \mathcal { D } _ { u } } \left[ \mathcal { R } _ { \mathrm { K D } } ( f ( \pmb { \theta } , \pmb { \theta } _ { a } ^ { ( i ) } , \mathbf { x } ) , \hat { \pmb { y } } _ { a } ) \right] , } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
where $\mathcal { D } _ { b }$ is the class-balanced sampled dataset, $\mathcal { D } _ { r }$ represents the randomly sampled dataset, and $\mathcal { D } _ { u }$ stands for the queried unlabeled dataset. $\theta _ { c } ^ { ( i ) }$ ) and θ(i)a are the main and auxiliary classifiers. $\hat { y } _ { c }$ and $\hat { { \bf y } } _ { a }$ are soft logits on previous tasks of the main and auxiliary classifiers. We adopt $\gamma _ { 1 } = 1 , \gamma _ { 2 } =$ 0.5 in our experiment according to grid search.
|
| 394 |
+
|
| 395 |
+
# A2.3 MORE OTHER IMPLEMENTATION DETAILS
|
| 396 |
+
|
| 397 |
+
Datasets and Task Splittings We evaluate our proposed lifelong tickets on CIFAR-10, CIFAR100, and Tiny-ImageNet datasets, all being standard and state-of-the-art benchmarks for CIL (Krizhevsky & Hinton, 2009). For all three datasets, we randomly split the original training dataset into training and validation with a ratio of $9 : 1$ . On CIFAR-10, we divide the 10 classes into splits of 2 classes with a random order $( 1 0 / 2 = 5$ tasks); On CIFAR-100, we divide the 100 classes into splits of 10 classes with a random order $( 1 0 0 / 1 0 = 1 0 $ tasks); On Tiny-Imagenet, we divide the 200 classes into splits of 20 classes with a random order $( 2 0 0 / 2 0 = 1 0 $ tasks). In this way, when models learn a new incoming task, the dimension of classifiers will increase by 2 for CIFAR-10, 10 for CIFAR-100, and 20 for Tiny-ImageNet. Additionally, 100 images, 10 images, and 5 images per class of learned tasks will be stored for CIFAR-10, CIFAR-100, and Tiny-ImageNet respectively.
|
| 398 |
+
|
| 399 |
+
Unlabeled Dataset All queried unlabeled data for CIFAR-10/CIFAR-100 are from 80 Million Tiny Image dataset (Torralba et al., 2008), and for Tiny-ImageNet are from ImageNet dataset (Krizhevsky et al., 2012). At each incremental learning stage, 4, 500, 450 and 450 images per class of learned tasks will be queried, based on the feature similarity with stored prototypes $\{ \mathbf { m } ^ { ( i - 1 ) } \odot { \pmb \theta } ^ { ( i - 1 ) } , { \pmb \theta } _ { \mathrm { c } } ^ { ( i - 1 ) } \}$ in top-down Pruning and $\{ \pmb \theta ^ { ( i - 1 ) } , \pmb \theta _ { \mathrm { c } } ^ { ( i - 1 ) } \}$ in bottom-up Pruning at the $i ^ { \mathrm { t h } }$ CIL stage for CIFAR-10, CIFAR-100, and Tiny-ImageNet respectively. The feature similarity is defined by $\ell _ { 2 }$ norm distance.
|
| 400 |
+
|
| 401 |
+
Training and Evaluation Models are trained using Stochastic Gradient Descent (SGD) with 0.9 momentum and $5 \times 1 0 ^ { - 4 }$ weight decay. For 100 epochs training, a multi-step learning rate schedule is conducted, starting from 0.01, then decayed by 10 times at epochs 60 and 80. During the iterative pruning, we retrain the model for 30 epochs using a fixed learning rate of $1 0 ^ { - 4 }$ . The batch size for both labeled and unlabeled data is 128. We pick the trained model of the highest validation accuracy and report their performance on the hold-out testing set.
|
| 402 |
+
|
| 403 |
+
Other Training Details (i) CIFAR-10 and CIFAR-100 can be download at https://www.cs. toronto.edu/˜kriz/cifar.html. (ii) 80 Million Tiny Image dataset is referred to http: //horatio.cs.nyu.edu/mit/tiny/data/index.html. (iii) All of our experiments are conducted on NVIDIA GTX 1080-Ti GPUs.
|
| 404 |
+
|
| 405 |
+
# A3 DISCUSSION
|
| 406 |
+
|
| 407 |
+
Challenges of Theoretical Analysis and Future Work The theoretical justification of the lottery ticket hypothesis is very limited, except for very shallow networks (Anonymous, 2021). In the meantime, class-incremental learning makes the theoretical analysis more difficult. It is a challenging lifelong learning problem, and the current progress lies in the empirical side rather than the theoretical side. The theoretical analysis is out of scope for this paper and we would like to explore it in the future.
|
md/train/RO4DM85Z4P7/RO4DM85Z4P7.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# XIRL: Cross-embodiment Inverse Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Kevin Zakka1,3⇤, Andy $\mathbf { Z e n g } ^ { 2 }$ , Pete Florence2, Jonathan Tompson2, Jeannette $\mathbf { B o h g } ^ { 1 }$ , and Debidatta Dwibedi2 1Stanford University, 2Robotics at Google, 3UC Berkeley
|
| 4 |
+
|
| 5 |
+
Abstract: We investigate the visual cross-embodiment imitation setting, in which agents learn policies from videos of other agents (such as humans) demonstrating the same task, but with stark differences in their embodiments – shape, actions, end-effector dynamics, etc. In this work, we demonstrate that it is possible to automatically discover and learn vision-based reward functions from cross-embodiment demonstration videos that are robust to these differences. Specifically, we present a self-supervised method for Crossembodiment Inverse Reinforcement Learning (XIRL) that leverages temporal cycleconsistency constraints to learn deep visual embeddings that capture task progression from offline videos of demonstrations across multiple expert agents, each performing the same task differently due to embodiment differences. Prior to our work, producing rewards from self-supervised embeddings typically required alignment with a reference trajectory, which may be difficult to acquire under stark embodiment differences. We show empirically that if the embeddings are aware of task progress, simply taking the negative distance between the current state and goal state in the learned embedding space is useful as a reward for training policies with reinforcement learning. We find our learned reward function not only works for embodiments seen during training, but also generalizes to entirely new embodiments. Additionally, when transferring real-world human demonstrations to a simulated robot, we find that XIRL is more sample efficient than current best methods. Qualitative results, code, and datasets are available at https://x-irl.github.io
|
| 6 |
+
|
| 7 |
+
Keywords: inverse reinforcement learning, imitation learning, self-supervised learning
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
The ability to learn new tasks from third-person demonstrations holds the potential to enable robots to leverage the vast quantities of tutorial videos that can be gleaned from the world-wide web (e.g., YouTube videos). However, distilling diverse and unstructured videos into motor skills with vision-based policies can be daunting – as the videos themselves are often not only captured from different camera viewpoints in different environments, but also with different experts that may use different tools, objects, or strategies to perform the same task. Perhaps most critically, there often exists a clear embodiment gap between the human expert demonstrator, and the robot hardware that executes the learned policies. One approach to close this gap is to learn a mapping between the human and robot embodiment [1], which is a non-trivial intermediate problem in itself.
|
| 12 |
+
|
| 13 |
+
Despite considerable progress in learning policies with paired observations and actions (e.g., collected via teleoperation) [2, 3], much less work has been done in getting robots to learn policies from tasks defined only by third-person observations of demonstrations [4, 5, 6]. This is a surprisingly challenging problem, as different embodiments are likely to use unique strategies that suit them and allow them to make progress on a given task. For example, if asked to “place five pens into a cup”, a human hand is likely to scoop up all pens before slipping them into the cup, whereas a two-fingered gripper might instead need to pick and place each pen individually. Both strategies complete the task, but generate different state-action trajectories. In this setting, it may be difficult to acquire labeled frame-to-frame correspondences between expert demonstration videos and learned embodiments [6], particularly across a multitude of embodiments or experts. The approach we investigate instead is whether we can successfully learn tasks through a learned notion of task progress that is invariant to the embodiment performing the task.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. Cross-embodiment Inverse Reinforcement Learning. We learn embodiment-invariant visual representations from offline video demonstrations (stick agents on the left) using TCC [7], then use the trained encoder to generate embodiment-invariant visual reward functions that can be used to learn policies on new embodiments (gripper on the right) with reinforcement learning.
|
| 17 |
+
|
| 18 |
+
In this work, we propose to enable agents to imitate video demonstrations of experts – including ones with different embodiments – by using a task-specific, embodiment-invariant reward formulation trained via temporal cycle-consistency (TCC) [7]. We demonstrate how we can leverage an encoder trained with TCC to define dense rewards for downstream reinforcement learning (RL) policies via simple distances in the learned embedding space. Simulated experiments across four different embodiments show that these learned rewards are capable of generalizing to new embodiments, enabling unseen agents to learn the task via reinforcement, and surprisingly in some cases, exceeding the sample efficiency of the same agent learned with ground truth sparse rewards. We also demonstrate the effectiveness of our approach for learning robot policies using human demonstrations on the State Pusher environment from [6], where our reward is first learned on real-world human demonstrations, then used to teach a Sawyer arm how to perform the task in simulation.
|
| 19 |
+
|
| 20 |
+
Our contributions are as follows: (i) We introduce Cross-embodiment Inverse Reinforcement Learning (XIRL), an effective, label-free framework for tackling cross-embodiment visual imitation learning. Our core contribution is to use self-supervised learning on third-person demonstration videos to define dense reward functions amenable for downstream reinforcement learning policies, (ii) Along with XIRL, we release a cross-embodiment imitation learning benchmark, X-MAGICAL, which features multiple simulated agents with different embodiments performing the same manipulation task, including one thousand expert demonstrations for each agent, (iii) We show that XIRL significantly outperforms alternative methods on both the X-MAGICAL benchmark and the human-to-robot transfer benchmark from [6], and discuss our observations, which point to interesting areas for future research, (iv) Finally, we introduce a real-world dataset, X-REAL (Cross-embodiment Real demonstrations), of a manipulation task performed with nine different embodiments, which can be used to evaluate cross-embodiment reward learning methods2.
|
| 21 |
+
|
| 22 |
+
# 2 Related Work
|
| 23 |
+
|
| 24 |
+
Traditional formulations of imitation learning [8, 1, 9] assume access to a corpus of expert demonstration data which includes both state and action trajectories of the expert policy. In the context of third-person imitation learning, including when learning from expert agents with different embodiments, obtaining access to ground-truth actions is difficult or impossible3.
|
| 25 |
+
|
| 26 |
+
Inferring expert actions. To address this issue, several approaches either try to infer expert actions [10, 11, 12] – for example by training an inverse dynamics model on agent interaction data [10] – or employ forward prediction on the next state to imitate the expert without direct action supervision [13]. While these methods successfully address learning from observation-only demonstrations, they either do not support skill transfer to different policy embodiments at all, or they cannot take advantage of multiple embodiments in order to improve generalization to unseen policy configurations. We explicitly address these problems in this work.
|
| 27 |
+
|
| 28 |
+
Imitation via learned reward functions. In contrast to imitation via supervised methods, such as BCO [10], a recent body of work [4, 5, 14, 6, 15] has focused on learning reward functions from expert video data and then training RL policies to maximize this reward. In [4], the authors combine ImageNet pre-trained visual features with an L2-norm distance reward to match policy and expert observations in a latent feature space. In their follow-up work [5], the reward is computed in a viewpoint-invariant representation that is self-supervised on video data. While both these methods are compelling in their use of cheap unlabeled data to learn invariant rewards, the use of a time index as a heuristic for defining weak correspondence is a constraining limitation for tasks that need to be executed at different speeds, or are not strictly monotonic (e.g., have ambiguous sub-task ordering). In [14] a dense reward is learned via unsupervised learning on YouTube data and the authors make no assumption about time alignment. However, in their work, the expert and learned policy are executed in the same domain and embodiment, an assumption we relax in our work. Framed in a multi-task learning setting, [16] propose training policies with morphologically different embodiments first on a similar set of proxy tasks, in order to learn a latent space to map between domains, and then sharing skills on a held-out task from one policy to another. A time-index heuristic is used to define a metric reward when performing RL training of the new task. In our work, the learned embedding finds correspondences in a fully-unsupervised fashion, without the need for such strict time alignment. In [17], a small sub-set of states is human labeled for goal success and a convolutional network is then trained to detect successful task completion from image observations, where on-policy samples are used as negatives for the classifier. By contrast, our learned embedding encodes task progress in its latent representation without the use of expensive human labels.
|
| 29 |
+
|
| 30 |
+
Imitation via domain adaptation. An additional category of approaches to third-person imitation learning are those that perform domain adaptation of expert observations [18, 19, 20, 21]. For instance, in [18] a CycleGAN [22] architecture is used to perform pixel-level image-to-image translation between policy domains, which is then used to construct a reward function for a model-based RL algorithm. A similar model-free approach is proposed in [19]. In [20], a generative model is used to predict robot high-level sub-goals conditioned on a third-person demonstration video, and a lower-level control policy is trained in a task-agnostic manner. Similarly, [21] uses high level task conditioning from zero-shot transfer of expert demonstrations, but they use KL matching to perform both high and low-level imitation. In contrast to these methods, the unsupervised TCC alignment in this work avoids performing explicit domain adaptation or pixel-level image translation by instead learning a robust and invariant feature space in a fully offline fashion.
|
| 31 |
+
|
| 32 |
+
Reinforcement learning with demonstrations. Recent work in offline-reinforcement learning [6] explicitly tackles the problem of policy embodiment and domain shift. Their method, Reinforcement Learning from Videos (RLV), uses a labelled collection of expert-policy state pairs in conjunction with adversarial training to learn an inverse dynamics model jointly optimized with the policy. In contrast, we avoid the limitation of collecting human-labeled dense state correspondences by using a self-supervised algorithm (i.e., TCC [7]) which uses cycle-consistency to automatically learn the correspondence between states of two domains. We also show that this formulation improves generalization to unseen embodiments. Since the problem setup is similar to ours, we also compare to their method as a baseline.
|
| 33 |
+
|
| 34 |
+
# 3 Approach
|
| 35 |
+
|
| 36 |
+
Our overall XIRL framework (Figure 1) addresses the cross-embodiment visual imitation problem (Section 3.1). The framework consists of first using TCC to self-supervise embodiment-invariant visual representations (Section 3.2), then using a novel embodiment-invariant visual reward function (Section 3.3) to perform cross-embodiment visual imitation via reinforcement learning (Section 3.4).
|
| 37 |
+
|
| 38 |
+
# 3.1 Problem Formulation
|
| 39 |
+
|
| 40 |
+
Our objective is to extract an agent-invariant definition of a task, via a learned reward function, from a dataset of videos of separate agents performing the same task. In particular, we are interested in agents that may solve the task in entirely different ways due to differences in their end-effector, shapes, dynamics, etc., which we refer to as embodiment differences. For example, consider how differently a vacuum gripper and a parallel-jaw gripper will grasp an object as a result of their respective end-effectors. Such a setup is quite common in robotic imitation learning, where we might have access to observation data of humans demonstrating a task, but want to teach a robot to perform it. It is very likely that the way the human executes the task will diverge from how the robot would execute it.
|
| 41 |
+
|
| 42 |
+
We define a dataset of multiple agents performing the same task $T$ as $\textstyle D = \bigcup _ { i = 1 } ^ { n } D _ { i }$ , where $D _ { i }$ is an agent-specific dataset containing observations of only agent $i$ performing task $T$ . Each agent’s dataset $D _ { i }$ is a collection of videos defined as ${ { D } _ { i } } = \{ v _ { i } ^ { 1 } , v _ { i } ^ { 2 } . . . v _ { i } ^ { K } \}$ , where $v _ { i } ^ { j }$ represents the video of the $j ^ { t h }$ demonstration of agent $i$ successfully performing the task $T$ . We would like to highlight that $D$ only contains observation data, i.e., it does not store the actions taken by the respective agents. We use self-supervised representation learning techniques to learn task-specific representations from this dataset.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2. Difference in state distributions of the across different embodiments performing the same task in X-MAGICAL (Section 4.1).
|
| 46 |
+
|
| 47 |
+
# 3.2 Representation Learning
|
| 48 |
+
|
| 49 |
+
In this work, we use TCC [7] to learn task-specific representations in a self-supervised way. The method has been shown to learn useful representations on videos of the same action for temporally fine-grained downstream tasks. In their paper, the authors show that TCC representations can predict frame-level task progress, such as predicting how much water is in a cup during pouring, without requiring any human annotations. Task progress can provide dense signals for learning a new task and we would like to bake this property into our learned reward. Another advantage of TCC is that it does not require supervision for frame-level alignment (i.e., which frames in two videos correspond to each other). Such frame-to-frame correspondences are required by a prior method, RLV [6], to achieve successful reinforcement learning on the considered tasks, but we would like to avoid this type of manual supervision.
|
| 50 |
+
|
| 51 |
+
We train an image encoder $\phi$ , that ingests an image $I$ and returns an embedding vector $\phi ( I )$ , using TCC. TCC assumes that there exist semantic temporal correspondences between two video sequences, even though they are not labeled and the actions may be executed at different speeds. Note that in our case, the assumption holds since all sequences in our dataset originate from the same task. Furthermore, even if two different agents accomplish the task very differently, there will be a common set of states or frames that will temporally correspond. When we apply the TCC loss, we compare frames of one agent performing the task with frames from another, and search for temporal similarities in how both execute the task. By performing multiple such comparisons and cycling-back (described in the next paragraph), TCC encodes task progress in its latent representation, a property that is useful for learning task-specific, yet embodiment-invariant reward functions. For completeness, we describe the training technique below.
|
| 52 |
+
|
| 53 |
+
We define a dataset $D _ { \mathrm { a l l } } = \{ v _ { 1 } , v _ { 2 } . . . v _ { N } \}$ that contains the videos of all agents executing the same task $T$ . We are able to merge the datasets of different agents since TCC does not require embodiment labels (i.e., IDs) during training. We first sample a random batch of videos and embed all their frames using the aforementioned image encoder $\phi$ . For each video $v _ { i }$ , this results in a sequence of embeddings $V _ { i } { = } \{ \phi ( v _ { i } ^ { 1 } ) , \phi ( v _ { i } ^ { 2 } ) { \ldots } , \phi ( v _ { i } ^ { L _ { i } } ) \}$ , where $L _ { i }$ is the length of the $i ^ { t h }$ video. From this mini-batch of sequences of video frame embeddings, we choose a pair of sequences $V _ { i }$ and $V _ { j }$ and compute their TCC loss. In particular, we randomly sample a frame embedding from sequence $V _ { i } -$ say $V _ { i } ^ { t }$ corresponding to the $t ^ { t h }$ frame of video $v _ { i }$ – and compute the soft nearest-neighbor of $V _ { i } ^ { t }$ in sequence $V _ { j }$ in the embedding space as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\widetilde { V _ { i j } ^ { t } } = \sum _ { k } ^ { L _ { j } } \alpha _ { k } V _ { j } ^ { k } , \quad \mathrm { w h e r e } \quad \alpha _ { k } = \frac { e ^ { - \| V _ { i } ^ { t } - V _ { j } ^ { k } \| ^ { 2 } } } { \sum _ { k } ^ { L _ { j } } e ^ { - \| V _ { i } ^ { t } - V _ { j } ^ { k } \| ^ { 2 } } }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
We then cycle-back [7] to the first sequence $V _ { i }$ by computing the soft-nearest neighbor of $\widetilde { V _ { i j } ^ { t } }$ with all the frames in $V _ { i }$ . The probability of cycling-back to the $k ^ { t h }$ frame in $V _ { i }$ can be computed as:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\beta _ { i j t } ^ { k } = \frac { e ^ { - \| \widetilde { V _ { i j } ^ { t } } - V _ { i } ^ { k } \| ^ { 2 } } } { \sum _ { k } ^ { L _ { i } } e ^ { - \| \widetilde { V _ { i j } ^ { t } } - V _ { i } ^ { k } \| ^ { 2 } } }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
The expected frame index we cycle-back to is then $\begin{array} { r } { \mu _ { i j } ^ { t } = \sum _ { k } ^ { L _ { i } } \beta _ { i j t } ^ { k } k } \end{array}$ . Since we know the index of the frame that started the cycle, in this case $t$ , we can minimize the mean-squared (MSE) error loss between $t$ and the closest index retrieved via soft-nearest neighbor, i.e., $\widetilde { V _ { i j } ^ { t } }$ . The loss for a single frame is thus: $L _ { i j } ^ { t } = ( \mu _ { i j } ^ { t } - t ) ^ { 2 }$ . Finally, we minimize the average loss $L$ over all frames in video $v _ { i }$ with all other videos in the dataset $v _ { j }$ , defined as $\begin{array} { r } { L = \sum _ { i j t } L _ { i j } ^ { t } } \end{array}$ .
|
| 66 |
+
|
| 67 |
+
Table 1. Statistics of Demos of the X-MAGICAL Embodiments
|
| 68 |
+
|
| 69 |
+
<table><tr><td>Embodiment</td><td>Mean ± Std.Dev. Demo Length (no. of frames)</td></tr><tr><td>Long-stick</td><td>48.0 ±28.5</td></tr><tr><td>Medium-stick</td><td>59.9 ±27.9</td></tr><tr><td>Short-stick</td><td>81.7 ±35.0</td></tr><tr><td>Gripper</td><td>110.8 ±39.8</td></tr></table>
|
| 70 |
+
|
| 71 |
+
# 3.3 Reward Function
|
| 72 |
+
|
| 73 |
+
Once the encoder $\phi$ has been trained on demonstrations of different agents performing the same task $T$ , we want to use it to transfer information about the task from one agent to another. We do this by leveraging $\phi$ to generate rewards via distances to goal observations in the learned embedding space. Specifically, we define the goal embedding $g$ as the mean embedding of the last frame of all the demonstration videos in our offline dataset $D _ { \mathrm { a l l } }$ . Concretely, $\scriptstyle g = \sum _ { i = 1 } ^ { N } \phi ( v _ { i } ^ { L _ { i } } ) \neq N$ , where $L _ { i }$ is the length of video $v _ { i }$ . Our reward $r$ then is the scaled negative distance of the current state embedding to the goal embedding $g$ i.e., $r ( s ) =$ $- 1 / \kappa \cdot \| \phi ( s ) - g \| _ { 2 } ^ { 2 }$ , where $\phi ( s )$ is the state embedding at the current timestep and $\kappa$ is a scale parameter that ensures the distances are in a range amenable for training reinforcement learning algorithms [23]. We found it effective to set $\kappa$ to be the average distance of the first frame’s embedding to the goal embedding for all the demonstrations in the dataset. Defining $r$ in this manner gives us several advantages: (a) it is dense, encoding both task completion and task progress, (b) it does not require any correspondence with a reference trajectory [5, 14] and (c) it sidesteps the need for a finite library of reference trajectories, unlike prior work [5, 16] that define time-indexed rewards relative to some reference trajectory. Thus, agents with trajectories of varying lengths (due to embodiment-specific constraints) can efficiently leverage this reward because the learned encoder can map different strategies to a common notion of task progress.
|
| 74 |
+
|
| 75 |
+
# 3.4 Reinforcement Learning
|
| 76 |
+
|
| 77 |
+
Using the pre-trained frozen encoder $\phi$ , we define a Markov Decision Process (MDP) for any agent as the tuple $\langle \bar { \boldsymbol { S } } , \boldsymbol { A } , \boldsymbol { P } , \boldsymbol { r } \rangle$ where $s$ is the set of possible states, $\mathcal { A }$ is the set of possible actions, $P$ is the state transition probability matrix encoding the dynamics of the environment (including the agent) and $r$ is the learned reward function (defined in Section 3.3). Notice how we are able to use the same reward function $r$ for any agent – even ones that the encoder may not have seen during training. Furthermore, this reward function solely depends on the learned encoder. Hence, the task represented by the MDP now depends solely on how well the encoder has learned task-specific representations since we do not use the environment reward to either define the task or learn the policy. This is an important distinction because we are expecting the encoder to generalize to new states that an agent might encounter during training, as the expert demonstrations in our dataset only contain successful trajectories. It is also possible to augment sparse rewards (which only define task success or failure) with our learned dense reward while training policies.
|
| 78 |
+
|
| 79 |
+
# 4 Experimental Setup
|
| 80 |
+
|
| 81 |
+
# 4.1 X-MAGICAL Benchmark
|
| 82 |
+
|
| 83 |
+
We introduce a cross-embodiment imitation learning benchmark, X-MAGICAL, which is based on the imitation learning benchmark MAGICAL [24], implemented on top of the physics engine PyMunk [25]. In this work, we consider a simplified 2D equivalent of a common household robotic sweeping task, wherein an agent has to push three objects into a predefined zone in the environment (colored in pink). We choose this task specifically because its long-horizon nature highlights how different agent embodiments can generate entirely different trajectories. The reward in this environment is defined as the fraction of debris swept into the zone at the end of the episode.
|
| 84 |
+
|
| 85 |
+
Multiple Embodiments in X-MAGICAL. We create multiple embodiments by designing agents with different shapes and end-effectors that induce variations in how each agent solves a task. In Figure 1, we show three of these embodiments and some sample trajectories that solve the sweeping task. Please see Appendix B for a detailed description of the benchmark. Three agents are shaped like a stick and they differ only in length. We call them short-stick, medium-stick and long-stick based on the length of their body. The agent in the last row is called gripper: it is circular in shape and has two arms that can actuate. All agents are capable of two actions - a rotation around their axis and a translation in a forward/backward direction along this axis (similar to the agent in the MAGICAL benchmark). All agents have a two-dimensional action space and use force and torque control to change their position and orientation respectively. The gripper agent has an additional degree of freedom for opening or closing its fingers. The default state of the gripper’s fingers is open. For all agents, the state representation is a 16-dimensional vector with the following information: $( { \bar { x } } , y )$ position of the agent, $( \cos \bar { \theta } , \sin \theta _ { . } ^ { \cdot }$ ) where $\theta$ is the agent’s 2D orientation, and for each of the three debris: its $( x , y )$ position, its distance to the agent and its distance to the goal zone. We frame-stack [26] three consecutive state vectors to encode temporal and velocity information, resulting in a final state dimension of 48.
|
| 86 |
+
|
| 87 |
+
Demonstrations and Different Embodiment Strategies in X-MAGICAL. To learn task-specific representations for this task, we collect 1000 demonstrations per agent, where each demonstration consists in sweeping all three debris, initialized with random positions, into the target zone. This is the dataset $D _ { \mathrm { a l l } }$ (described in Section 3.1) containing observation-only agent-specific demonstrations. In Figure 2, we highlight the differences that exist between the trajectories taken by these agents. Figure 2a shows a heat map of the frequency of visits (state visitation count) of each agent at every 2D position in the grid, across all demonstrations in the dataset. We plot the 2D projection of the state visitation count onto the $X Y$ plane with a bin width of 0.1. Yellow encodes higher state visitation whereas blue encodes lower state visitation. We observe that agent long-stick has less coverage of the environment as opposed to agent gripper, which has significantly more coverage. Similarly, we show the distribution of debris locations for all agents across all demonstrations in Figure 2b. In Figure 2c, we plot a randomly sampled trajectory from each agent’s demonstration pool. We use transparency to encode the start (lighter) and end (darker) of the trajectory. It is clear from this figure that each agent solves the task in a different manner. Additionally, there is a significant difference in the time taken by each agent to execute this task, as shown in Table 1. Agent long-stick is able to finish the task the quickest because of its long shape that can sweep all the debris at once, while agents short-stick and gripper take longer because they have to frequently push or grasp one debris at a time. These differences are the types of challenges that a representation must overcome to successfully generalize across embodiments. As such, X-MAGICAL serves to create a highly simplified version of a real-world scenario where we might want to learn new tasks from an observation dataset of humans performing these tasks in highly diverse ways.
|
| 88 |
+
|
| 89 |
+
# 4.2 Baselines
|
| 90 |
+
|
| 91 |
+
Here, we describe the alternative reward functions we baseline our method against, color coded to match their appearance in Figs. 3, 4, and 5. 1) ImageNet: We use an ImageNet pre-trained ResNet-18 encoder with no additional self-supervised training, i.e., we load the pre-trained weights, discard the classification head, and use the 512-dimensional embedding space from the previous layer. 2) Goal classifier: We follow [27] and train a goal frame classifier on a binary classification task where the last frame of all the demonstrations is considered positive and all the others are considered negatives. We use the output probabilities of the classifier as the reward function. 3) LIFS: We implement the method from [16] which learns a feature space that is invariant to different embodiments using a contrastive loss function paired with an autoencoding loss. 4) TCN: single-view Time-Contrastive Network (TCN) [5] with positive and negative frame windows of 1 and 4 respectively. For more details regarding baseline implementations, see Appendix D.1.1.
|
| 92 |
+
|
| 93 |
+
# 4.3 Implementation Details
|
| 94 |
+
|
| 95 |
+
Our encoder for all experiments and methods is a ResNet-18 [28] initialized with ImageNet pre-trained weights. We replace the classification head with an embedding layer outputting a 32-dimensional vector. The encoder is trained on images of resolution $2 2 4 \times 2 2 4$ with ADAM [29] and a learning rate of $1 0 ^ { - 5 }$ Note that our learned reward is agnostic to the RL algorithm used – in this work, we opt for Soft-Actor Critic (SAC) [30], which is a reinforcement learning algorithm that has been successfully used to train policies for continuous control tasks [31]. Once the TCC encoder is trained, we use it to embed the observation frames as the agent interacts with the environment.
|
| 96 |
+
|
| 97 |
+
# 5 Experiments
|
| 98 |
+
|
| 99 |
+
We execute a series of experiments to evaluate whether the learned reward functions are effective at visual imitation. Specifically, our experiments seek to answer the following questions: first (Section 5.1), in the same-embodiment case, where the demonstration dataset $D$ contains the embodiment of the learning agent, does our method enable successful reinforcement learning for that agent? Next (Section 5.2), we investigate our primary interest, the cross-embodiment case, where the demonstration dataset $D$ does not contain the embodiment of the learning agent. To additionally test our approach using real-world data (Section 5.3), we use the dataset from [6] to leverage real-world human demonstrations to learn policies in simulation. Note that each embodiment’s performance is evaluated over 50 episodes and all figures plot the mean performance over 5 random seeds, with a standard deviation shading of $\pm 0 . 5$ . Videos of our results are in the supplementary video.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 3. Same-embodiment setting: Comparison of XIRL with other baseline reward functions, using SAC [30] for RL policy learning on the X-MAGICAL sweeping task.
|
| 105 |
+
Figure 4. Cross-embodiment setting: XIRL performs favorably when compared with other baseline reward functions, trained on observation-only demonstrations from different embodiments. Each agent{long-stick, medium-stick, short-stick, gripper} is shown using demonstrations from the other 3 embodiments, with SAC [30] for RL policy learning on the X-MAGICAL sweeping task.
|
| 106 |
+
|
| 107 |
+
# 5.1 Results on Learning from Same-Embodiment Demonstrations
|
| 108 |
+
|
| 109 |
+
In this experiment, we want to validate whether our approach of using a reward function trained with TCC is good enough to train agents to perform the task defined in a dataset of expert demonstrations. Note that the learned reward function has to be robust enough such that it can provide a useful signal for new states an agent might encounter while learning a policy and interacting with the environment. In Figure 3, we compare our method XIRL with baselines described in Section 4.2. We find XIRL is more sample-efficient than the other learned reward baselines. We attribute this sample efficiency to the fact that the TCC embeddings encode task progress which helps the agent learn to reach for objects and goal zones while interacting with the environment, rather than exploring in a purely random manner. This experiment provides evidence that XIRL’s reward function is suitable for downstream reinforcement learning.
|
| 110 |
+
|
| 111 |
+
# 5.2 Results on Learning from Cross-Embodiment Demonstrations
|
| 112 |
+
|
| 113 |
+
After verifying that XIRL works on the embodiments it was trained with, we move to the experiments that answer the core question in our work: can XIRL generalize to unseen embodiments? In this section we conduct experiments where the reward function is learned using embodiments that are different from the ones on which the policy is trained. As noted in Table 1, the timescales with which the agents execute the task can vary significantly. We conduct four experiments, each one corresponding to holding-out one agent from the expert demonstration set. In each such experiment, we train an encoder on demonstrations from the remaining three agents. We compare with reward functions learned using TCN, LIFS, and goal frame classifiers. While both TCC and TCN are contrastive losses, the former makes explicit comparisons across different embodiments, whereas the latter implicitly relies on an encoder shared across embodiments to learn the cross-embodiment representation. In Figure 4, we show that XIRL generalizes to new agents significantly better than the other learned reward baselines.
|
| 114 |
+
|
| 115 |
+
# 5.3 Results on Learning from Real-World Cross-Embodiment Demonstrations
|
| 116 |
+
|
| 117 |
+
In this experiment, we test how well we can learn rewards from more challenging real-world human demonstration videos. To do so, we use the dataset and State Pusher environment introduced in [6]. We train two XIRL encoders: XIRL (sim only) trained on 5 teleoperated simulated trajectories (i.e., no domain shift) and XIRL (real only) trained solely on the real-world human demonstrations without using any form of human labeling of paired frames. We compare our results to training the policy on the sparse reward from the environment and the RLV method presented in [6]. As demonstrated in Figure 5, we find our approach can improve the sample-efficiency of learning in the environment, compared to using RLV or solely the environment reward.
|
| 118 |
+
|
| 119 |
+
# 5.4 Qualitative comparison between learned reward functions vs. handcrafted rewards
|
| 120 |
+
|
| 121 |
+
In Figures 6 and 7, we visualize and compare the XIRL reward function with the environment’s reward (ground truth) for the Sweeping task from X-MAGICAL (see Sec. 4.1 for details) and the State Pusher and Drawer Opening tasks from $[ 6 ] ^ { 4 }$ . We find that the learned reward is highly correlated with the ground truth reward from the environment for both successful demos (first column in Figures 6 and 7) and unsuccessful demos (second column in Figures 6 and 7). It is especially encouraging to see that in a sparser reward environment like the Drawer Opening task, XIRL provides a dense signal that should allow the agent to learn the task more efficiently. Additionally, we can see that in the example of the failed collision trajectory (i.e., second row third column in Fig. 7), where the arm collides with the drawer rather than opening it, XIRL is able to provide it with a partial reward (i.e., for correctly moving towards the drawer) as opposed to the environment reward which remains zero.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5. Real-world-demo cross-embodiment setting: Comparison of XIRL with baselines using the simulated State Pusher environment from [6]. XIRL (real only) leverages real-world demonstration videos of humans (left, row 2) to teach a robot arm in sim (left, row 1), but unlike [6], we do not use human-labeled data of paired frame correspondences. $\mathrm { R L V ^ { \ast } }$ denotes results taken verbatim from [6] which uses a different implementation of SAC for RL policy learning.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6. X-MAGICAL demo cross-embodiment setting: Visualizing our learned reward function XIRL vs. the environment’s sparse reward on a successful and unsuccessful demonstration, for the short-stick agent on the X-MAGICAL sweeping task. The learned reward was trained on the three other agents.
|
| 130 |
+
Figure 7. Real-world-demo cross-embodiment setting: Visualizing our learned XIRL reward function vs. the environment’s sparse reward on the State Pusher (top) and Drawer Opening (bottom) tasks from [6].
|
| 131 |
+
|
| 132 |
+
# 6 Conclusion
|
| 133 |
+
|
| 134 |
+
This paper presents XIRL, a framework for learning vision-based reward functions from videos of expert demonstrators exhibiting different embodiments. XIRL uses TCC to self-supervise a deep visual encoder from videos, and uses this encoder to generate rewards via simple distances to goal observations in the embedding space. XIRL enables unseen agents with new embodiments to learn the demonstrated tasks via IRL. Reward functions from XIRL are fully self-supervised from videos, and we can successfully learn tasks without requiring manually paired video frames [6] between the demonstrator and learner. In this sense, our method presents favorable scalability to an arbitrary number of embodiments or experts with varying skill levels. Experiments show that policies learned via XIRL are more sample efficient than multiple baseline alternatives, including TCN [5], LIFS [16], and RLV [6]. While our experiments demonstrate promising results for learning policies in simulated environments using rewards learned from both simulated and real-world videos, we have yet to show policy learning on a real robot, which we look forward to trying post-COVID.
|
| 135 |
+
|
| 136 |
+
# Acknowledgments
|
| 137 |
+
|
| 138 |
+
We would like to thank Alex Nichol, Nick Hynes, Sean Kirmani, Brent Yi and Jimmy Wu for fruitful technical discussions, Sam Toyer for invaluable help with setting up the simulated benchmark, and Karl Schmeckpeper for discussions and help related to RLV.
|
| 139 |
+
|
| 140 |
+
# References
|
| 141 |
+
|
| 142 |
+
[1] B. D. Argall, S. Chernova, M. Veloso, and B. Browning. A survey of robot learning from demonstration. Robotics and autonomous systems, 57(5), 2009. 1, 2, 11
|
| 143 |
+
[2] T. Zhang, Z. McCarthy, O. Jow, D. Lee, X. Chen, K. Goldberg, and P. Abbeel. Deep imitation learning for complex manipulation tasks from virtual reality teleoperation. In ICRA. IEEE, 2018. 1
|
| 144 |
+
[3] P. Florence, L. Manuelli, and R. Tedrake. Self-supervised correspondence in visuomotor policy learning. IEEE RAL, 5(2), 2019. 1
|
| 145 |
+
[4] P. Sermanet, K. Xu, and S. Levine. Unsupervised perceptual rewards for imitation learning. arXiv preprint arXiv:1612.06699, 2016. 1, 2, 11
|
| 146 |
+
[5] P. Sermanet, C. Lynch, Y. Chebotar, J. Hsu, E. Jang, S. Schaal, and S. Levine. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 1134–1141. IEEE, 2018. 1, 2, 3, 5, 6, 8, 11, 16
|
| 147 |
+
[6] K. Schmeckpeper, O. Rybkin, K. Daniilidis, S. Levine, and C. Finn. Reinforcement learning with videos: Combining offline observations with interaction, 2020. 1, 2, 3, 4, 6, 7, 8, 11, 20
|
| 148 |
+
[7] D. Dwibedi, Y. Aytar, J. Tompson, P. Sermanet, and A. Zisserman. Temporal cycle-consistency learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 2, 3, 4, 12, 16
|
| 149 |
+
[8] C. Atkeson and S. Schaal. Robot learning from demonstration. In ICML, 1997. 2, 11
|
| 150 |
+
[9] T. Osa, J. Pajarinen, G. Neumann, J. Bagnell, P. Abbeel, and J. Peters. An algorithmic perspective on imitation learning. Found. Trends Robotics, 7:1–179, 2018. 2, 11
|
| 151 |
+
[10] F. Torabi, G. Warnell, and P. Stone. Behavioral cloning from observation. In IJCAI, 2018. 2, 11
|
| 152 |
+
[11] A. D. Edwards, H. Sahni, Y. Schroecker, and C. L. Isbell. Imitating latent policies from observation. arXiv preprint arXiv:1805.07914, 2018. 2, 11
|
| 153 |
+
[12] I. Radosavovic, X. Wang, L. Pinto, and J. Malik. State-only imitation learning for dexterous manipulation. arXiv preprint arXiv:2004.04650, 2020. 2, 11
|
| 154 |
+
[13] D. Pathak, P. Mahmoudieh, G. Luo, P. Agrawal, D. Chen, Y. Shentu, E. Shelhamer, J. Malik, A. A. Efros, and T. Darrell. Zero-shot visual imitation. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 2050–2053, 2018. 2, 11
|
| 155 |
+
[14] Y. Aytar, T. Pfaff, D. Budden, T. Paine, Z. Wang, and N. de Freitas. Playing hard exploration games by watching youtube. In Advances in Neural Information Processing Systems, pages 2930–2941, 2018. 2, 3, 5, 11
|
| 156 |
+
[15] O. Mees, M. Merklinger, G. Kalweit, and W. Burgard. Adversarial skill networks: Unsupervised robot skill learning from video. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 4188–4194. IEEE, 2020. 2, 11
|
| 157 |
+
[16] A. Gupta, C. Devin, Y. Liu, P. Abbeel, and S. Levine. Learning invariant feature spaces to transfer skills with reinforcement learning, 2017. 3, 5, 6, 8, 11, 16
|
| 158 |
+
[17] A. Singh, L. Yang, K. Hartikainen, C. Finn, and S. Levine. End-to-end robotic reinforcement learning without reward engineering. arXiv preprint arXiv:1904.07854, 2019. 3, 11
|
| 159 |
+
[18] L. Smith, N. Dhawan, M. Zhang, P. Abbeel, and S. Levine. Avid: Learning multi-stage tasks via pixel-level translation of human videos. arXiv preprint arXiv:1912.04443, 2019. 3, 11
|
| 160 |
+
[19] Y. Liu, A. Gupta, P. Abbeel, and S. Levine. Imitation from observation: Learning to imitate behaviors from raw video via context translation. In ICRA. IEEE, 2018. 3, 11
|
| 161 |
+
[20] P. Sharma, D. Pathak, and A. Gupta. Third-person visual imitation learning via decoupled hierarchical controller. In Advances in Neural Information Processing Systems, pages 2597–2607, 2019. 3, 11
|
| 162 |
+
[21] D. Hejna, L. Pinto, and P. Abbeel. Hierarchically decoupled imitation for morphological transfer. In International Conference on Machine Learning, pages 4159–4171. PMLR, 2020. 3, 11
|
| 163 |
+
[22] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 3, 11
|
| 164 |
+
[23] P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup, and D. Meger. Deep reinforcement learning that matters. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. 5
|
| 165 |
+
[24] S. Toyer, R. Shah, A. Critch, and S. Russell. The magical benchmark for robust imitation. arXiv preprint arXiv:2011.00401, 2020. 5, 12
|
| 166 |
+
[25] V. Blomqvist. Pymunk: A easy-to-use pythonic rigid body 2d physics library (version 6.0.0), 2007. URL https://www.pymunk.org. 5
|
| 167 |
+
[26] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. nature, 518(7540): 529–533, 2015. 6
|
| 168 |
+
[27] M. Vecerik, O. Sushkov, D. Barker, T. Rothorl, T. Hester, and J. Scholz. A practical approach to insertion with ¨ variable socket position using deep reinforcement learning. In 2019 International Conference on Robotics and Automation (ICRA), pages 754–760. IEEE, 2019. 6, 15, 16
|
| 169 |
+
[28] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. 6
|
| 170 |
+
[29] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint:1412.6980, 2014. 6
|
| 171 |
+
[30] T. Haarnoja, A. Zhou, P. Abbeel, and S. Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018. 6, 7, 17
|
| 172 |
+
[31] T. Haarnoja, A. Zhou, K. Hartikainen, G. Tucker, S. Ha, J. Tan, V. Kumar, H. Zhu, A. Gupta, P. Abbeel, and S. Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018. 6
|
| 173 |
+
[32] C. Yang, X. Ma, W. Huang, F. Sun, H. Liu, J. Huang, and C. Gan. Imitation learning from observations by minimizing inverse dynamics disagreement. ArXiv, abs/1910.04417, 2019. 11
|
| 174 |
+
[33] L. Shao, T. Migimatsu, Q. Zhang, K. Yang, and J. Bohg. Concept2robot: Learning manipulation concepts from instructions and human demonstrations. Robotics: Science and Systems, 2020. 11
|
| 175 |
+
[34] G. Berseth and C. Pal. Visual imitation learning with recurrent siamese networks. ArXiv, abs/1901.07186, 2019. 11
|
| 176 |
+
[35] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey. Maximum entropy inverse reinforcement learning. In Aaai, volume 8, pages 1433–1438. Chicago, IL, USA, 2008. 11
|
| 177 |
+
[36] B. D. Ziebart, J. A. Bagnell, and A. K. Dey. Modeling interaction via the principle of maximum causal entropy. In ICML, 2010. 11
|
| 178 |
+
[37] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. 11
|
| 179 |
+
[38] J. Ho and S. Ermon. Generative adversarial imitation learning. In NeurIPS, 2016. 11
|
| 180 |
+
[39] F. Torabi, G. Warnell, and P. Stone. Generative adversarial imitation from observation. arXiv preprint arXiv:1807.06158, 2018. 11
|
| 181 |
+
[40] B. C. Stadie, P. Abbeel, and I. Sutskever. Third-person imitation learning. arXiv:1703.01703, 2017. 11
|
| 182 |
+
[41] Y. Lu and J. Tompson. Adail: Adaptive adversarial imitation learning. NeurIPS Workshop on Learning Transferable Skills,, 2019. 11
|
| 183 |
+
[42] F. Liu, Z. Ling, T. Mu, and H. Su. State alignment-based imitation learning. arXiv preprint arXiv:1911.10947, 2019. 11
|
| 184 |
+
[43] W. Sun, A. Vemula, B. Boots, and J. Bagnell. Provably efficient imitation learning from observation alone. ArXiv, abs/1905.10948, 2019. 11
|
| 185 |
+
[44] K. Kim, Y. Gu, J. Song, S. Zhao, and S. Ermon. Domain adaptive imitation learning. arXiv, 2020. 11
|
| 186 |
+
[45] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32. Curran Associates, Inc., 2019. 14
|
| 187 |
+
[46] A. Buslaev, A. Parinov, E. Khvedchenya, V. Iglovikov, and A. A. Kalinin. Albumentations: fast and flexible image augmentations. arXiv e-prints, 2018. 16
|
| 188 |
+
[47] D. Yarats and I. Kostrikov. Soft actor-critic (sac) implementation in pytorch. https://github.com/ denisyarats/pytorch_sac, 2020. 17
|
| 189 |
+
[48] H. van Hasselt, A. Guez, and D. Silver. Deep reinforcement learning with double q-learning. arXiv e-prints, 2015. 17
|
| 190 |
+
[49] S. Fujimoto, H. van Hoof, and D. Meger. Addressing function approximation error in actor-critic methods. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018, 2018. 17
|
| 191 |
+
[50] A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv e-prints, 2013. 17
|
| 192 |
+
[51] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. 17, 18
|
md/train/RUQ1zwZR8_/RUQ1zwZR8_.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Differentially Private Learning with Adaptive Clipping
|
| 2 |
+
|
| 3 |
+
Galen Andrew galenandrew@google.com
|
| 4 |
+
|
| 5 |
+
Om Thakkar omthkkr@google.com
|
| 6 |
+
|
| 7 |
+
H. Brendan McMahan mcmahan@google.com
|
| 8 |
+
|
| 9 |
+
Swaroop Ramaswamy swaroopram@google.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Existing approaches for training neural networks with user-level differential privacy (e.g., DP Federated Averaging) in federated learning (FL) settings involve bounding the contribution of each user’s model update by clipping it to some constant value. However there is no good a priori setting of the clipping norm across tasks and learning settings: the update norm distribution depends on the model architecture and loss, the amount of data on each device, the client learning rate, and possibly various other parameters. We propose a method wherein instead of a fixed clipping norm, one clips to a value at a specified quantile of the update norm distribution, where the value at the quantile is itself estimated online, with differential privacy. The method tracks the quantile closely, uses a negligible amount of privacy budget, is compatible with other federated learning technologies such as compression and secure aggregation, and has a straightforward joint DP analysis with DP-FedAvg. Experiments demonstrate that adaptive clipping to the median update norm works well across a range of realistic federated learning tasks, sometimes outperforming even the best fixed clip chosen in hindsight, and without the need to tune any clipping hyperparameter.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Deep learning has become ubiquitous, with applications as diverse as image processing, natural language translation, and music generation [27, 13, 28, 7]. Deep models are able to perform well in part due to their ability to utilize vast amounts of data for training. However, recent work has shown that it is possible to extract information about individual training examples using only the parameters of a trained model [12, 30, 26, 8, 19]. When the training data potentially contains privacy-sensitive user information, it becomes imperative to use learning techniques that limit such memorization.
|
| 18 |
+
|
| 19 |
+
Differential privacy (DP) [10, 11] is widely considered a gold standard for bounding and quantifying the privacy leakage of sensitive data when performing learning tasks. Intuitively, DP prevents an adversary from confidently making any conclusions about whether some user’s data was used in training a model, even given access to arbitrary side information. The formal definition of DP depends on the notion of neighboring datasets: we will refer to a pair of datasets $D , D ^ { \prime } \in \mathcal { D }$ as neighbors if $D ^ { \prime }$ can be obtained from $D$ by adding or removing one element.
|
| 20 |
+
|
| 21 |
+
Definition 1.1 (Differential Privacy). A (randomized) algorithm $M : { \mathcal { D } } { \mathcal { R } }$ with input domain $\mathcal { D }$ and output range $\mathcal { R }$ is $( \varepsilon , \delta )$ -differentially private if for all pairs of neighboring datasets $D , D ^ { \prime } \in \mathcal { D }$ , and every measurable $S \subseteq \mathcal { R }$ , we have $\operatorname* { P r } \left( M ( D ) \in S \right) \leq e ^ { \varepsilon } \cdot \operatorname* { P r } \left( M ( D ^ { \prime } ) \in S \right) + \delta$ , where probabilities are with respect to the coin flips of $M$ .
|
| 22 |
+
|
| 23 |
+
Following McMahan et al. [18], we define two common settings of privacy corresponding to two different definitions of neighboring datasets. In example-level DP, datasets are considered neighbors when they differ by the addition or removal of a single example [9, 4, 2, 22, 31, 23, 15]. In user-level DP, neighboring datasets differ by the addition or removal of all of the data of one user [18]. Userlevel DP is the stronger form, and is preferred when one user may contribute many training examples to the learning task, as privacy is protected even if the same privacy-sensitive information occurs in all the examples from one user. In this paper, we will describe the technique and perform experiments in terms of the stronger user-level form, but we note that example-level DP can be achieved by simply giving each user a single example.
|
| 24 |
+
|
| 25 |
+
To achieve user-level DP, we employ the Federated Averaging algorithm [17], introduced as a decentralized approach to model training in which the training data is left distributed on user devices, and each training round aggregates updates that are computed locally. On each round, a sample of devices are selected for training, and then each selected device performs potentially many steps of local SGD over minibatches of its own data, sending back the model delta as its update.
|
| 26 |
+
|
| 27 |
+
Bounding the influence of any user in Federated Averaging is both necessary for privacy and often desirable for stability. One popular way to do this to cap the $L _ { 2 }$ norm of its model update by projecting larger updates back to the ball of norm $C$ . Since such clipping also effectively bounds the $L _ { 2 }$ sensitivity of the aggregate with respect to the addition or removal of any user’s data, adding Gaussian noise to the aggregate is sufficient to obtain a central differential privacy guarantee for the update [9, 4, 2]. Standard composition techniques can then be used to extend the per-update guarantee to the final model [20].
|
| 28 |
+
|
| 29 |
+
Setting an appropriate value for the clipping threshold $C$ is crucial for the utility of the private training mechanism. Setting it too low can result in high bias since we discard information contained in the magnitude of the gradient. However setting it too high entails the addition of more noise, because the amount of Gaussian noise necessary for a given level of privacy must be proportional to the norm bound (the $L _ { 2 }$ sensitivity), and this will eventually destroy model utility. The clipping bias-variance trade-off was observed empirically by McMahan et al. [18], and was theoretically analyzed and shown to be an inherent property of differentially private learning by Amin et al. [3].
|
| 30 |
+
|
| 31 |
+
Learning large models using the Federated Averaging/SGD algorithm [17, 18] can take thousands of rounds of interaction between the central server and the clients. The norms of the updates can vary as the rounds progress. Prior work [18] has shown that decreasing the value of the clipping threshold after training a language model for some initial number of rounds can improve model accuracy. However, the behavior of the norms can be difficult to predict without prior knowledge about the system, and if it is difficult to choose a fixed clipping norm for a given learning task, it is even more difficult to choose a parameterized clipping norm schedule.
|
| 32 |
+
|
| 33 |
+
While there has been substantial work on DP techniques for learning, almost every technique has hyperparameters which need to be set appropriately for obtaining good utility. Besides the clipping norm, learning techniques have other hyperparameters which might interact with privacy hyperparameters. For example, the server learning rate in DP SGD might need to be set to a high value if the clipping threshold is very low, and vice-versa. Such tuning for large networks can have an exorbitant cost in computation and efficiency, which can be a bottleneck for real-world systems that involve communicating with millions of samples for training a single network. Tuning may also incur an additional cost for privacy, which needs to be accounted for when providing a privacy guarantee for the released model with tuned hyperparameters (though in some cases, hyperparameters can be tuned using the same model and algorithm on a sufficiently-similar public proxy dataset).
|
| 34 |
+
|
| 35 |
+
Related Work The heuristic of clipping to the median update norm was suggested by Abadi et al. [1], but no method for doing so privately was proposed, nor was the heuristic empirically tested. One possibility would be to estimate the median unclipped update norm at each round privately by adding noise calibrated to the smooth sensitivity as defined by Nissim et al. [21]. However this approach has several drawbacks compared to the algorithm we will present. It would require the clients to send their unclipped updates to the server at each round,1 which is incompatible with the foundational principle of federated learning to transmit only focused, minimal updates, and precluding the use of secure aggregation [5] and certain forms of compression [16, 6]. Also, by incorporating information across multiple rounds, our method is able to track the underlying quantile closely, with less jitter associated with sampling at each round, and using only a negligible fraction of the privacy budget.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Loss functions to estimate the 0.01-, 0.5-, 0.75-, and 0.99-quantiles for a random variable $X$ that uniformly takes values in $\{ 1 5 , 2 5 , 2 8 , 4 0 , 4 5 , 4 8 \}$ . The loss function is the average of convex piecewise-linear functions, one for each value. For instance, for the median $( \gamma = 0 . 5 )$ , this is just $\begin{array} { r } { \dot { \ell } _ { \gamma } ( C ; X ) = \frac { 1 } { 2 } | X - C | } \end{array}$ , where $X$ is the random value, and $C$ is the estimate. When we average these functions, we arrive at the yellow function in the plot showing the average loss, which indeed is minimized by any value between the central two elements, i.e., in the interval [28, 40]. The function for $\gamma = 0 . 7 5$ is minimized at $C = 4 5$ because $\operatorname* { P r } ( X \leq C ) < 0 . 7 5$ for values $C$ in [40, 45), while $\operatorname* { P r } ( X \leq C ) > 0 . 7 5$ for values $C$ in (45, 48].
|
| 39 |
+
|
| 40 |
+
Contributions In this paper, we describe a method for adaptively and privately tuning the clipping threshold to track a given quantile of the update norm distribution during training. The method uses a negligible amount of privacy budget, and is compatible with other FL technologies such as compression and secure aggregation [5, 6]. We perform a careful empirical comparison of our adaptive clipping method to a highly optimized fixed-clip baseline on a suite of realistic and publicly available FL tasks to demonstrate that high-utility and high-privacy models—sometimes exceeding any fixed clipping norm in utility—can be trained using our method without the need to tune any clipping hyperparameter.
|
| 41 |
+
|
| 42 |
+
# 2 Private adaptive quantile clipping
|
| 43 |
+
|
| 44 |
+
In this section, we will describe the adaptive strategy that can be used for adjusting the clipping threshold so that it comes to approximate the value at a specified quantile.
|
| 45 |
+
|
| 46 |
+
Let $X \in \mathbb { R }$ be a random variable, let $\gamma \in [ 0 , 1 ]$ be a quantile to be matched. For any $C$ , define
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\ell _ { \gamma } ( C ; X ) = { \left\{ \begin{array} { l l } { ( 1 - \gamma ) ( C - X ) } & { { \mathrm { i f ~ } } X \leq C , } \\ { \gamma ( X - C ) } & { { \mathrm { o t h e r w i s e , } } } \end{array} \right. }
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
so
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\ell _ { \gamma } ^ { \prime } ( C ; X ) = { \left\{ \begin{array} { l l } { ( 1 - \gamma ) } & { { \mathrm { i f ~ } } X \leq C , } \\ { - \gamma } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Hence, $\begin{array} { r } { \mathbb { E } [ \ell _ { \gamma } ^ { \prime } ( C ; X ) ] = ( 1 - \gamma ) \operatorname* { P r } [ X \leq C ] - \gamma \operatorname* { P r } [ X > C ] = \operatorname* { P r } [ X \leq C ] - \gamma } \end{array}$ . For $C ^ { * }$ such that $\mathbb { E } [ \ell _ { \gamma } ^ { \prime } ( C ^ { * } ; X ) ] = 0$ , we have $\operatorname* { P r } ( X \leq C ^ { * } ) = \gamma$ . Thus, $C ^ { * }$ is the $\gamma ^ { \mathrm { t h } }$ quantile of $X$ . Because the loss is convex and has gradients bounded by 1, we can get an online estimate of $C$ that converges to the $\gamma ^ { \mathrm { t h } }$ quantile of $X$ using online gradient descent (see, e.g., Shalev-Shwartz [25]). See Figure 1 for a plot of the loss for a random variable that takes six values with equal probability.
|
| 59 |
+
|
| 60 |
+
Suppose at some round we have $m$ samples of $X$ , with values $( x _ { 1 } , \ldots , x _ { m } )$ . The average derivative of the loss for that round is
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r l } & { \bar { \ell } _ { \gamma } ^ { \prime } ( C ; X ) = \displaystyle \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \{ \displaystyle { ( 1 - \gamma ) \quad \mathrm { i f } \ x _ { i } \le C } , } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad = \displaystyle \frac { 1 } { m } \bigg ( ( 1 - \gamma ) \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } \le C } - \gamma \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } > C } \bigg ) = \bar { b } - \gamma , } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $\begin{array} { r } { \bar { b } \triangleq \frac { 1 } { m } \sum _ { i \in [ m ] } \mathbb { I } _ { x _ { i } \leq C } } \end{array}$ is the empirical fraction of samples with value at most $C$ . For a given learning rate $\eta _ { C }$ , we can perform the update: $C \gets C - \eta _ { C } ( \bar { b } - \gamma )$ .
|
| 67 |
+
|
| 68 |
+
Geometric updates. Since $\bar { b }$ and $\gamma$ take values in $[ 0 , 1 ]$ , the linear update rule above changes $C$ by a maximum of $\eta _ { C }$ at each step. This can be slow if $C$ is on the wrong order of magnitude. At the other extreme, if the optimal value of $C$ is orders of magnitude smaller than $\eta _ { C }$ , the update can be very coarse, and may overshoot to become negative. To remedy such issues, we propose the following geometric update rule: $C \gets C \cdot \exp ( - \eta _ { C } ( \bar { b } - \gamma ) )$ . This update rule converges quickly to the true quantile even if the initial estimate is off by orders of magnitude. It also has the attractive property that the variance of the estimate around the true quantile at convergence is proportional to the value at that quantile. In our experiments, we use the geometric update rule with $\eta _ { C } = 0 . 2$ .
|
| 69 |
+
|
| 70 |
+
# 2.1 DP-FedAvg with adaptive quantile clipping
|
| 71 |
+
|
| 72 |
+
Let $m$ be the number of users in a round and let $\gamma \in [ 0 , 1 ]$ denote the target quantile of the norm distribution at which we want to clip. For iteration $t \in [ T ]$ , let $C ^ { t }$ be the clipping threshold, and $\eta _ { C }$ be the learning rate. Let $\mathcal { Q } ^ { t }$ be set of users sampled in round $t$ . Each user $i \in \mathcal { Q } ^ { t }$ will send the bit $b _ { i } ^ { t }$ along with the usual model delta update $\Delta _ { i } ^ { t }$ , where $b _ { i } ^ { t } = \mathbb { I } _ { | | \Delta _ { i } ^ { t } | | _ { 2 } \leq C ^ { t } }$ . Defining $\begin{array} { r } { \bar { b } ^ { t } = \frac { 1 } { m } \sum _ { i \in \mathcal { Q } ^ { t } } b _ { i } ^ { t } } \end{array}$ we would like to apply the update $C \gets C \cdot \exp ( - \eta _ { C } ( \bar { b } - \gamma ) )$ . However, we can’t use ${ \bar { b } } ^ { t }$ directly, since it may reveal private information about the magnitude of users’ updates. To remedy this, we add Gaussian noise to the sum: $\begin{array} { r } { \tilde { b } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \bar { b } _ { i } ^ { t } + \mathcal { N } ( O , \sigma _ { b } ^ { 2 } ) \right) } \end{array}$ . The DPFedAvg algorithm with adaptive clipping is shown in Algorithm 1. We augment basic federated averaging with server momentum, which improves convergence [14, 24].2
|
| 73 |
+
|
| 74 |
+
# Algorithm 1 DPFedAvg-M with adaptive clipping
|
| 75 |
+
|
| 76 |
+
function $\mathrm { T r a i n } ( m , \gamma , \eta _ { c } , \eta _ { s } , \eta _ { C } , z , \sigma _ { b } , \beta )$ Initialize model $\theta ^ { 0 }$ , clipping bound $C ^ { 0 }$ z∆ ← z−2 − (2σb)−2−1/2 for each round $t = 0 , 1 , 2 , \ldots { \dot { \mathbf { c } } }$ o ${ \mathcal { Q } } ^ { t } \gets$ (sample $m$ users uniformly) for each user $i \in \mathcal { Q } ^ { t }$ in parallel do $\begin{array} { r l } & { \quad ( \Delta _ { i } ^ { t } , b _ { i } ^ { t } ) \gets \mathrm { ~ F e d A v g } ( i , \theta ^ { t } , \eta _ { c } , C ^ { t } ) } \\ & { \sigma _ { \Delta } \gets z _ { \Delta } C ^ { t } } \\ & { \tilde { \Delta } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \Delta _ { i } ^ { t } + \mathcal { N } ( 0 , I \sigma _ { \Delta } ^ { 2 } ) \right) } \\ & { \bar { \Delta } ^ { t } = \beta \bar { \Delta } ^ { t - 1 } + ( 1 - \beta ) \tilde { \Delta } ^ { t } } \\ & { \theta ^ { t + 1 } \gets \theta ^ { t } + \eta _ { s } \bar { \Delta } ^ { t } } \\ & { \tilde { b } ^ { t } = \frac { 1 } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } b _ { i } ^ { t } + \mathcal { N } ( O , \sigma _ { b } ^ { 2 } ) \right) } \end{array}$
|
| 77 |
+
|
| 78 |
+
$C ^ { t + 1 } \gets C ^ { t } \cdot \exp \left( - \eta _ { C } ( \tilde { b } ^ { t } - \gamma ) \right)$ function FedAvg(i, θ0, η, C) θ ← θ0 $\mathcal { G } $ (user i’s local data split into batches) for batch $g \in { \mathcal { G } }$ do $\begin{array} { r l } & { \quad \theta \gets \theta - \eta \nabla \ell ( \theta ; g ) } \\ & { \Delta \gets \theta - \theta ^ { 0 } } \\ & { b \gets \mathbb { I } _ { | | \Delta | | \leq C } } \\ & { \Delta ^ { \prime } \gets \Delta \cdot \operatorname* { m i n } \left( 1 , \frac { C } { | | \Delta | | } \right) } \\ & { \mathrm { ~ r e t u r n } \left( \Delta ^ { \prime } , b \right) } \end{array}$
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 2: Evolution of the quantile estimate on data drawn from log-normal distributions. The three plots use data drawn from the exponential of $\mathcal { N } ( 0 . 0 , 1 . 0 )$ , $\mathcal { N } ( \bar { 0 . 0 } , 0 . 1 )$ , and $\mathcal { N } ( \log { 1 0 } , 1 . 0 )$ , respectively. Curves are shown for each of five quantiles: (0.1, 0.3, 0.5, 0.7, 0.9), and the dashed lines show the true value at each quantile. Hyperparameters are as discussed in the text and used in the experiments of Section 3: $\eta _ { C } = 0 . 2 , C ^ { 0 } \stackrel { \sim } { = } 0 . \dot { 1 } , m = 1 0 0 , \sigma _ { b } = m / 2 0$ . After an initial phase of exponential growth, the true quantile is fairly closely tracked. A smaller value of $\eta _ { C }$ would allow more accurate tracking at the cost of slower convergence, but since the quantile value is only used as a heuristic for clipping, a small amount of noise is tolerable. The entire sequence of values estimated for each target quantile satisfy $( 0 . 0 3 4 , n ^ { - 1 . 1 } )$ -differential privacy using RDP composition across the 200 rounds assuming fixed-size samples of $m = 1 0 0$ out of a total population of $\bar { n } = 1 0 ^ { 6 }$ [29].
|
| 82 |
+
|
| 83 |
+
Theorem 1. One step of $D P$ -FedAvg with adaptive clipping using $\sigma _ { b }$ noise standard deviation on the clipped counts $\sum b _ { i } ^ { t }$ and $z _ { \Delta }$ noise multiplier on the vector sums $\sum \Delta _ { i } ^ { t }$ is equivalent (so far as privacy accounting is concerned) to one step of non-adaptive $D P$ -FedAvg with noise multiplier $z$ if we set z∆ = z−2 − (2σb)−2−1/2.
|
| 84 |
+
|
| 85 |
+
Proof. We make a conceptual change to the algorithm that does not change the behavior or privacy properties but allows us to analyze each step as if it were a single private Gaussian sum. Instead of sending $( \Delta _ { i } ^ { t } , b _ { i } ^ { t } )$ , each user sends $( \hat { \Delta } _ { i } ^ { t } , \hat { b } _ { i } ^ { t } ) \triangleq \big ( \Delta _ { i } ^ { t } / \sigma _ { \Delta } , ( b _ { i } ^ { t } - \scriptscriptstyle 1 / 2 ) / \sigma _ { b } \big )$ . The server adds noise with covariance $I$ and averages, then reverses the transformation so $\begin{array} { r } { \tilde { \Delta } ^ { t } = \frac { \sigma _ { \Delta } } { m } \biggl ( \sum _ { i \in \mathcal { Q } ^ { t } } \hat { \Delta } _ { i } ^ { t } + \mathcal { N } ( 0 , I ) \biggr ) } \end{array}$ and $\begin{array} { r } { \tilde { b } ^ { t } = \frac { \sigma _ { b } } { m } \left( \sum _ { i \in \mathcal { Q } ^ { t } } \hat { b } _ { i } ^ { t } + \mathcal { N } ( 0 , 1 ) \right) + 1 / 2 } \end{array}$ . Noting that $\vert \vert ( \hat { \Delta } _ { i } ^ { t } , \hat { b } _ { i } ^ { t } ) \vert \vert \leq S \triangleq \left( ( C ^ { t } / \sigma _ { \Delta } ) ^ { 2 } + \left( 1 / 2 \sigma _ { b } \right) ^ { 2 } \right) ^ { 1 / 2 }$ , it is clear that the two Gaussian sum queries of Algorithm 1 are equivalent to pre- and post-processing of a single query with sensitivity $S$ and covariance $I$ , or noise multiplier $z = { \overset { \cdot } { 1 } } / s = \overset { \cdot } { \left( z _ { \Delta } ^ { - 2 } + ( 2 \sigma _ { b } ) ^ { - 2 } \right) ^ { - 1 / 2 } }$ Rearranging yields the result.
|
| 86 |
+
|
| 87 |
+
In practice, we recommend using a value of $\sigma _ { b } = m / 2 0$ . Since the noise is Gaussian, this implies that the error $| \tilde { b } ^ { t } - \bar { b } ^ { t } |$ will be less than 0.1 with $9 5 . 4 \%$ probability, and will be no more than 0.15 with $9 9 . 7 \%$ probability. Even in this unlikely case, assuming a geometric update and a learning rate of $\eta _ { C } = 0 . 2$ , the error on the update would be a factor of $\exp ( 0 . 2 \times 0 . 1 5 ) = 1 . 0 3$ , a small deviation. So this default gives high privacy for an acceptable amount of noise in the quantile estimation process. Using Thm. 1, we can compute that to achieve an effective combined noise multiplier of $z = 1$ , with $m = 1 0 0$ clients per round, the noise multiplier $z _ { \Delta }$ is approximately 1.005. So we are paying only a factor of $0 . 5 \%$ more noise on the updates for adaptive clipping with the same privacy guarantee (a quantity which only gets smaller with increasing $m$ ). These constants $\zeta \sigma _ { b } = m / 2 0$ and $\eta _ { C } = 0 . 2 $ ) are what we use in the experiments of Section 3.
|
| 88 |
+
|
| 89 |
+
The clipping norm can be initialized to any value $C ^ { 0 }$ that is safely on the low end of the expected norm distribution. If it is too high and needs to adapt downward, a lot of noise may be added at the beginning of model training, which may swamp the model. However there is little danger in setting it quite low, since the geometric update will make it grow exponentially until it matches the true quantile. In our experiments we use an initial clip of 0.1 for all tasks. It is easy to compute that with a learning rate of $\eta _ { C } = 0 . 2$ and a target quantile of $\gamma = 0 . 5$ , if every update is clipped, the quantile estimate will increase by a factor of ten every 23 iterations. In order to show the effectiveness of the algorithm at tracking a known quantile, we ran it on simulated data for which we can compute the true quantile exactly. Figure 2 shows the result of this experiment.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Task</td><td>model</td><td>N</td><td>n</td><td>T</td><td>2</td><td>m</td><td>nc</td><td>ns</td><td>Cmin</td><td>Cmax</td></tr><tr><td>CIFAR-100</td><td>ResNet</td><td>11M</td><td>500</td><td>4000</td><td>0.669</td><td>2231</td><td>0.1</td><td>0.32</td><td>0.75</td><td>2.2</td></tr><tr><td>EMNIST-CR</td><td>CNN</td><td>1.2M</td><td>3400</td><td>1500</td><td>0.513</td><td>513</td><td>0.032</td><td>1.0</td><td>0.28</td><td>0.85</td></tr><tr><td>EMNIST-AE</td><td>Deep AE</td><td>2.8M</td><td>3400</td><td>3000</td><td>0.659</td><td>2197</td><td>3.2</td><td>1.78</td><td>0.22</td><td>0.95</td></tr><tr><td>SHAKESPEARE</td><td>C-LSTM</td><td>820k</td><td>715</td><td>1200</td><td>0.510</td><td>510</td><td>1.0</td><td>0.32</td><td>0.25</td><td>3.6</td></tr><tr><td>SO-NWP</td><td>W-LSTM</td><td>4.1M</td><td>342k</td><td>1500</td><td>1.396</td><td>13958</td><td>0.18</td><td>1.78</td><td>0.30</td><td>1.6</td></tr><tr><td>SO-LR</td><td>Multi-LR</td><td>5M</td><td>342k</td><td>1500</td><td>1.396</td><td>13958</td><td>320.0</td><td>1.78</td><td>16.0</td><td>135.0</td></tr></table>
|
| 92 |
+
|
| 93 |
+
Table 1: Dataset statistics and chosen hyperparameters. Left: model type, number of trainable parameters $N$ , number of training clients $n$ , and the number of training rounds $T$ used (following Reddi et al. [24]). Middle: the noise multiplier $z$ and number of clients per round $m$ necessary to achieve $( 5 , n ^ { - 1 . 1 } )$ -DP with less than $5 \%$ model performance loss if each task had a population of $n = 1 0 ^ { 6 }$ [29]. Right: the optimal unclipped baseline client and server learning rates (Sec. 3.1) for each task and chosen values of minimum and maximum fixed clips (Sec. 3.2).
|
| 94 |
+
|
| 95 |
+
# 3 Experiments
|
| 96 |
+
|
| 97 |
+
To empirically validate the approach, we examine the behavior of our algorithm on six of the public benchmark federated learning tasks defined by Reddi et al. [24], which are to our knowledge the most realistic and representative publicly available federated learning tasks that exist to date. All six tasks are non-i.i.d. with respect to user partitioning: indeed with the exception of CIFAR-100, the data is partitioned according to the actual human user who generated the data, for example the writer of the EMNIST characters or the Stack Overflow user who asked or answered a question. Table 1 (left) lists the characteristics of the datasets.
|
| 98 |
+
|
| 99 |
+
Two of the tasks derived from Stack Overflow data (SO-NWP and SO-LR) are ideal for DP research due to the very high number of users (342k) making it possible to train models with good user-level privacy without sacrificing accuracy. The other four tasks (CIFAR-100, EMNIST-AE, EMNISTCR, SHAKESPEARE) are representative learning tasks, but not representative population sizes for real world cross-device FL applications. Therefore we focus on establishing that adaptive clipping works well with 100 clients per round on these tasks in the regime where the noise is at a level such that utility is just beginning to degrade. Under the assumption that a larger population were available, one could increase $m$ , $\sigma _ { \Delta }$ , and $\sigma _ { b }$ proportionally to achieve comparable utility with high privacy. This should not significantly affect convergence (indeed, it might be beneficial) since the only effect is to increase the number of users in the average $\tilde { \Delta } ^ { t }$ , reducing the variance. Table 1 (middle) shows the number of clients per round with which our experiments indicate we could achieve $( 5 , n ^ { - 1 . 1 } )$ -DP for each dataset with acceptable model performance loss (less than $5 \%$ relative to non-private training, as discussed later) if each dataset had $n = 1 0 ^ { 6 }$ clients, using RDP composition with fixed-size subsampling [29].3
|
| 100 |
+
|
| 101 |
+
# 3.1 Baseline client and server learning rates
|
| 102 |
+
|
| 103 |
+
Reddi et al. [24] provide optimized client and server learning rates for federated averaging with momentum that serve as a starting point for our experimental setup. For almost all hyperparameters (model configuration, evaluation metrics, client batch size, total rounds, etc.) we replicate their experiments, but with two changes. First, we increase the number of clients per round to 100 for all tasks. This reduces the variance in the updates to a level where we can reasonably assume that adding more clients is unlikely to significantly change convergence properties [18]. Second, as shown in Algorithm 1 we use unweighted federated averaging, thus eliminating the need to set yet another difficult-to-fit hyperparameter: the expected total weight of clients in a round. Since these changes might require different settings, we reoptimize the client and server learning rates for our baseline with no clipping or noise. We ran a small grid of 25 configurations for each task jointly exploring client and server learning rates whose logarithm (base-10) differs from the values in Table 10 of Reddi et al. [24] by $\{ \ - \% , - \% , 0 , \% , \% \}$ . The optimal baseline client and server learning rates for our experimental setup are shown in Table 1 (right).
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Impact of clipping without noise. Performance of the unclipped baseline compared to five settings of $\gamma$ , from $\gamma = 0 . 1$ (aggressive clipping) to $\gamma = 0 . 9$ (mild clipping). The values shown are the evaluation metrics on the validation set averaged over the last 100 rounds. Note that the $y$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 107 |
+
|
| 108 |
+
Because clipping (whether fixed or adaptive) reduces the average norm of the client updates, it may be necessary to use a higher server learning rate to compensate. Therefore, for all approaches with clipping—fixed or adaptive—we search over a small grid of five server learning rates, scaling the values in Table 1 by $\{ 1 , \bar { 1 0 } ^ { 1 / 4 } , 1 0 ^ { 1 / 2 } , 1 0 ^ { 3 / 4 } , 1 0 \}$ . For all configurations, we report the best performing model whose server learning rate was chosen from this small grid on the validation set.4
|
| 109 |
+
|
| 110 |
+
We first examine the impact of adaptive clipping without noise to see how it affects model performance. Figure 3 compares baseline performance without clipping to adaptive clipping with five different quantiles. For each quantile, we show the best model after tuning over the five server learning rates mentioned above on the validation set. On three tasks (CIFAR-100, EMNIST-AE, SO-NWP), clipping improves performance relative to the unclipped baseline. On SHAKESPEARE and SO-LR performance is slightly worse, but we can conclude that adaptive clipping to the median generally fares well compared to not using clipping across tasks. Note that for our primary goal of training with DP, it is essential to limit the sensitivity one way or another, so the modest decrease in performance observed from clipping on some tasks may be part of the inevitable tension between privacy and utility.
|
| 111 |
+
|
| 112 |
+
# 3.2 Fixed-clip baselines
|
| 113 |
+
|
| 114 |
+
We would like to compare our adaptive clipping approach to a fixed clipping baseline, but comparing to just one fixed-clip baseline may not be enough to demonstrate that adaptive clipping consistently performs well. Instead, our strategy will be to show that quantile-based adaptive clipping performs as well or nearly as well as any fixed clip chosen in hindsight. If we can first identify clipping norms that span the range of normal values during training on each problem/configuration, we can compare adaptive clipping to fixed clipping with those norms.
|
| 115 |
+
|
| 116 |
+
To that end, we first use adaptive clipping without noise to discover the value of the update norm distribution at the following five quantiles: $\{ 0 . 1 , 0 . 3 , 0 . 5 , 0 . 7 , 0 . 9 \}$ . Then we choose as the minimum of our fixed clipping range the smallest value at the 0.1 quantile over the course of training, and as the maximum the largest value at the 0.9 quantile. Plots of the update norms during training on each of the tasks are shown in Figure 4.
|
| 117 |
+
|
| 118 |
+
On each task there is a ramp up period where the clipping norm, initialized to 0.1 for all tasks, catches up to the correct norm distribution. Thus we disregard norm values collected until the actual fraction of clipped counts ${ \bar { b } } ^ { t }$ on some round is within 0.05 of the target quantile $\gamma$ . The chosen values for the minimum and maximum fixed clips for each task are shown in Table 1 (right). Our fixed-clipping baseline uses five fixed clipping norms logarithmically spaced in that range. Here we are taking advantage of having already run adaptive clipping to minimize the number of fixed clip settings we need to explore for each task. If we had to explore over the entire range knowing only the endpoints across all tasks (0.22, 135.0) at the same resolution, we would need nearly four times as many clip values per task.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
0.10.3 0.10.3 0.10.3Figure 4: Evolution of the adaptive clipping norm at five different quantiles (0.1, 0.3, 0.5, 0.7, 0.9) 0.50.70.9 0.50.70.9 0.70.9on each task with no noise. The norms are estimated using geometric updates with $\eta _ { C } = 0 . 2$ and an initial value $C ^ { 0 } = 0 . 1$ . With the possible exception of SO-LR, the estimated quantiles appear to closely track an evolving update norm distribution. Note that each task has a unique shape to its update norm evolution, which further motivates an adaptive approach.
|
| 122 |
+
|
| 123 |
+
For each value of noise multiplier $z \in \{ 0 , 0 . 0 1 , 0 . 0 3 , 0 . 1 \}$ we trained using the five fixed clipping norms and compare to adaptive clipping with the five quantiles (0.1, 0.3, 0.5, 0.7, 0.9). Note that for the fixed clipping runs $z _ { \Delta } = z$ ; that is, for fixed clip $C$ , the noise applied to the the updates has standard deviation $z C$ . As discussed in section 2.1, on the adaptive clipping runs $z _ { \Delta }$ is slightly higher due to the need to account for privacy when estimating the clipped counts.
|
| 124 |
+
|
| 125 |
+
# 3.3 Comparison of fixed and adaptive clipping
|
| 126 |
+
|
| 127 |
+
Validation set results with adaptive clipping are shown in Figure 5 and with fixed clipping in Figure 6. These charts show that we have identified the noise regime in which performance is beginning to degrade. There is always a tension between privacy and utility: as the amount of noise increases, eventually performance will go down. For the purpose of this study we consider more than a $5 \%$ relative reduction in evaluation metric to be unacceptable. Therefore for each task, we look at the level of noise $z ^ { * }$ at which the evaluation metric on the validation set is still within $5 \%$ of the value with no noise, but adding more noise would degrade performance beyond $5 \%$ . Given $z ^ { * }$ for each task, we then choose $C ^ { * }$ to be the fixed clip value that gives best performance on the validation set. The values of $z ^ { * }$ and $C ^ { * }$ are shown in Figure 7 (left).
|
| 128 |
+
|
| 129 |
+
For our final test set evaluation, we compare adaptive clipping to the median to fixed clipping at $C ^ { * }$ . The results are in Figure 7 (right). We show the average test set performance and bootstrapped $9 5 \%$ confidence interval over 20 runs varying the random seed used for client selection and DP noise. On three of the tasks (CIFAR-100, EMNIST-AE, SHAKESPEARE), clipping to the median actually outperforms fixed clipping to the best fixed clip chosen in hindsight, and on two more (EMNIST-CR, SO-NWP), the performance is comparable. Only on SO-LR the best fixed clip does perform somewhat better. This task seems to be unusual in that best performance comes from aggressive clipping, so a small fixed clip fares better than adaptive clipping to the median. However, looking at Figure 6 (and noting the scale of the $y$ axis), on this task more than the others, getting the exact right fixed clip is important. The development set recall $\textcircled { \alpha } 5$ value of 55.1 corresponds to the optimal fixed clip of 16.0. The next larger fixed clip of 27.3 gave a recall of only 51.8, and larger clips fared even worse. So an expensive hyperparameter search may be necessary to even get close to this high-performing fixed clip value.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 5: Evaluation metric performance of adaptive clipping with five settings of $\gamma$ for each of four effective noise multipliers $z$ . Note that the $y$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 6: Evaluation metric performance of fixed clipping with five settings of $C$ for each of four noise multipliers $z$ . Note that the $y \cdot$ -axes have been compressed to show small differences, and that for EMNIST-AE lower values are better.
|
| 136 |
+
|
| 137 |
+
# 4 Conclusions and implications for practice
|
| 138 |
+
|
| 139 |
+
In our experiments, we started with a high-performing non-private baseline with optimized client and server learning rates. We then searched over a small grid of larger server learning rates for our experiments with clipping (adaptive or fixed). This is one way to proceed in practice, if such non-private baseline results are available. More often, such baseline learning rates are not available, which will necessitate a search over client learning rates as well. In that case, it would be beneficial to enable adaptive clipping to the median during that hyperparameter search. The advantage of clipping relative to the unclipped baseline observed on some tasks could only increase if the other hyperparameters such as client learning rate were also chosen conditioned on the presence of clipping.
|
| 140 |
+
|
| 141 |
+
Although the experiments indicate that adaptive clipping to the median yields generally good results, on some problems (like SO-LR in our study) there may be gains from tuning the target quantile. It would require adding another dimension to the hyperparameter grid, exponentially increasing the tuning effort, but even this would be preferable to tuning the fixed clipping norm from scratch, since the grid can be smaller: we obtained good results on all problems by exploring only five quantiles, but the update norms in the experiments range over four orders of magnitude, from 0.22 to 135.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 7: Left: for each task, the maximum noise possible before performance begins to significantly degrade $( z ^ { * } )$ , and the best fixed clip $( C ^ { * } )$ chosen on the development set. Right: average test set performance and bootstrapped $9 5 \%$ confidence interval over 20 runs. In practice, finding the best fixed clipping norm would require substantial additional hyperparameter tuning.
|
| 145 |
+
|
| 146 |
+
Combining our results with the lessons taken from [18] and [24], the following strategy emerges for training a high-performing model with user-level differential privacy. We assume some non-private proxy data is available that may have comparatively few users $n ^ { \prime }$ , as well as that the true private data has enough users $n$ that the desired level of privacy is achievable.
|
| 147 |
+
|
| 148 |
+
1. With adaptive clipping to the median enabled, using a relatively small number of clients per round $m \approx 1 0 0 ^ { \circ } ,$ ), and a small amount of noise $z = 0 . 0 1$ ), search over client and server learning rates on non-private proxy data.
|
| 149 |
+
2. Fix the client and server learning rates. Using the non-private data and low value of $m$ , train several models increasing the level of noise $z$ until model performance at convergence begins to degrade.
|
| 150 |
+
3. To train the final model on private data, if $( m , z )$ is too small for the desired level of privacy even given $n$ , set $( m , z ) \alpha \cdot ( m , z )$ for some $\alpha > 1$ such that the privacy target $( \epsilon , \delta )$ is achieved.5 Finally, train the private model using that value of $m$ and $z$ .
|
| 151 |
+
|
| 152 |
+
By eliminating the need to tune the fixed clipping norm hyperparameter which interacts significantly with the client and server learning rates, the adaptive clipping method proposed in this work exponentially reduces the work necessary to perform the expensive first step of this procedure.
|
| 153 |
+
|
| 154 |
+
# References
|
| 155 |
+
|
| 156 |
+
[1] Martin Abadi, Andy Chu, Ian Goodfellow, Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In 23rd ACM Conference on Computer and Communications Security (ACM CCS), 2016.
|
| 157 |
+
[2] Martin Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, CCS ’16, pages 308–318, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4139-4. doi: 10.1145/2976749.2978318.
|
| 158 |
+
[3] Kareem Amin, Alex Kulesza, Andres Munoz, and Sergei Vassilvtiskii. Bounding user contributions: A bias-variance trade-off in differential privacy. In International Conference on Machine Learning, pages 263–271. PMLR, 2019.
|
| 159 |
+
[4] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 464–473. IEEE, 2014.
|
| 160 |
+
[5] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for federated learning on user-held data. arXiv preprint arXiv:1611.04482, 2016. [6] Keith Bonawitz, Fariborz Salehi, Jakub Konecnˇ y, Brendan McMahan, and Marco Gruteser. \` Federated learning with autotuned communication-efficient secure aggregation. In 2019 53rd Asilomar Conference on Signals, Systems, and Computers, pages 1222–1226. IEEE, 2019.
|
| 161 |
+
[7] Jean-Pierre Briot, Gaëtan Hadjeres, and François-David Pachet. Deep Learning Techniques for Music Generation - A Survey. arXiv e-prints, art. arXiv:1709.01620, Sep 2017.
|
| 162 |
+
[8] Nicholas Carlini, Chang Liu, Jernej Kos, Úlfar Erlingsson, and Dawn Song. The secret sharer: Measuring unintended neural network memorization & extracting secrets. CoRR, abs/1802.08232, 2018. URL http://arxiv.org/abs/1802.08232.
|
| 163 |
+
[9] Kamalika Chaudhuri, Claire Monteleoni, and Anand D Sarwate. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12(Mar):1069–1109, 2011.
|
| 164 |
+
[10] Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In EUROCRYPT, 2006.
|
| 165 |
+
[11] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference, pages 265–284. Springer, 2006.
|
| 166 |
+
[12] Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. Model inversion attacks that exploit confidence information and basic countermeasures. In Proceedings of the 22Nd ACM SIGSAC Conference on Computer and Communications Security, CCS ’15, pages 1322–1333, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3832-5. doi: 10.1145/2810103.2813677.
|
| 167 |
+
[13] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 1026–1034, Dec 2015. doi: 10.1109/ICCV.2015.123.
|
| 168 |
+
[14] Tzu-Ming Harry Hsu, Hang Qi, and Matthew Brown. Measuring the effects of non-identical data distribution for federated visual classification, 2019.
|
| 169 |
+
[15] Roger Iyengar, Joseph P. Near, Dawn Song, Om Thakkar, Abhradeep Thakurta, and Lun Wang. Towards practical differentially private convex optimization. In S&P 2019, 2019.
|
| 170 |
+
[16] Jakub Konecnˇ y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, \` and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016.
|
| 171 |
+
|
| 172 |
+
[17] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Agüera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, AISTATS 2017, 20-22 April 2017, Fort Lauderdale, FL, USA, pages 1273–1282, 2017. URL http://proceedings.mlr. press/v54/mcmahan17a.html.
|
| 173 |
+
|
| 174 |
+
[18] H. Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. Learning differentially private recurrent language models. In ICLR 2018, 2018.
|
| 175 |
+
|
| 176 |
+
[19] Luca Melis, Congzheng Song, Emiliano De Cristofaro, and Vitaly Shmatikov. Exploiting Unintended Feature Leakage in Collaborative Learning. arXiv e-prints, art. arXiv:1805.04049, May 2018.
|
| 177 |
+
|
| 178 |
+
[20] Ilya Mironov. Rényi differential privacy. In 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pages 263–275. IEEE, 2017.
|
| 179 |
+
|
| 180 |
+
[21] Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. Smooth sensitivity and sampling in private data analysis. In Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 75–84, 2007.
|
| 181 |
+
|
| 182 |
+
[22] Nicolas Papernot, Martın Abadi, Úlfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semisupervised knowledge transfer for deep learning from private training data. stat, 1050, 2017.
|
| 183 |
+
|
| 184 |
+
[23] Nicolas Papernot, Shuang Song, Ilya Mironov, Ananth Raghunathan, Kunal Talwar, and Úlfar Erlingsson. Scalable private learning with pate. arXiv preprint arXiv:1802.08908, 2018.
|
| 185 |
+
|
| 186 |
+
[24] Sashank Reddi, Zachary Charles, Manzil Zaheer, Zachary Garrett, Keith Rush, Jakub Konecný, ˇ Sanjiv Kumar, and H. Brendan McMahan. Adaptive federated optimization, 2020.
|
| 187 |
+
|
| 188 |
+
[25] Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 2012.
|
| 189 |
+
|
| 190 |
+
[26] R. Shokri, M. Stronati, C. Song, and V. Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP), pages 3–18, May 2017. doi: 10.1109/SP.2017.41.
|
| 191 |
+
|
| 192 |
+
[27] C. Szegedy, , , P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–9, June 2015. doi: 10.1109/CVPR.2015.7298594.
|
| 193 |
+
|
| 194 |
+
[28] Oriol Vinyals, Lukasz Kaiser, Terry Koo, Slav Petrov, Ilya Sutskever, and Geoffrey Hinton. Grammar as a foreign language. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pages 2773–2781, Cambridge, MA, USA, 2015. MIT Press. URL http://dl.acm.org/citation.cfm?id=2969442.2969550.
|
| 195 |
+
|
| 196 |
+
[29] Yu-Xiang Wang, Borja Balle, and Shiva Prasad Kasiviswanathan. Subsampled rényi differential privacy and analytical moments accountant. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1226–1235. PMLR, 2019.
|
| 197 |
+
|
| 198 |
+
[30] X. Wu, M. Fredrikson, S. Jha, and J. F. Naughton. A methodology for formalizing modelinversion attacks. In 2016 IEEE 29th Computer Security Foundations Symposium (CSF), pages 355–370, June 2016. doi: 10.1109/CSF.2016.32.
|
| 199 |
+
|
| 200 |
+
[31] Xi Wu, Fengan Li, Arun Kumar, Kamalika Chaudhuri, Somesh Jha, and Jeffrey Naughton. Bolton differential privacy for scalable stochastic gradient descent-based analytics. In Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD ’17, pages 1307–1322, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-4197-4. doi: 10.1145/ 3035918.3064047.
|
md/train/S1enmaVFvS/S1enmaVFvS.md
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DATA-DRIVEN APPROACH TO ENCODING AND DECODING 3-D CRYSTAL STRUCTURES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Generative models have achieved impressive results in many domains including image and text generation. In the natural sciences, generative models have lead to rapid progress in automated drug discovery. Many of the current methods focus on either 1-D or 2-D representations of typically small, drug-like molecules. However, many molecules require 3-D descriptors and exceed the chemical complexity of commonly used datasets. We present a method to encode and decode the position of atoms in 3-D molecules along with a dataset of nearly 50,000 stable crystal unit cells that vary from containing 1 to over 100 atoms. We construct a smooth and continuous 3-D density representation of each crystal based on the positions of different atoms. Two different neural networks were trained on a dataset of over 120,000 three-dimensional samples of single and repeating crystal structures. The first, an Encoder-Decoder pair, constructs a compressed latent space representation of each molecule and then decodes this description into an accurate reconstruction of the input. The second network segments the resulting output into atoms and assigns each atom an atomic number. By generating compressed, continuous latent spaces representations of molecules we are able to decode random samples, interpolate between two molecules, and alter known molecules.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative models have recently seen tremendous success in generating 2-D images of every day objects (Kingma & Welling, 2013; Goodfellow et al., 2014; Brock et al., 2018; Razavi et al., 2019). The size and accuracy of generated results has greatly improved to the point where samples from the latent space decode to photo-realistic samples (Brock et al., 2018; Razavi et al., 2019). A very exciting and important future avenue for generative models is the generation of 3-D structures, like in the world around us. Adversarial networks and autoencoders have been extended into 3-D and have shown they are able to encode useful representations of everyday objects (Wu et al., 2016; Zhu et al., 2018; Brock et al., 2016; Achlioptas et al., 2017; Valsesia et al., 2018; Meng et al., 2019; Maturana & Scherer, 2015). Representations using point clouds have gained popularity as a way to capture the distribution of different types of objects (Achlioptas et al., 2017; Yang et al., 2019; Wu et al., 2018).
|
| 12 |
+
|
| 13 |
+
As machine learning approaches are able to understand and recreate the underlying distributions for many different types of objects in our world, the application of these tools in the physical sciences is a very exciting direction. A clear field where generative models can have a tremendous impact is in material discovery, which is very important for designing new batteries or carbon capture devices for fighting climate change.
|
| 14 |
+
|
| 15 |
+
One very successful area of applying generative models to the sciences has been the field of drug discovery (Jin et al., 2018; Gómez-Bombarelli et al., 2018; Assouel et al., 2018) (see Schwalbe-Koda & Gómez-Bombarelli (2019) for an excellent summary of many methods). The success of machine learning in this domain has been enormously helpful as a process that was often painstakingly slow has been rapidly accelerated in searching an unimaginably large space of possible drug compounds, estimate to be up to $1 0 ^ { 6 0 }$ (Polishchuk et al., 2013). Additionally, excellent datasets such as QM9 (Ramakrishnan et al., 2014) and ZINC (Irwin et al., 2012) which contain molecules of interest along with their precomputed properties have allowed for comparing different methods and developing state-of-the-art tools.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Examples of crystal unit cells. Each example shows the unit cell of a crystal. Different colors represent different atomic species. A red, green, and blue line represent the 3 axes of the crystal. Note that they vary in length and angle. Additionally, some unit cells have just one or two atoms while others have nearly 100. Visualizations were made with Mercury (Macrae et al., 2008).
|
| 19 |
+
|
| 20 |
+
By learning a compressed, useful, latent space representation, this enormous space of molecules can be embedded in a simpler latent space that is easier to search Kusner et al. (2017). Using generative models, compounds hypothesized to have specific properties can be rapidly generated and then a targeted subset of these can be experimentally tested. For example, in Gómez-Bombarelli et al. (2018), an auxiliary property prediction task is introduced for a network separate from the encoder/decoder. This allows for optimization of properties in the latent space and then the resulting latent space vector is decoded into a candidate molecule that can undergo more rigorous computational testing before it is experimentally synthesized. Using a graph representation and reinforcement learning, You et al propose a novel method for molecule generation with specific properties You et al. (2018).
|
| 21 |
+
|
| 22 |
+
Most of the work combining generative models with chemical discovery has focused on molecules that can be represented in either 1 dimension (such as a SMILES string (Weininger, 1988)) or by leveraging a 2 dimensional representation of a molecule, such as a graph. While 1-D and 2-D representations have been very successful for many drug compounds, these representations are not sufficient to describe all molecules. For example, it is possible for different molecules, with very different properties, to have identical graphs (Gebauer et al., 2019). Additionally, there are more complex classes of compounds where the 3-D structure is integral to the molecule’s properties. Therefore, in this work we focus on generating representations of molecules where the 3-D information is essential for reconstruction. Generating 3-D structures is still a relatively nascent field, when compared to image and text generation. The data requirements for modeling 3-D structures are larger than their 2-D counterparts and there are fewer standard datasets (Nguyen-Phuoc et al., 2019). Additionally, to measure the properties of inorganic materials (like those considered here), costly DFT calculations are needed which require precise 3-D locations. There is an extra dimension in 3-D problems, providing additional symmetries that often need to be learned (Weiler et al., 2018). New work from generates adjacency matrices which are, by construction, invariant to rotation Hoffmann & Noé (2019). In either case, for the automatic generation of viable complex 3-D structures of inorganic compounds one needs to accurately generate the locations of many atoms in 3-D space.
|
| 23 |
+
|
| 24 |
+
In this work, we focus specifically on proposing an effective 3-D representation for this class of molecules that can not be represented in the same ways as many smaller molecules. We hope to promote work in this still nascent field which has yet to see the same level of success as the generation of smaller molecules. In the Appendix, we have provided a clear comparison with 1-D and 2-D representations. Currently, no direct comparisons are possible.
|
| 25 |
+
|
| 26 |
+
In addition to drug discovery, a promising avenue for molecular design is for minimizing environmental impact through the design of more efficient or more environmentally friendly compounds for a variety of applications. Designing more efficient materials for photo-voltaic panels and more environmentally friendly materials for batteries are both very exciting research directions for using machine learning as a tool towards mitigating climate change (Niu et al., 2015; Tabor et al., 2018; Gebauer et al., 2019; Rolnick et al., 2019). Many of the compounds of interest are crystal structures made of single small sub-units that repeat in all directions. This sub-unit is referred to as a “unit cell” and can vary in size and shape as well as internal arrangement and chemical composition.
|
| 27 |
+
|
| 28 |
+
In this work, we present a method for encoding and decoding a very important set of 3-D molecules that can not be represented using standard methods used for drug-like molecules. We directly encode and decode 3-D volumes of density from two different data representations. In the first, we use single unit cells, as shown in Fig. 1. Each unit cell is centered in the cube, but randomly rotated. In the second representation, we repeat the unit cell along all three axes such that the resulting sampled cube contains repeated unit cells of crystal structures, like those shown in Fig. 2 (and Fig. S6C). Many very interesting and important molecules, such as materials for solar panels or batteries, are composed of crystalline units. We train a variational autoencoder (VAE) and a network to segment the decoded output based on the true locations of atoms in tandem. By coupling these two tasks, we are able to accurately encode and decode 3-D atomic positions and species. As far as we are aware, this is not an explored direction as a means to represent molecules for encoding and decoding their 3-D arrangement. We summarize our contribution as follows:
|
| 29 |
+
|
| 30 |
+
• We propose a method for encoding and decoding 3-D molecules that can not be represented by traditional string or graph based approaches. By jointly training a VAE and a segmentation network on the output of the decoder, we train the entire network in an end-to-end fashion. • We consider two different problems: (1) encoding and decoding single unit cells and (2) encoding and decoding repeated unit cells. In both cases we accurately reconstruct the locations of atoms. We also achieve good results in atomic species identification and future work will improve this front. By sampling from $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ , we generate complex structures that have physically realistic spacing between atoms.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Network Architecture. We encode and decode a $3 0 \times 3 0 \times 3 0$ voxel grid representing $1 0 \mathring \mathrm { A }$ on each side. Each voxel contains the value of the density. The output of the decoder is passed into a 3-D U-Net Çiçek et al. (2016). We train the two models in parallel. In the schematic, we show the crystal represented as a repeated unit cell rather than a single unit cell. The black arrows indicate deterministic transformations. From the cif file, the species matrix is constructed. From this, the density matrix is computed.
|
| 34 |
+
|
| 35 |
+
# 2 PRELIMINARIES AND RELATED WORK
|
| 36 |
+
|
| 37 |
+
There are many classes of compounds that are of interest for data-driven discovery. There has been significant work exploring the generation of molecules with potential medicinal properties. These molecules tend to be organic molecules and can be represented efficiently using a string or a graph. A more complex class of molecules are inorganic crystal structures which vary in complexity across many different axes. Crystals are materials that are made up of a repeating pattern of a simpler “unit cell.” Crystal structures are of key interest for many environmental problems, such as materials for solar panels and batteries (Niu et al., 2015).
|
| 38 |
+
|
| 39 |
+
In contrast to problems in drug discovery, many crystals are not composed solely of organic molecules. Crystals commonly contain many heavy (non-Hydrogen) atoms which make various quantum mechanical calculations of their energetic properties very difficult and time consuming. For example, the common benchmark dataset QM9 for predicting quantum mechanical properties includes over 130,000 molecules contains fewer than 9 “heavy” atoms (Ramakrishnan et al., 2014).
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Single unit cell accuracy. (A) We show the voxel wise reconstruction error (plotted with mean square error) during training. (B) For random molecules in the test set, we plot the number of true atoms and the number of recovered atoms after segmentation. (C) For the reconstructed atoms, we plot the predicted atomic number versus the atomic number of the nearest true atom. (D) We compute the distance from each true atom to the nearest predicted atom and vice-versa (orange and blue, respectively). (E) For three different crystals we plot the predicted versus reconstructed density at each voxel. We also show 2-D slices through the target and prediction, along with the 3-D reconstructions. For plotting, the density on each figure is normalized between 0 and 1 though is not decoded as such.
|
| 43 |
+
|
| 44 |
+
There have been two parallel lines of work applying machine learning to material sciences. The first deals with the prediction of physical properties from a compound without performing a computationally expensive density functional theory (DFT) calculation.
|
| 45 |
+
|
| 46 |
+
Recently, Xie and Grossman introduced crystal graph convolutional networks (CGCNN) for accurate prediction of 8 different DFT-calculated properties of crystal structures (Xie & Grossman, 2018). MatErials Graph Network (MEGNet) uses graph neural networks (Chen et al., 2019) to predict a variety of energetic properties on both the QM9 dataset (Ramakrishnan et al., 2014) as well 69,000 crystal structures from the Materials Project (Jain et al., 2013). Another network, SchNet, uses 3-D spatial information to directly leverage the interactions between separate atoms. They then use a continuous-filter convolution for accurate property prediction (Schütt et al., 2018). These methods, and many more, have all achieved impressive results on many standard benchmark datasets. Cubuk, et al. use transfer learning to search an enormous space of molecules for promising Lithium ion conductors (Cubuk et al., 2019).
|
| 47 |
+
|
| 48 |
+
Another line of work is concerned with generating molecules, often molecules that have specific properties. In the past decade, generative models for drug discovery have achieved impressive results. Typically a representation of a compound, such as a SMILES string (Gómez-Bombarelli et al., 2018; Segler et al., 2017; Alperstein et al., 2019) or a graph (Jin et al., 2018; Assouel et al., 2018; Mansimov et al., 2019) is encoded and decoded. Then, by sampling the resulting latent space, novel molecules can be generated. Either by performing an auxiliary task with the latent space (as done in Gómez-Bombarelli et al. (2018)) and then performing optimization or by conditioning the latent space on desirable properties, novel chemical structures are obtained.
|
| 49 |
+
|
| 50 |
+
One possible representation of drug-like molecules is a SMILES string. However, a difficulty faced using the SMILES representation is ensuring that the decoder decoded a valid SMILES string (Gómez-Bombarelli et al., 2018; Kusner et al., 2017). Additionally, there is not a strong notion of distance between molecules and their SMILES representation (Jin et al., 2018). One approach, ChemTS, uses SMILES strings along with recurrent neural networks and Monte Carlo Tree Search to better ensure generated strings decode to real molecules (Yang et al., 2017). By explicitly penalizing invalid SMILES strings in their reward function they are able to bypass the difficulty in their decoded molecules being non-physical.
|
| 51 |
+
|
| 52 |
+
More recently, graph based methods have proven very successful in generating synthetically attainable molecules. By building a database of molecule fragments (like LEGO bricks), a graph is formed based on the connectivity of different structures (Jin et al., 2018). These methods have far fewer difficulties ensuring that the decoder produces physically valid molecules. For generation of physical molecules, this is a very important consideration, as there are many hard constrains that most be obeyed. Other graph based approaches include flow based models (Madhawa et al., 2019). Also using graph neural networks, E. Manismov and collaborators developed a method to, given a graph, recreate conformations of a 3-D molecule and predict its energetic properties (Mansimov et al., 2019). In Mansimov et al. (2019), the authors propose a graph-based generative method that is able to generate molecules with desired target properties. Impressively, they recover 3-D positional information for the atoms and show they achieve the required accuracy for relaxation.
|
| 53 |
+
|
| 54 |
+
An additional challenge for generative models in the physical sciences is ensuring that samples from the latent space, z, decode into physically plausible objects. The decoded objects need to obey physical constraints and an object that may appear physical is not certain to actually be experimentally realizable. In many domains this is not of specific concern, for example a generated animal is scored on some likelihood based on its visual appearance, not whether or not the generated creature is genetically possible. Recently, there have been generative models leveraging the 3-D nature of the problem. G-SchNet, a generative model for 3-D molecules (Gebauer et al., 2019) leverages the SchNet architecture- a start-of-the-art property prediction network (Schütt et al., 2018). They show they are able to generate molecules, placing atoms in 3-D space in a rotationally invariant manner. By appropriately conditioning the placement of new molecules based on the location and identity of previous molecules, they ensure the symmetries that are required for the molecules to relax in a DFT calculation. They propose expanding G-SchNet to generating crystal structures as a future direction.
|
| 55 |
+
|
| 56 |
+
While there is a rich literature in the generation of organic compounds, recently there has been work in the generation of more complex crystal structures, such as CrystalGAN (Nouira et al., 2018). The authors of CrystalGAN introduce geometric constraints and show that their method is able to produce stable structures compared to methods that do not include such domain knowledge such as DiscoGAN (Kim et al., 2017). CrystalGAN uses a dataset with a much larger selection of elements than much previous work, but they limit themselves to molecules of particular chemical structure, nor do they generate a 3-D arrangement. In this work, we do not limit the generated crystals in this way.
|
| 57 |
+
|
| 58 |
+
# 3 METHODS
|
| 59 |
+
|
| 60 |
+
We use a dataset containing $4 6 { , } 7 4 4 \mathrm { c i f }$ files which contains the information describing the unit cells of properly relaxed crystal structures from the Materials Project (Jain et al., 2013; Xie & Grossman, 2018). We use $80 \%$ of the data for testing and the other $20 \%$ for training. Using the Python library pymatgen we preprocess all of the data into the density 3-D matrices (Ong et al., 2013) described below. The boundary box of a crystal structure is controlled by six different degrees of freedom (see Fig. 1). Each side can have a different length and the angles between the three sides is also variable. Additionally, the internal complexity of each crystal can also vary widely– some unit cells in our dataset contain a single atom while other unit cells can have over one hundred different atoms. This tremendous variability in structure makes a universal representation difficult.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 4: Species reconstruction and latent space interpolation. (A) For five different randomly selected crystal unit cells we show the target and our reconstruction. Atoms are colored using default atomic colors, atoms with similar atomic number do not necessarily have similar colors. (B) We show the reconstruction of latent space interpolation between two molecules for 3 random sets of targets. For a video, see the Appendix.
|
| 64 |
+
|
| 65 |
+
# 3.1 DATA REPRESENTATION
|
| 66 |
+
|
| 67 |
+
As a first step for the problem of generating novel, physical crystal structures we begin with the simpler problem of encoding and decoding physical locations of atoms in space. We begin by considering a cube with side length $1 0 \mathrm { ~ \AA ~ }$ , which we represent by $M$ . We divide this cube into 30 equally spaced bins, resulting in a $3 0 \times 3 0 \times 3 0$ cube with each voxel representing $0 . 3 3 \mathring { \mathrm { A } }$ on each side (see Fig. 2 and Fig. 3E). In the appendix, we discuss this choice in more detail. This data representation is similar to many computer vision tasks, so we use similar convolution based network architectures.
|
| 68 |
+
|
| 69 |
+
We consider the crystal structures in our dataset where the maximum side length is less than $1 0 \mathring \mathrm { A }$ We consider two different data representations of different complexity. In the first, we shift each single unit cell to the center of our grid, then we randomly rotate it. In this representation, we encode and decode a single unit cell. We randomly sample 3 different rotations for each crystal. In this case, the encoded structures typically have between 1 and 30 atoms, with a few reaching between 50 and 100. In the second representation, we repeat these unit cells in each direction infinitely and randomly sample a cube in space. This means that each cube contains at least one unit cell, but some will contain more than one cell, since in all cases a cube with 10 Åsides is chosen. We choose one representation where a unit cell begins at $( 0 , 0 , 0 )$ and randomly sample 2 other cubes in this space resulting in a dataset of over 100,000 examples. In this representation, we typically encode the locations of between 20 to 100 atoms, with some having over 200. An advantage of our representation is that we are agnostic to the number of atoms that we are encoding and decoding, something that is difficult for other approaches such as graphs.
|
| 70 |
+
|
| 71 |
+
Using both these representations, we compute a density field, where each pixel $( i , j , k )$ is defined to have value
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
M _ { i , j , k } = \frac { 1 } { \sigma ^ { 3 } ( 2 \pi ) ^ { 3 / 2 } } \sum _ { m } Z _ { m } \mathrm { e x p } \left( - \frac { d ( \vec { Z } _ { m } , ( i , j , k ) ) ^ { 2 } } { 2 \sigma ^ { 2 } } \right)
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Where $d ( \cdot , \cdot )$ represents the Euclidean distance between the two arguments. $\vec { Z } _ { m }$ represents the 3-D coordinates of atom $Z _ { m }$ . We set $\sigma$ to $1 . 0 \mathring \mathrm { A }$ . When plotting, we multiply the output by $\sigma ^ { 3 } ( 2 \pi ) ^ { 3 / 2 }$ . We do this because when $\sigma = 1$ this results in the value of $Z$ (the atomic number) being present at its location in space. Because of the structure of this representation, when the density of atoms increases, there are more interactions making it harder to reconstruct the true identity of an atom. Ultimately, our aim is to be able to reconstruct the location and species of the different atoms in this grid. To that end, we also construct a species matrix, $_ { s }$ , where each voxel is either a 0 or equal to the atomic number of an atom that is within $0 . 5 \mathring \mathrm { \mathrm { A } }$ . We construct two neural networks that attempt to learn $M$ and $\pmb { S }$ in parallel. These two networks are trained together and are detailed in the following section.
|
| 78 |
+
|
| 79 |
+
# 3.2 NETWORK ARCHITECTURE
|
| 80 |
+
|
| 81 |
+
We use a variational autoencoder (Kingma & Welling, 2013) to encode and decode our 3-D density maps, $M$ . We use a $\beta$ multiplier on the Kullback-Leibler (KL) loss term to encourage no correlations between different elements of the latent space (Higgins et al., 2017). Our encoder, $E ( \cdot )$ , is a convolutional neural network. The decoder, $D ( \cdot )$ , uses upsampling and convolutions in favor of transposed convolutions (Odena et al., 2016). We use batch normalization (Ioffe & Szegedy, 2015), LeakyReLU activations, and the code is written in Pytorch (Paszke et al., 2017). The optimization is done using the Adam optimizer (Kingma & Ba, 2014). We use a latent space size of 300 for all experiments.
|
| 82 |
+
|
| 83 |
+
Simultaneously with training the VAE, we train a 3-D U-Net segmentation model, $\mathrm { U } _ { \mathrm { n e t } } ( \cdot )$ , with an attention mechanism to segment the output of the decoder (Ronneberger et al., 2015; Oktay et al., 2018). For accurate segmentation, especially in the case of a repeating lattice, it is important to be able to capture the dependencies between different atoms. We found that a U-Net model worked well, though future work will explore sequentially classifying atoms. Ideally, the primary work is done by the VAE and the role of U-Net is to perform the tedious optimization problem of recovering the species identity and locations that is most consistent with the reconstructed density field.
|
| 84 |
+
|
| 85 |
+
We include a weighted (by $\gamma$ ) loss from the segmentation in the loss of the encoder/decoder. In our experiments, we set $\gamma$ to 0.1. We experimented with $\gamma = 0$ and $\gamma = 0 . 3 3$ and found that 0.1 proved an acceptable intermediate. With $\gamma = 0 . 3 3$ we found slightly improved segmentation results but worse density reconstruction results. When we completely removed the effect of the species loss from the density reconstruction, species reconstruction results degraded.This allows us to train the entire network in an end-to-end fashion. The entire model is shown in Fig. 2.
|
| 86 |
+
|
| 87 |
+
We use three terms in the loss function for the VAE with the most weight given to the reconstruction of the density matrices. The segmentation network is only concerned with the final segmentation of the reconstruction from the decoder. Currently, we treat each atom type as a different class, with an additional (most common) class for “no atom.” The loss function used for the VAE is
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathcal { L } _ { \mathrm { V A E } } = L _ { \mathrm { R E } } ( \hat { M } , M ) + \beta ( D _ { \mathrm { K L } } ( q ( \mathbf { z } | M ) | | p ( \mathbf { z } ) ) ) + \gamma L _ { \mathrm { B C E } } ( \hat { S } , S ) .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
The first term is the reconstruction error and the third term is the binary cross entropy loss from the segmentation. The second term is the Kullback-Leibler divergence between the prior (set to $p ( \mathbf { z } ) \stackrel { - } { = } \mathcal { N } ( 0 , 1 ) )$ and $q ( z | M )$ the approximate posterior of the latent vector given input $M$ . We use a loss given by $\mathcal { L } _ { \mathrm { U - N e t } } = L _ { \mathrm { B C E } } ( \hat { S } , S )$ for the segmentation. In the above expression, $M$ is the input density field. $\mathbf { z } = E ( M )$ and $\hat { M } = D ( \pmb { \mathrm { z } } )$ is the reconstructed density field. The variable $_ { s }$ represents a 1-hot species matrix. Lastly, $\hat { \boldsymbol { S } } = \mathrm { U } _ { \mathrm { n e t } } \left( \hat { \boldsymbol { M } } \right)$ represents the probability matrix from the segmentation routine, which will be of shape: [ba $\mathrm { c h } \times \mathrm { c l a s s e s } \times \mathrm { x } \mathrm { - d i m } \times \mathrm { y } \mathrm { - d i m } \times \mathrm { z } \mathrm { - d i m } ]$ .
|
| 94 |
+
|
| 95 |
+
# 4 RESULTS
|
| 96 |
+
|
| 97 |
+
We find that we are able to accurately encode and decode 3-D representations of density fields (see Figs. 3 and S8). Using the segmentation network, we segment the output of the decoder into distinct atoms. Using a trained network, we show that random samples from the latent space decode to samples that obey many of the same statistics as the training distribution (see Fig. 5 and Fig. S7). Additionally, in the case of a repeating unit cell, we alter our training routine to condition the generation of crystals on the largest atomic number present.
|
| 98 |
+
|
| 99 |
+
# 4.1 PLACEMENT OF ATOMS
|
| 100 |
+
|
| 101 |
+
Using the output of the segmentation network, we take the $\tilde { \bf S } = \mathrm { a r g m a x } ( \hat { \bf S } )$ . From this representation, we find the connected components and use majority voting to assign each cluster an atom identity (see Appendix for details). In Fig. 3 (and Fig.S8) we show the accuracy of all top-1 predictions. We compare the results of our segmented matrix, S˜ with the true values, S. From the center of mass of each predicted atom $i$ , we compute the distance to the nearest true atom as follows
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r } { \operatorname* { m i n } _ { j } \ d ( \tilde { \bf S } _ { i } , { \bf S } _ { j } ) \forall \ j \ \mathrm { a n d } \operatorname* { m i n } _ { i } \ d ( \tilde { \bf S } _ { i } , { \bf S } _ { j } ) \ \forall \ i . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Table 1: Location and species reconstruction error. $P$ denotes prediction and $T$ denotes target. Distances in angstrom. For $Z$ reconstruction, we show the percentile at each absolute difference.
|
| 108 |
+
Locations
|
| 109 |
+
|
| 110 |
+
<table><tr><td>Percentile</td><td>P→T(A)</td><td>T→P(A)</td></tr><tr><td>0.</td><td>4.31×10-4</td><td>5.47×10-4</td></tr><tr><td>10.</td><td>5.03 ×10-2</td><td>5.02 × 10-2</td></tr><tr><td>20.</td><td>7.04 × 10-2</td><td>7.05 ×10-2</td></tr><tr><td>30.</td><td>9.12 × 10-2</td><td>9.13 × 10-2</td></tr><tr><td>40.</td><td>1.14 × 10-1</td><td>1.14 × 10-1</td></tr><tr><td>50.</td><td>1.36 × 10-1</td><td>1.37 × 10-1</td></tr><tr><td>60.</td><td>1.60 × 10-1</td><td>1.61 × 10-1 1.94 × 10-1</td></tr><tr><td>70. 80.</td><td>1.94 × 10-1 2.48 × 10-1</td><td>2.50 ×10-1</td></tr><tr><td>90. 100.</td><td>3.94 × 10-1 2.59</td><td>4.03 × 10-1 1.89</td></tr><tr><td>Species Abs.Diff.in Z</td><td>Percent</td><td></td></tr><tr><td>0</td><td>66.8 %</td><td></td></tr><tr><td>1</td><td>25.1 %</td><td></td></tr><tr><td>2</td><td>5.8 %</td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td>>3</td><td>2.2 %</td><td></td></tr></table>
|
| 111 |
+
|
| 112 |
+
Similarly, we can compute the distance from each true atom to the nearest predicted atom. By computing this metric in both directions, we are able to
|
| 113 |
+
|
| 114 |
+
verify that our model is placing atoms in the correct locations but only in those locations.
|
| 115 |
+
|
| 116 |
+
# 4.2 ACCURACY ON A UNIT CELL
|
| 117 |
+
|
| 118 |
+
In Fig. 3 we plot the results of applying our model to single unit cells of crystals (see also Table 1). We find out model is able to very accurately segment the locations of atoms with nearly $9 9 \%$ of atoms placed within $0 . 5 \mathring \mathrm { \mathrm { A } }$ of their true location. Nearly $90 \%$ of unit cells are reconstructed with the correct number of atoms and $9 7 \%$ of unit cells are reconstructed with less than 2 atoms extra or missing. $66 \%$ of species are correctly classified in the test set, with nearly 100 possible classes. When an atom is incorrectly classified, it is usually by one or two atomic numbers (see Table 1). Often adjacent elements (with atomic numbers that differ by 1) have very different chemical properties. We retrained the network to predict atomic group (where elements in the same group tend to have more similar properties) and found $93 \%$ accuracy. We report accuracy on $Z$ as this is a more difficult problem and in both cases we are still unable to reconstruct crystals with the accuracy to relax in a DFT calculation. Missed atoms typically occur near the boundary.
|
| 119 |
+
|
| 120 |
+
Next, we will discuss the same network applied to repeating unit cells. In all cases, the results for single unit cells are improvements over the results of multiple unit cells. For most figures, there are corresponding panels between the single unit cell and repeated cell results.
|
| 121 |
+
|
| 122 |
+
# 4.3 ACCURACY ON REPEATING UNIT CELLS
|
| 123 |
+
|
| 124 |
+
In Fig. S8C we show the percentiles of all pairwise minimum distances in our reconstructed samples. We find that $50 \%$ of all reconstructed atoms are in $0 . 2 \mathring \mathrm { A }$ . For both directions, the $7 5 ^ { \mathrm { t h } }$ percentile error was under $0 . 2 5 \mathring { \mathrm { A } }$ and the $9 0 ^ { \mathrm { t h } }$ percentile of reconstructed atoms were within $0 . 5 \mathring \mathrm { \mathrm { A } }$ . For predicted atoms that are within $0 . 5 \mathring \mathrm { \mathrm { A } }$ of a true atom’s location, we find that $6 5 . 4 \%$ of the time our prediction matches the atomic number exactly Fig. S8E. Again, nearly all errors occur near the boundary.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 5: Decode random latent space vectors. (A) We look at the spacing between nearest atoms from random draws from the latent space compared to those from real crystal structures. In blue we show the distribution of random reconstructions. In red we show the distribution of true inter-atomic spacing. (B) For 5 different random latent space vectors, we show the reconstructed density field and the resulting segmentation. Notice that in some cases small amounts of density are predicted but are not segmented into an atom (for example, in columns 3 and 4).
|
| 128 |
+
|
| 129 |
+
For 120 randomly selected reconstructed crystals from the test set, we compare the number of atoms after segmentation with the true number (Fig. S8D and Fig. 3B). In Fig. S8E we compare the predicted species compared with the species of the nearest true atom, independent of the distance to the nearest atom. We find that based on the results of Fig. S8, our current model is able to more accurately reconstruct the locations of atoms than obtain their true atomic number. This makes sense, given the enormous number of possible classes. However for repeating unit cells, when an atom is correctly predicted to be within $0 . 3 3 \mathring { \mathrm { A } }$ of a true atom location nearly $70 \%$ of the time the atom is assigned exactly the correct $Z$ value. The correlation between the true and predicted value is 0.98 suggesting that when the network makes an incorrect assessment, it chooses a nearby atomic number.
|
| 130 |
+
|
| 131 |
+
Further improvements in this placement and identification of atoms is necessary in achieving crystals that will appropriately relax in a DFT simulation for the calculation of quantum mechanical properties. However, a very exciting immediate application of this work is in random structure searching Pickard & Needs (2011).
|
| 132 |
+
|
| 133 |
+
# 4.4 LATENT SPACE INTERPOLATION
|
| 134 |
+
|
| 135 |
+
We encode two different true density maps into vectors $\mathbf { z } _ { 1 }$ and $\mathbf { z } _ { 2 }$ , respectively. We then linearly interpolate between these two values in latent space, constructing intermediate vectors $\tilde { \mathbf { z } } _ { i }$ . We decode the resulting latent space vectors which result in predicted density maps, $D ( \tilde { \mathbf { z } } )$ . Passing these into the trained segmentation routine, we find that intermediate results segment into atoms (see results on a single unit cell in Fig. 3 and Fig. 4). See results on a repeating lattice in Figs. S9 and S11)1.
|
| 136 |
+
|
| 137 |
+
# 4.5 RANDOM DRAWS
|
| 138 |
+
|
| 139 |
+
We can randomly sample a latent space vector $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ and we then decode the output. We do this for both single unit cells as well as for repeating lattices (see Appendix). Random structure searching is an important area of material science research an exciting direction for this work Pickard & Needs (2011). Using the network trained to encode and decode single unit cells, we decode a $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ .
|
| 140 |
+
|
| 141 |
+
In Fig. 5 we show the decoded density fields along with the resulting segmented output. There are a few desirable features: single cells are centered, atoms tend to be of similar atomic number, even in different parts of the reconstructed output, and atoms are not ever too close together.
|
| 142 |
+
|
| 143 |
+
# 5 CONCLUSIONS AND FUTURE WORK
|
| 144 |
+
|
| 145 |
+
The ability to encode and decode 3-D structures is a very interesting direction of recent work and increasingly important in helping create models that can understand the world that we live in. In current material design, a lot of focus has been on molecules where the 3-D structure can be safely ignored. However, in many cases this is not the case. We do not know of an effective data representation for these 3-D molecules and find that by directly utilizing a proxy for density we are able to encode and decode the geometry of these molecules.
|
| 146 |
+
|
| 147 |
+
An important future direction of research is to come up with successful representations for encoding crystal structures such that they can be easily encoded and decoded. Coming up with a representation of crystal unit cells (and 3-D structures in general) so that decoded molecules are physically plausible is an important aspect that needs to be carefully considered.
|
| 148 |
+
|
| 149 |
+
Our approach is currently unable to generate molecules that are physically stable, but there are promising directions in this direction. Using ideas similar to G-SchNet, using the decoded density field, atoms can be placed sequentially, conditioned on the placement of previous atoms (Gebauer et al., 2019). Working towards decoding molecules that are able to relax is a very exciting direction.
|
| 150 |
+
|
| 151 |
+
Another improvement would be to alter the structure of our encoder/decoder. Currently, we use standard 3-D convolutions. However, using SE(3) equivariant kernels from M. Weiler et al. is a promising direction for improved performance (Weiler et al., 2018). We feel that our current approach could be extended beyond the domain of material science, as we are able to encode a 3-D distance map, this approach could be broadly applied to many objects. In essence, we are able to learn a distance transform from an object. This is more general than for encoding and decoding atomic structures. To try to facilitate further research in the creation of 3-D representation of more complex atomic structures, we will release the code shortly.
|
| 152 |
+
|
| 153 |
+
# REFERENCES
|
| 154 |
+
|
| 155 |
+
Panos Achlioptas, Olga Diamanti, Ioannis Mitliagkas, and Leonidas Guibas. Learning representations and generative models for 3d point clouds. arXiv preprint arXiv:1707.02392, 2017.
|
| 156 |
+
|
| 157 |
+
Zaccary Alperstein, Artem Cherkasov, and Jason Tyler Rolfe. All smiles variational autoencoder, 2019.
|
| 158 |
+
|
| 159 |
+
Rim Assouel, Mohamed Ahmed, Marwin H Segler, Amir Saffari, and Yoshua Bengio. Defactor: Differentiable edge factorization-based probabilistic graph generation. arXiv preprint arXiv:1811.09766, 2018.
|
| 160 |
+
|
| 161 |
+
Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. Generative and discriminative voxel modeling with convolutional neural networks. arXiv preprint arXiv:1608.04236, 2016.
|
| 162 |
+
|
| 163 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 164 |
+
|
| 165 |
+
Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong. Graph networks as a universal machine learning framework for molecules and crystals. Chemistry of Materials, 31(9):3564–3572, 2019.
|
| 166 |
+
|
| 167 |
+
Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in vaes.
|
| 168 |
+
|
| 169 |
+
Xi Chen, Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. In D. D. Lee, U. V. Luxburg, I. Guyon, and R. Garnett (eds.), Advances In Neural Information Processing Systems 29, pp. 2172–2180. Curran Associates, Inc., 2016.
|
| 170 |
+
|
| 171 |
+
Özgün Çiçek, Ahmed Abdulkadir, Soeren S Lienkamp, Thomas Brox, and Olaf Ronneberger. 3d u-net: learning dense volumetric segmentation from sparse annotation. In International conference on medical image computing and computer-assisted intervention, pp. 424–432. Springer, 2016.
|
| 172 |
+
|
| 173 |
+
Ekin D Cubuk, Austin D Sendek, and Evan J Reed. Screening billions of candidates for solid lithium-ion conductors: A transfer learning approach for small data. The Journal of chemical physics, 150(21):214701, 2019.
|
| 174 |
+
|
| 175 |
+
Niklas WA Gebauer, Michael Gastegger, and Kristof T Schütt. Symmetry-adapted generation of 3d point sets for the targeted discovery of molecules. arXiv preprint arXiv:1906.00957, 2019.
|
| 176 |
+
|
| 177 |
+
Rafael Gómez-Bombarelli, Jennifer N Wei, David Duvenaud, José Miguel Hernández-Lobato, Benjamín Sánchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D Hirzel, Ryan P Adams, and Alán Aspuru-Guzik. Automatic chemical design using a data-driven continuous representation of molecules. ACS central science, 4(2):268–276, 2018.
|
| 178 |
+
|
| 179 |
+
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.
|
| 180 |
+
|
| 181 |
+
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. ICLR, 2(5):6, 2017.
|
| 182 |
+
|
| 183 |
+
Moritz Hoffmann and Frank Noé. Generating valid euclidean distance matrices, 2019.
|
| 184 |
+
|
| 185 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 186 |
+
|
| 187 |
+
John J Irwin, Teague Sterling, Michael M Mysinger, Erin S Bolstad, and Ryan G Coleman. Zinc: a free tool to discover chemistry for biology. Journal of chemical information and modeling, 52(7): 1757–1768, 2012.
|
| 188 |
+
|
| 189 |
+
Anubhav Jain, Shyue Ping Ong, Geoffroy Hautier, Wei Chen, William Davidson Richards, Stephen Dacek, Shreyas Cholia, Dan Gunter, David Skinner, Gerbrand Ceder, et al. Commentary: The materials project: A materials genome approach to accelerating materials innovation. Apl Materials, 1(1):011002, 2013.
|
| 190 |
+
|
| 191 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. arXiv preprint arXiv:1802.04364, 2018.
|
| 192 |
+
|
| 193 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. arXiv preprint arXiv:1802.05983, 2018.
|
| 194 |
+
|
| 195 |
+
Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1857–1865. JMLR. org, 2017.
|
| 196 |
+
|
| 197 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 198 |
+
|
| 199 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 200 |
+
|
| 201 |
+
Matt J Kusner, Brooks Paige, and José Miguel Hernández-Lobato. Grammar variational autoencoder. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1945– 1954. JMLR.org, 2017.
|
| 202 |
+
|
| 203 |
+
Clare F Macrae, Ian J Bruno, James A Chisholm, Paul R Edgington, Patrick McCabe, Elna Pidcock, Lucia Rodriguez-Monge, Robin Taylor, J van de Streek, and Peter A Wood. Mercury csd 2.0– new features for the visualization and investigation of crystal structures. Journal of Applied Crystallography, 41(2):466–470, 2008.
|
| 204 |
+
|
| 205 |
+
Kaushalya Madhawa, Katushiko Ishiguro, Kosuke Nakago, and Motoki Abe. Graphnvp: An invertible flow model for generating molecular graphs. arXiv preprint arXiv:1905.11600, 2019.
|
| 206 |
+
|
| 207 |
+
Elman Mansimov, Omar Mahmood, Seokho Kang, and Kyunghyun Cho. Molecular geometry prediction using a deep generative graph neural network. arXiv preprint arXiv:1904.00314, 2019.
|
| 208 |
+
|
| 209 |
+
Daniel Maturana and Sebastian Scherer. Voxnet: A 3d convolutional neural network for real-time object recognition. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 922–928. IEEE, 2015.
|
| 210 |
+
|
| 211 |
+
Hsien-Yu Meng, Lin Gao, Yu-Kun Lai, and Dinesh Manocha. Vv-net: Voxel vae net with group convolutions for point cloud segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 8500–8508, 2019.
|
| 212 |
+
|
| 213 |
+
Thu Nguyen-Phuoc, Chuan Li, Lucas Theis, Christian Richardt, and Yong-Liang Yang. Hologan: Unsupervised learning of 3d representations from natural images. arXiv preprint arXiv:1904.01326, 2019.
|
| 214 |
+
|
| 215 |
+
Guangda Niu, Xudong Guo, and Liduo Wang. Review of recent progress in chemical stability of perovskite solar cells. Journal of Materials Chemistry A, 3(17):8970–8980, 2015.
|
| 216 |
+
|
| 217 |
+
Asma Nouira, Jean-Claude Crivello, and Nataliya Sokolovska. Crystalgan: Learning to discover crystallographic structures with generative adversarial networks. arXiv preprint arXiv:1810.11203, 2018.
|
| 218 |
+
|
| 219 |
+
Augustus Odena, Vincent Dumoulin, and Chris Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/ deconv-checkerboard.
|
| 220 |
+
|
| 221 |
+
Ozan Oktay, Jo Schlemper, Loic Le Folgoc, Matthew Lee, Mattias Heinrich, Kazunari Misawa, Kensaku Mori, Steven McDonagh, Nils Y Hammerla, Bernhard Kainz, et al. Attention u-net: Learning where to look for the pancreas. arXiv preprint arXiv:1804.03999, 2018.
|
| 222 |
+
|
| 223 |
+
Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier, Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent L Chevrier, Kristin A Persson, and Gerbrand Ceder. Python materials genomics (pymatgen): A robust, open-source python library for materials analysis. Computational Materials Science, 68:314–319, 2013.
|
| 224 |
+
|
| 225 |
+
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. 2017.
|
| 226 |
+
|
| 227 |
+
Chris J Pickard and RJ Needs. Ab initio random structure searching. Journal of Physics: Condensed Matter, 23(5):053201, 2011.
|
| 228 |
+
|
| 229 |
+
Pavel G Polishchuk, Timur I Madzhidov, and Alexandre Varnek. Estimation of the size of drug-like chemical space based on gdb-17 data. Journal of computer-aided molecular design, 27(8):675–679, 2013.
|
| 230 |
+
|
| 231 |
+
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.
|
| 232 |
+
|
| 233 |
+
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019.
|
| 234 |
+
|
| 235 |
+
David Rolnick, Priya L Donti, Lynn H Kaack, Kelly Kochanski, Alexandre Lacoste, Kris Sankaran, Andrew Slavin Ross, Nikola Milojevic-Dupont, Natasha Jaques, Anna Waldman-Brown, et al. Tackling climate change with machine learning. arXiv preprint arXiv:1906.05433, 2019.
|
| 236 |
+
|
| 237 |
+
O. Ronneberger, P.Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention (MICCAI), volume 9351 of LNCS, pp. 234–241. Springer, 2015. URL http://lmb.informatik.uni-freiburg. de/Publications/2015/RFB15a. (available on arXiv:1505.04597 [cs.CV]).
|
| 238 |
+
|
| 239 |
+
Kristof T Schütt, Huziel E Sauceda, P-J Kindermans, Alexandre Tkatchenko, and K-R Müller. Schnet–a deep learning architecture for molecules and materials. The Journal of Chemical Physics, 148(24):241722, 2018.
|
| 240 |
+
|
| 241 |
+
Daniel Schwalbe-Koda and Rafael Gómez-Bombarelli. Generative models for automatic chemical design. arXiv preprint arXiv:1907.01632, 2019.
|
| 242 |
+
|
| 243 |
+
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.
|
| 244 |
+
|
| 245 |
+
Kihyuk Sohn, Honglak Lee, and Xinchen Yan. Learning structured output representation using deep conditional generative models. In Advances in neural information processing systems, pp. 3483–3491, 2015.
|
| 246 |
+
|
| 247 |
+
Daniel P Tabor, Loïc M Roch, Semion K Saikin, Christoph Kreisbeck, Dennis Sheberla, Joseph H Montoya, Shyam Dwaraknath, Muratahan Aykol, Carlos Ortiz, Hermann Tribukait, et al. Accelerating the discovery of materials for clean energy in the era of smart automation. Nature Reviews Materials, 3(5):5, 2018.
|
| 248 |
+
|
| 249 |
+
Diego Valsesia, Giulia Fracastoro, and Enrico Magli. Learning localized generative models for 3d point clouds via graph convolution. 2018.
|
| 250 |
+
|
| 251 |
+
Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3d steerable cnns: Learning rotationally equivariant features in volumetric data. In Advances in Neural Information Processing Systems, pp. 10381–10392, 2018.
|
| 252 |
+
|
| 253 |
+
David Weininger. Smiles, a chemical language and information system. 1. introduction to methodology and encoding rules. Journal of chemical information and computer sciences, 28(1):31–36, 1988.
|
| 254 |
+
|
| 255 |
+
Jiajun Wu, Chengkai Zhang, Tianfan Xue, William T Freeman, and Joshua B Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. In Advances in Neural Information Processing Systems, pp. 82–90, 2016.
|
| 256 |
+
|
| 257 |
+
Wenxuan Wu, Zhongang Qi, and Li Fuxin. Pointconv: Deep convolutional networks on 3d point clouds, 2018.
|
| 258 |
+
|
| 259 |
+
Tian Xie and Jeffrey C Grossman. Crystal graph convolutional neural networks for an accurate and interpretable prediction of material properties. Physical review letters, 120(14):145301, 2018.
|
| 260 |
+
|
| 261 |
+
Guandao Yang, Xun Huang, Zekun Hao, Ming-Yu Liu, Serge Belongie, and Bharath Hariharan. Pointflow: 3d point cloud generation with continuous normalizing flows. arXiv preprint arXiv:1906.12320, 2019.
|
| 262 |
+
|
| 263 |
+
Xiufeng Yang, Jinzhe Zhang, Kazuki Yoshizoe, Kei Terayama, and Koji Tsuda. Chemts: an efficient python library for de novo molecular generation. Science and technology of advanced materials, 18(1):972–976, 2017.
|
| 264 |
+
|
| 265 |
+
Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems, pp. 6410–6421, 2018.
|
| 266 |
+
|
| 267 |
+
Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jiajun Wu, Antonio Torralba, Josh Tenenbaum, and Bill Freeman. Visual object networks: image generation with disentangled 3d representations. In Advances in Neural Information Processing Systems, pp. 118–129, 2018.
|
| 268 |
+
|
| 269 |
+
# A SUPPLEMENTAL INFORMATION
|
| 270 |
+
|
| 271 |
+
A.1 VIDEOS
|
| 272 |
+
|
| 273 |
+
See anonymoized project site at: https://sites.google.com/view/ encode-decode-3d-crystals/home.
|
| 274 |
+
|
| 275 |
+
# B CHOICE OF DATA REPRESENTATION
|
| 276 |
+
|
| 277 |
+
We choose to use a 10 Angstrom cutoff as it kept over $90 \%$ of the data we had available without becoming too computationally demanding, as we needed to maintain a relatively small grid spacing between voxels (0.33 Angstrom). Because the problem is 3-D, a $3 0 ^ { 3 }$ input is equivalent to a $1 6 4 \times$ 164 image, in terms of pixels.
|
| 278 |
+
|
| 279 |
+
# C COMPARISON OF 1-D, 2-D, AND 3-D REPRESENTATIONS
|
| 280 |
+
|
| 281 |
+
For small molecules, 1-D SMILES and 2-D graph based representations have been very effectively used for property prediction and for molecule generation tasks. In a SMILES representation, a specific grammar is learned but from a valid string, a specific molecule is generated based on the bond arrangement Weininger (1988); Gómez-Bombarelli et al. (2018). Similarly, a graph based representation is able to place atoms in space without specifically assigning each atom a specific coordinate Jin et al. (2018). Additionally, graph representations have been shown to be successful for property prediction of crystals Xie & Grossman (2018), but not for generating crystals. For small molecules, these representations have proved very effective, especially since both these representations effectively reduce the dimension of the problem.
|
| 282 |
+
|
| 283 |
+
Specifically, SMILES and graph representations both do not encode the specific spatial arrangement of atoms. Instead, these representations are cleverly created in such a way that the spatial arrangements can reconstructed. Unfortunately, for many larger molecules these representations are not sufficient. Therefore, we focus on developing a representation that is able to directly reconstruct both species and locations in a 3-D space.
|
| 284 |
+
|
| 285 |
+
# D SPECIES PREDICTION
|
| 286 |
+
|
| 287 |
+
Each voxel is assigned an identity based on the argmax of the U-Net. The background has label 0. First, we find all connected components of non-background voxels. For each connected component, we tabulate the species predicted at each voxel and each cluster is assigned an identity baased on the majority vote. The location is based on the centroid of the cluster. We experimented with more complicated procedures (such as weighting by the probability vector) and did not find a meaningful improvement.
|
| 288 |
+
|
| 289 |
+
# E TRAINING DETAILS
|
| 290 |
+
|
| 291 |
+
We used a Tesla V100 for training. We used a learning rate of 1e-5 and a batch size of 24.
|
| 292 |
+
|
| 293 |
+
# E.1 NETWORK DETAILS
|
| 294 |
+
|
| 295 |
+
# E.1.1 ENCODER
|
| 296 |
+
|
| 297 |
+
3D convolution, kernel size of 5 and stride of 2. 16 channels.
|
| 298 |
+
Batch Norm and LeakyReLU activation.
|
| 299 |
+
3D convolution, kernel size of 3 and stride of 1. 32 channels.
|
| 300 |
+
Batch Norm and LeakyReLU activation.
|
| 301 |
+
3D convolution, kernel size of 3 and stride of 1. 64 channels.
|
| 302 |
+
Batch Norm and LeakyReLU activation.
|
| 303 |
+
3D convolution, kernel size of 3 and stride of 2. 128 channels. Batch Norm and LeakyReLU activation.
|
| 304 |
+
Fully connected layer with a bottleneck size 300.
|
| 305 |
+
|
| 306 |
+
# E.1.2 DECODER
|
| 307 |
+
|
| 308 |
+
Fully connected layer.
|
| 309 |
+
Reshape to 128 5,5,5 Trlinear upsample by a factor of two.
|
| 310 |
+
Conv3D with 64 channels, kernel size of 5, leakyReLU.
|
| 311 |
+
Trlinear upsample by a factor of two.
|
| 312 |
+
Conv3D with 32 channels, kernel size of 5, leakyReLU.
|
| 313 |
+
Trlinear upsample by a factor of two.
|
| 314 |
+
Conv3D with 16 channels, kernel size of 4, leakyReLU.
|
| 315 |
+
Conv3D with 1 channels, kernel size of 4, ReLU.
|
| 316 |
+
|
| 317 |
+
# F RESULTS FROM THE ENCODER-DECODER
|
| 318 |
+
|
| 319 |
+
Our encoder-decoder architecture is able to accurately reconstruct the voxel-wise density (Fig. S8A and Fig. S6). We find a strong correlation between the predicted and target voxel value (Fig. S6A). This is essential for achieving an accurate segmentation of the correct atoms and their corresponding positions. Due to the strong penalty on the KL term we find that there is an increased spread in the resulting predictions when attempting to encode and decode repeating unit cells. This is less of an issue when encoding and decoding single unit cells.
|
| 320 |
+
|
| 321 |
+
# G ACCURACY OF RANDOM DRAWS IN A REPEATING LATTICE
|
| 322 |
+
|
| 323 |
+
To test whether random samples from the latent space, $\tilde { \mathbf { z } }$ , decode to physically realistic molecules, we trained a discriminator. We trained an auto-encoder that was able to very accurately reconstruct molecules by greatly reducing the penalty on $\beta$ (see Fig. S12). Then, we compute real latent space representations of our different molecules, $\mathbf { z }$ . We then draw a $\lambda \sim U ( 0 , 1 )$ and construct a new latent space vector
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\hat { \mathbf { z } } = \lambda \widetilde { \mathbf { z } } _ { \mathcal { N } ( 0 , 1 ) } + ( 1 - \lambda ) \mathbf { z } _ { \mathrm { r e a l } }
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
where $\tilde { \mathbf { z } }$ is a random sample from a unit normal and $\mathbf { z } _ { \mathrm { r e a l } }$ is a random “true” latent space. We pass this through the decoder and provide this a label $( 1 - \lambda , \lambda )$ . We then randomly draw $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ from our trained network and pass this reconstruction $\tilde { D }$ into the discriminator network, which outputs a prediction of the distance from a true crystal reconstruction versus a random draw from a latent space of a previously trained network. Applying this network to random samples from $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ we get a mean value of 0.84 with a standard deviation of 0.05. For true decoded samples, we find a mean value of 0.90 with a standard deviation of 0.01. In Fig. S13, we show results of the trained network and predictions on three different datasets. We find that the target latent space decodes to high-scoring samples (see Fig. S13B) and that out of distribution samples typically decode to much lower scores.
|
| 330 |
+
|
| 331 |
+
# G.1 CONDITIONAL VAE
|
| 332 |
+
|
| 333 |
+
Moving forward, an important step will be creating structures that have specific chemical properties. Moving towards this direction, we attempt to condition the generation of molecules on the largest species present (Sohn et al., 2015). To do this, we multiply the input and output of the bottleneck by the largest present density. By doing this, we are still able to get the network to train but find that we are able to control the magnitude of the resulting density field without perturbing the geometry (see Fig. S10B). We attempted to condition the encoder and decoder by concatenation though we found this was not sufficient to generate density fields with the desired property.
|
| 334 |
+
|
| 335 |
+
The ability to condition on specific properties has obvious applications in the targeted generation of molecules. In this case, we choose to condition on the largest present density as a way to generate molecules that do not have an atom with more than a specified maximum atomic number present. We find that by varying different parameters in the latent space, some vary the field in such a way that appears to correlate with the location of atoms (see Fig. S10C,D). However, unlike as in work on 2-D problems, the changes in the 3-D scalar field are much harder to interpret (Chen et al., 2016; Higgins et al., 2017). Future work will attempt to use improved factorizing techniques (Kim & Mnih, 2018; Chen et al.). Additionally, one could seek to condition the generation of single unit cells on quantum mechanical properties or by adding an auxiliary loss using the latent space to predict quantum mechanical properties.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure S6: Accuracy of Model. (A) For each position in 3-D space, we plot the predicted and target density for 4 different random crystals from the test set. The red dashed line is an identity line. (B) For each of the panels in (A), we show 4 different $z$ -slices through the true and predicted density fields. (C) We show the full 3-D reconstruction of the prediction and the true density field.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure S7: Random Decoded Samples. We randomly sample the latent space17 $z \sim N ( 0 , 1 )$ . We show a series of examples (from three different views) of different complexity. Note that while symmetry is not preserved, various geometric motifs are.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure S8: Repeating unit cell accuracy. (A) For each position in 3-D space, we compute the difference between the truth and the reconstruction. We show different percentile bands of the reconstruction error between the target and predicted density, plotted using the mean square error (MSE). (B) For the species matrix from U-Net we ask what the error of top-1 predictions is between our predictions and the ground truth. (C) For our segmented matrices, we ask the distance from the nearest segmented atom to the ground truth. We show the distance errors by percentile for both the nearest true atom to each predicted atom and vice-versa (orange and blue, respectively). (D) After segmenting the reconstructed density maps we show the predicted and true number of atoms. (E) We plot the predicted nearest atom species versus the true species of the closest corresponding atom, as long as the distance is less than $0 . 5 \mathring \mathrm { \mathrm { A } }$ . We find $6 5 . 4 \%$ are correctly predicted.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure S9: Interpolation between two molecules. In (A) we show the interpolation between two crystal density maps. We show three equally spaced intermediates the corresponding segmentation. In (B), we show the same interpolation but highlight different two dimensional slices (y-axis). Along the $\mathbf { X }$ -axis we label the fraction of the way between the two latent space vectors.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure S10: Conditional generation of molecules. We multiply the input and output of the bottleneck by the maximum density during training. Then, randomly decoding samples of $\alpha \mathbf { z }$ where $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ and $\alpha$ is a random target, we find we are able to generate density maps that decode appropriately. If we take a true decoded value and re-scale the output we find we are able to control scale without affecting geometry. (A) We show the target and generated max value. (B) Using an encoded $\mathbf { z }$ , we multiply it by different target values and decode them. We find that we are able to change scale without affecting the geometry. (C) We show a decoded sample. We cut away the right most corner facing the viewer. $\mathbf { \eta } ^ { ( \mathbf { D } ) }$ For the molecule shown in (C), we show the results of varying one value in the latent space from -3 to 3. We plot the difference in the slice when compared the unaltered, decoded, $\mathbf { z }$ for a slice that is in-plane with many atoms.
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure S11: Interpolation between two molecules. From $i - v$ we show two views of the output from the segmentation routine decoding the latent space between two different molecules. In the primed corresponding figures we show the density fields that are output by the decoder. We show the output of each grid normalized between 0-1 in blue-green and on a fixed color map in magma. We also vary the opacity to show the locations of predicted atoms.
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure S12: Results with smaller $\beta$ . We decrease $\beta$ by a factor of 10. By reducing the penalty on the KullbackLeibler (KL) term we are able to generate more accurate reconstructions. However, sampling $\mathbf { z } \sim \mathcal { N } ( 0 , 1 )$ does not fully sample the encoded space of molecules.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure S13: $\lambda$ prediction for different samples. Using the network in Fig. S12 we train a discriminator network to predict the “distance” from a real crystal. We apply this discriminator to real decoded samples, random latent space draws, and out of distribution draws (right).
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure S14: Decoded samples of repeating unit cells. Results from the encoder-decoder.
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
Figure S15: Segmented Output from the decoded samples. The segmented output from Fig. S14.
|
md/train/SJCPLLpaW/SJCPLLpaW.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EXPLORING THE HIDDEN DIMENSION IN ACCELERATING CONVOLUTIONAL NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
DeePa is a deep learning framework that explores parallelism in all parallelizable dimensions to accelerate the training process of convolutional neural networks. DeePa optimizes parallelism at the granularity of each individual layer in the network. We present an elimination-based algorithm that finds an optimal parallelism configuration for every layer. Our evaluation shows that DeePa achieves up to $6 . 5 \times$ speedup compared to state-of-the-art deep learning frameworks and reduces data transfers by up to $2 3 \times$ .
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Training convolutional neural networks (CNNs) is increasingly compute-intensive and timeconsuming. It takes days or even weeks to train deep CNNs from scratch (Szegedy et al., 2014; Zeiler & Fergus, 2014; Simonyan & Zisserman, 2014; Szegedy et al., 2016). Existing deep learning frameworks such as TensorFlow, PyTorch, and Caffe2 parallelize the training process onto multiple processors (usually GPUs) using image parallelism1 dividing the entire image dataset into batches with the same number of images and assigning each batch to a dedicated processor.
|
| 12 |
+
|
| 13 |
+
The standard parallelization of CNN training only exploits image parallelism. However, other dimensions can also parallelize the training process. For example, in CNNs for 2D images, data is commonly organized as 4-dimensional tensors (i.e., image, height, width, channel). The image dimension includes an index for each image in the input dataset. The height and width dimensions specify a position in an image. For a particular position, the channel dimension2 indexes different neurons for that position. Exploring these other parallelizable dimensions can potentially reduce the compute time and data transfer cost when training CNNs (see Section 2). Moreover, different layers in a CNN may prefer different parallelism configurations for achieving optimal performance.
|
| 14 |
+
|
| 15 |
+
We propose DeePa, a deep learning framework that explores parallelism in all parallelizable dimensions to accelerate the training of CNNs. To the best of our knowledge, DeePa is the first system that models and exploits the parallelism of neural networks at the granularity of each individual layer. To generate a parallelism configuration for each layer, DeePa uses an elimination-based algorithm that automatically finds the configuration with the best estimated performance.
|
| 16 |
+
|
| 17 |
+
The main contributions of this paper are:
|
| 18 |
+
|
| 19 |
+
• We present DeePa, a deep learning framework that explores parallelism in all parallelizable dimensions to accelerate the training of CNNs.
|
| 20 |
+
• The parallelization strategy is selected at the granularity of each individual layer.
|
| 21 |
+
• We present an elimination-based algorithm for finding the parallelism configuration with optimal estimated performance for each layer.
|
| 22 |
+
• Our evaluation shows that, compared to state-of-the-art deep learning frameworks (e.g., TensorFlow and PyTorch), DeePa achieves $6 . 5 \times$ , $1 . 9 \times$ , and $1 . 5 \times$ speedup for AlexNet,
|
| 23 |
+
|
| 24 |
+
Table 1: Detailed information for the example convolutional layers used in Figure 1 and 2.
|
| 25 |
+
|
| 26 |
+
<table><tr><td>Name</td><td>Input Channels</td><td>Output Channels</td><td>Height</td><td>Width</td><td>Kernel</td><td>Stride</td><td>Description</td></tr><tr><td>C1</td><td>128</td><td>128</td><td>112</td><td>112</td><td>3x3</td><td>1x1</td><td>Conv4 in VGG-16</td></tr><tr><td>C2</td><td>512</td><td>512</td><td>28</td><td>28</td><td>3x3</td><td>1x1</td><td>Conv8,Conv9,and Conv10 in VGG-16</td></tr><tr><td>C3</td><td>192</td><td>64</td><td>35</td><td>35</td><td>1x1</td><td>1x1</td><td>Conv1x1 in an Inception-v3 module</td></tr><tr><td>C4</td><td>48</td><td>64</td><td>35</td><td>35</td><td>5x5</td><td>1x1</td><td>Conv5x5 in an Inception-v3 module</td></tr><tr><td>C5</td><td>64</td><td>192</td><td>27</td><td>27</td><td>5x5</td><td>1x1</td><td>Conv2 in AlexNet</td></tr><tr><td>C6</td><td>256</td><td>256</td><td>13</td><td>13</td><td>3x3</td><td>1x1</td><td>Conv5 in AlexNet</td></tr><tr><td>C7</td><td>32</td><td>64</td><td>147</td><td>147</td><td>3x3</td><td>1x1</td><td>Conv3 in Inception-v3</td></tr><tr><td>C8</td><td>448</td><td>384</td><td>8</td><td>8</td><td>3x3</td><td>1x1</td><td>Conv3x3 in an Inception-v3 module</td></tr></table>
|
| 27 |
+
|
| 28 |
+
VGG-16, and Inception-v3, respectively. The performance improvement comes from reducing overall data transfers, automatically overlapping computation with data movement, and accelerating computation throughput.
|
| 29 |
+
|
| 30 |
+
# 2 MOTIVATION
|
| 31 |
+
|
| 32 |
+
This work is motivated by the following observations.
|
| 33 |
+
|
| 34 |
+
# 2.1 ACCELERATING COMPUTATION THROUGHPUT
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: Relative performance for training different convolutional layers. Computation throughput is calculated by dividing the batch size with computation time (both forward processing and back propagation) and is normalized by the worst case.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 2: Computation and data transfer time to process a batch of 512 images using image parallelism for the third layer, an intermediate layer, and the last layer of Inception-v3.
|
| 41 |
+
|
| 42 |
+
Convolutional layers generally consume the bulk of the training time in CNNs, and parallelizing training in different data dimensions results in significantly different performance. Figure 1 shows the relative speed of training six different convolutional layers from AlexNet, VGG-16, and Inception-v3. The properties of the convolutional layers are shown in Table 1. For each convolutional layer, we tried parallelizing the computation in each individual parallelizable dimension as well as combinations of different parallelizable dimensions, and we report the performance of the standard parallelization over images along with the worst and best parallelization strategies we discovered. Figure 1 shows that different parallelism configurations result in very different performance, and image parallelism generally achieves suboptimal performance. Therefore, exploring parallelism in other dimensions can potentially accelerate the training of convolutional layers.
|
| 43 |
+
|
| 44 |
+
# 2.2 REDUCING DATA TRANSFER COST
|
| 45 |
+
|
| 46 |
+
Different parallelization strategies can also result in significantly different amounts of data movement. Figure 3 shows an example of parallelizing the first fully-connected layer of VGG-16 on two GPUs in different dimensions. In image parallelism (Figure 3a), each GPU processes a batch of images and computes the gradient for the entire fully-connected layer. This requires each GPU to synchronize the gradients for the entire fully-connected layer (shown as the shadow rectangles) after each step. An alternative approach (Figure 3b) parallelizes in the channel dimension by assigning a subset of the output channels to each GPU. As a result, different GPUs compute the gradients for disjoint subsets of the fully-connected layer, which eliminates transferring the fully-connected layer but introduces additional data transfers for input tensors (shown as the shadow rectangles). For this particular case, using parallelism in the channel dimension reduces data transfer costs by $1 2 \times$ .
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
(a) Parallelism in the image dimension. (b) Parallelism in the channel dimension.
|
| 50 |
+
Figure 3: Different configurations for parallelizing the first fully-connected layer of VGG-16. Rectangles with solid lines indicate tensors managed by the local GPU, while rectangles with dot lines are tensors managed by a remote GPU. The shadow rectangles indicate data transfers for each step.
|
| 51 |
+
|
| 52 |
+
# 2.3 OPTIMIZING PER-LAYER PERFORMANCE
|
| 53 |
+
|
| 54 |
+
When processing a batch of images, increasing the number of workers does not always improve overall execution time, due to the data transfer overhead to synchronize gradients across different workers. Figure 2 shows the per-step training time for three different layers in Inception-v3 for a batch size of 512 images on up to 16 GPUs. The training time includes forward processing, backward propagation, and gradient aggregation. The figure shows that different layers in a neural network may prefer different hardware configurations, and there is no single configuration that is optimal for all layers. For example, the third layer performs best on 16 GPUs while the last layer performs best on 4 GPUs. Thus, a parallelism configuration includes both selecting the data dimensions to be parallelized and the number of parallel workers (or, equivalently, the number of subsets into which the data is partitioned).
|
| 55 |
+
|
| 56 |
+
# 3 DEEPA
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 4: Example configurations that parallelize an operation in a single dimension or combinations of multiple dimensions. The figure shows how each image is partitioned in different configurations. Each configuration needs a total of 4 workers.
|
| 60 |
+
|
| 61 |
+
Similar to TensorFlow and PyTorch, DeePa uses computation graphs to describe dependencies between operations. In a computation graph $G = ( V , E )$ , each node $n \in V$ is an operation (e.g., a convolution or matrix-multiply), and each directed edge $( u , v ) \in E$ is a tensor that is an output of $u$ and an input of $v$ .
|
| 62 |
+
|
| 63 |
+
One key difference between DeePa and TensorFlow or PyTorch is that each node in the DeePa computation graph also includes a configuration that describes how the corresponding operation is parallelized across different workers. For each parallelizable dimension (i.e., image, height, width, and channel), the configuration includes an integer that describes the degree of parallelism in that dimension. For a configuration, the product of the integers over all dimensions is the number of workers needed to process the operation in that configuration. Figure 4 demonstrates some example configurations that explore parallelism in a single dimension as well as combinations of different dimensions. DeePa assumes equal partitioning in each dimension. As a result, each worker receives the same size input, which provides well-balanced workload distribution in our experiments.
|
| 64 |
+
|
| 65 |
+
For each node in the computation graph, its configuration describes how the output tensor is divided onto multiple workers. Each worker computes a disjoint subset of the output tensor, and thus each worker can process the operation in parallel without data dependencies. Given a node’s configuration, DeePa calculates the input sets for each worker and automatically schedules proper data transfers between operations.
|
| 66 |
+
|
| 67 |
+
DeePa also provides three additional functions:
|
| 68 |
+
|
| 69 |
+
• For each node $v$ and configuration $c$ , v.compute $( c )$ estimates the time to process the corresponding operation under the parallelism configuration $c$ . This includes both the forward processing and back propagation time and is estimated by running the operation in that configuration multiple times on the device and measuring the average execution time.
|
| 70 |
+
• For each edge $\boldsymbol { e } ~ = ~ ( u , v )$ , $e . x f e r ( c _ { u } , c _ { v } )$ estimates the time to transfer the input tensor $e$ to each worker, using the size of the data to be moved and the known communication bandwidth. Note that $e . x f e r ( c _ { u } , c _ { v } )$ is zero if $u$ and $v$ have the same configuration (i.e., $c _ { u } = c _ { v } ,$ , in which case no data is transferred. As with compute(), we precompute the $x f e r ( )$ function for each edge in the graph by calculating the overall data transfer size for all possible source and destination configurations.
|
| 71 |
+
• For each node $v$ and configuration $c$ , v.update $( c )$ estimates the time to update parameters for the corresponding operation. We use the data transfer time to approximate the update time, since the data transfer time is much longer than the compute time for updating parameters. Note that different configurations can have significantly different update time, as described in Section 2.2.
|
| 72 |
+
|
| 73 |
+
A global configuration $g$ includes a parallelism configuration for each node in a computation graph: $g ( v )$ describes the parallelism configuration for node $v$ . Using the functions defined above, we can model the per-step execution time for a computation graph:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
C o s t ( g , ( V , E ) ) = \sum _ { v \in V } \{ v . c o m p u t e ( g ( v ) ) + v . u p d a t e ( g ( v ) ) \} + \sum _ { e = ( u , v ) \in E } e . x f e r ( g ( u ) , g ( v ) )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
$C o s t ( g , ( V , E ) )$ estimates the per-step execution time if the computation graph $( V , E )$ is parallelized using global configuration $g$ . This execution time includes forwarding processing, backward propagation, and gradient aggregation. Equation 1 expresses the problem of finding the configuration for each individual node as a global optimization problem.
|
| 80 |
+
|
| 81 |
+
# 4 FINDING OPTIMAL GLOBAL CONFIGURATIONS
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 5: Performing a node/edge elimination on a computation graph.
|
| 85 |
+
|
| 86 |
+
We now describe our algorithm for finding a global configuration that minimizes Equation 1. In DeePa, each node can select any of a fixed (but large) set of parallelism configurations. Therefore the number of potential global configurations is exponential in the number of nodes in a computation graph, which makes it impractical to enumerate all global configurations for deep CNNs such as VGG-16 and Inception-v3.
|
| 87 |
+
|
| 88 |
+
However, the CNNs we have seen in practice exhibit strong locality: each node is only connected to a few nodes with similar depth in a computation graph. Based on this observation, we use the following two elimination strategies to iteratively simplify the computation graph while preserving the globally optimal configuration.
|
| 89 |
+
|
| 90 |
+
Node elimination. For each node $w$ with a single in-edge $\boldsymbol { e } _ { 1 } ~ = ~ ( u , w )$ and a single out-edge $e _ { 2 } = \left( w , v \right)$ , we remove node $w$ and the two edges $e _ { 1 }$ and $e _ { 2 }$ from the graph and insert a new edge $\boldsymbol { e } ^ { \prime } = \left( \boldsymbol { u } , \boldsymbol { v } \right)$ (shown in Figure 5a). The xfer() function for node $e ^ { \prime }$ is
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
e ^ { \prime } . x f e r ( c _ { u } , c _ { v } ) = \operatorname* { m i n } _ { c _ { w } } \{ e _ { 1 } . x f e r ( c _ { u } , c _ { w } ) + w . c o m p u t e ( c _ { w } ) + w . u p d a t e ( c _ { w } ) + e _ { 2 } . x f e r ( c _ { w } , c _ { v } ) \}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Note that because we have precomputed the $x f e r ( )$ function for edges in the original graph, we can similarly compute the $x f e r ( )$ function for the transitive edge added by a node elimination; i.e., we use dynamic programming to compute the optimal configuration for node $w$ for every possible choice of configurations for nodes $u$ and $v$ . For CNNs with a linear computation graph (e.g., AlexNet and VGG-16), node elimination is sufficient to reduce the original graph to a graph with only 2 nodes.
|
| 97 |
+
|
| 98 |
+
Edge elimination. For two edges with the same source and destination node (i.e., $\boldsymbol { e } _ { 1 } = ( u , v )$ and $e _ { 2 } = ( u , v ) )$ , we can remove $e _ { 1 }$ and $e _ { 2 }$ from the graph and insert a new edge $\boldsymbol { e } ^ { \prime } = \left( u , v \right)$ (shown in Figure 5b). The $x f e r ( )$ function for node $e ^ { \prime }$ is
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
e ^ { \prime } . x f e r ( c _ { u } , c _ { v } ) = e _ { 1 } . x f e r ( c _ { u } , c _ { v } ) + e _ { 2 } . x f e r ( c _ { u } , c _ { v } )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 6: Iteratively performing node/edge eliminations on an Inception module.
|
| 106 |
+
|
| 107 |
+
As with node elimination, we compute the $x f e r ( )$ function for $e ^ { \prime }$ using the already computed xfer() functions for $e _ { 1 }$ and $e _ { 2 }$ . Figure 6 shows how DeePa iteratively eliminates nodes and edges for an
|
| 108 |
+
|
| 109 |
+
Inception-v3 module. The full Inception-v3 computation graph has 120 nodes, which DeePa reduces to a 2-node graph.
|
| 110 |
+
|
| 111 |
+
DeePa iteratively uses node and edge eliminations to simplify a computation graph until neither elimination can be applied. DeePa then enumerates all global configurations for the final graph and chooses the one that minimizes the Cost function in Equation 1.
|
| 112 |
+
|
| 113 |
+
After deciding the configuration for each node in the final graph, DeePa then decides the configuration for the eliminated nodes by undoing the node and edge eliminations in reverse order. When undoing a node elimination for node $w$ , DeePa selects the configuration that minimizes Equation 2 for node $w$ . After undoing all eliminations, DeePa has a configuration for every node in the original graph. In Appendix A.1, we prove that our algorithm finds an optimal global configuration. In our experiments, DeePa finds an optimal configuration for parallelizing the largest CNN we have worked with, Inception-v3, on 16 GPUs in about $1 0 0 \mathrm { m s }$ .
|
| 114 |
+
|
| 115 |
+
# 5 IMPLEMENTATION
|
| 116 |
+
|
| 117 |
+
We found that it is non-trivial to parallelize the training of CNNs in the height, width, and channel dimensions in existing frameworks (e.g., TensorFlow, PyTorch, and Caffe2), and none provides an interface for controlling per-operation parallelism. We implemented DeePa in Legion (Bauer et al., 2012), a high-performance parallel runtime for distributed heterogeneous architectures, and use cuDNN (Chetlur et al., 2014) and cuBLAS (cub, 2016) as the underlying libraries for processing neural network operations. The following Legion features significantly simplify our implementation for DeePa. First, Legion supports high-dimensional partitioning that allows us to parallelize any operation in any combination of the dimensions. Second, Legion allows DeePa to control parallelism at the granularity of each operation. Third, Legion allows fine-grain control over the placement of data in memory. Fourth, Legion’s asynchronous tasking model makes it easy to exploit task as well as image parallelism. We also include two critical optimizations that help achieve good performance.
|
| 118 |
+
|
| 119 |
+
Overlapping computation with data transfers. DeePa manages the gradients of each operation separately and transfers an operation’s gradients as long as its back propagation is completed. We have found that this can effectively hide the data transfer overhead for gradient synchronization. As a result, the synchronous training performance matches asynchronous training in DeePa, which allows users to use synchronous training with its better algorithmic efficiency.
|
| 120 |
+
|
| 121 |
+
Distributing parameter servers. Existing frameworks use parameter servers to store and update variables for a CNN model. Parameter servers are located in CPU memory in TensorFlow and PyTorch. Because DeePa manages the parameters for each operation separately, DeePa can opportunistically distribute the parameter server onto the GPU memories whenever possible. This eliminates data transfers for operations whose gradients and parameter server are located on the same GPU and transforms all GPU to CPU copies into faster GPU to GPU copies.
|
| 122 |
+
|
| 123 |
+
# 6 RELATED WORK
|
| 124 |
+
|
| 125 |
+
To the best of our knowledge, DeePa is the first deep learning framework that controls and optimizes the parallelism of neural networks in all dimensions at the granularity of each operation.
|
| 126 |
+
|
| 127 |
+
Existing frameworks such as TensorFlow (Abadi et al., 2016), Caffe2 (Caf, 2016), and PyTorch (Pyt, 2017) use image parallelism to distribute the training of CNNs and only explore parallelism in the image dimension. The standard image parallelism configuration keeps a replica of the entire network on each worker, which results in large data transfers for synchronizing the gradients in each step.
|
| 128 |
+
|
| 129 |
+
Mirhoseini et al. (2017) uses model parallelism that assigns each operation to a dedicated processor for training Inception-v3. It uses a reinforcement learning algorithm to optimize the placement of each operation on a GPU device. The learned device placement on 4 GPUs achieves $19 \%$ speedup compared to single GPU performance. However, parallelism in each operation is not explored.
|
| 130 |
+
|
| 131 |
+
Krizhevsky (2014) introduces “one weird trick” (OWT) that combines image parallelism with model parallelism to accelerate the distributed training of AlexNet, which efficiently reduces the data transfer cost compared to the standard image parallelism configuration. In Section 7.1.2, we show that
|
| 132 |
+
|
| 133 |
+
DeePa further reduces the overall data transfers for AlexNet by $3 \times$ and the per-step training time by $2 . 3 \times$ compared to OWT.
|
| 134 |
+
|
| 135 |
+
Goyal et al. (2017) empirically shows no loss of accuracy for training ResNet-50 on the ImageNet dataset with a large minibatch size of 8192 images3. It uses the standard image parallelism configuration to distribute the training onto 256 GPUs and includes a number of optimizations for reducing communication overhead. As communication is a bottleneck in distributed deep learning, we believe our techniques for reducing data transfers can substantially benefit training on large numbers of GPUs.
|
| 136 |
+
|
| 137 |
+
# 7 EVALUATION
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 7: Training throughput (images/second) for AlexNet, VGG-16, and Inception-v3 on 16 GPUs. The purple and green bar shows the DeePa performance by restricting DeePa to use image and OWT parallelism, respectively.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 8: Total amount of data transferred in each step for training AlexNet, VGG-16, and Inception-v3 on 16 GPUs with a minibatch size of 512.
|
| 144 |
+
|
| 145 |
+
We use AlexNet (Krizhevsky, 2014), VGG-16 (Simonyan & Zisserman, 2014), and Inceptionv3 (Szegedy et al., 2016) as benchmark CNNs and use the ImageNet dataset (Russakovsky et al., 2015) as the input. For each CNN, we compare the performance of DeePa against TensorFlow, PyTorch, and OWT. We implement OWT in DeePa by restricting all convolutional and pooling layers to use image parallelism and all fully-connected layers to use model parallelism.
|
| 146 |
+
|
| 147 |
+
# 7.1 CASE STUDY ON A 16-GPU MACHINE
|
| 148 |
+
|
| 149 |
+
We conduct a detailed case study for training the three CNNs on a 16-GPU machine, with two Intel 10-core E5-2680 Xeon processors, 256 GB main memory, and 16 NVIDIA Tesla K80 GPUs4. We use all 16 GPUs for training each CNN model with a minibatch size of 512 images. As a result, each GPU processes a batch of 32 images in the image parallelism configuration. DeePa uses the search algorithm in Section 4 to find the optimal parallelism configurations, which requires 0.7, 1.1, and 4.8 seconds for AlexNet, VGG-16, and Inception-v3, respectively.
|
| 150 |
+
|
| 151 |
+
Figure 7 shows the synchronous training throughput for a minibatch size of 512 images on 16 GPUs. When DeePa uses image parallelism for all operations, DeePa achieves competitive performance compared to the best of TensorFlow and PyTorch. The OWT approach that uses model parallelism for fully-connected layers speeds up the training throughput by $1 . 4 \times , 1 . 2 \times$ , and $1 . 0 7 \times$ compared to image parallelism using DeePa. The best configurations found by DeePa achieve $6 . 5 \times$ , $1 . 9 \times$ , and $1 . 5 \times$ speedup compared to TensorFlow and PyTorch.
|
| 152 |
+
|
| 153 |
+
Three main optimizations in DeePa achieve most of the performance benefit over the other frameworks. First, DeePa significantly reduces data transfers in each step, as shown in Figure 8. Compared to image parallelism, the OWT approach reduces data transfers by $1 . 0 5 { - } 8 . 4 \times$ . However, the best configuration used by DeePa further reduces data transfers by $1 . 2 \mathrm { - } 2 . 7 \mathrm { \times }$ compared to OWT. Second, the optimization for overlapping computation with data transfers (described in Section 5) effectively hides data transfer latency and achieves better GPU utilization. The grey bars in Figure 7 illustrate DeePa’s performance when the overlap optimization is disabled, which shows that overlapping computation with data transfers can improve the training throughput by $10 \% { - } 3 0 \%$ . Third, DeePa also improves performance by exploring parallelism in the height and width dimensions (see Section 7.1.3).
|
| 154 |
+
|
| 155 |
+
Table 2: The cost for different configurations for the first fully-connected of AlexNet.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Configuration</td><td>#GPU Workers</td><td>Transfer Cost</td><td>Compute Cost</td><td>Update Cost</td><td>Total Cost</td><td>Parallelism Configurations</td></tr><tr><td>{n=16,c=1}</td><td>16</td><td>0</td><td>+1.28</td><td>+1075</td><td>= 1076</td><td>ImageParallelism</td></tr><tr><td>{n=1,c=16}</td><td>16</td><td>134.4</td><td>+1.28</td><td>+0</td><td>= 135.7</td><td>OWT</td></tr><tr><td>{n=1,c=4}</td><td>4</td><td>33.6</td><td>+5.1</td><td>+0</td><td>=38.7</td><td></td></tr><tr><td>{n=1,c=2}</td><td>2</td><td>16.8</td><td>+10.2</td><td>+0</td><td>= 27.0</td><td>DeePa</td></tr><tr><td>{n=1,c=1}</td><td>1</td><td>8.4</td><td>+20.4</td><td>+0</td><td>=28.8</td><td></td></tr></table>
|
| 158 |
+
|
| 159 |
+
# 7.1.1 THE BEST CONFIGURATIONS
|
| 160 |
+
|
| 161 |
+
We describe the best configurations discovered for AlexNet, VGG-16, and Inception-v3 in Sections 7.1.2 to 7.1.4. The best configurations have several similarities.
|
| 162 |
+
|
| 163 |
+
First, for the beginning layers with large height/width dimensions and small channel dimensions, DeePa uses image parallelism on all available GPUs, since the data transfers for synchronizing gradients are much smaller than the data transfers for moving tensors between operations.
|
| 164 |
+
|
| 165 |
+
Second, deeper layers in CNNs tend to have smaller height/width dimensions and larger channel dimensions. As a result, the cost for moving tensors between different operations decreases, while the cost for synchronizing gradients increases. DeePa adaptively reduces the number of GPU workers for these layers to reduce the expensive data transfers for synchronizing gradients at the cost of introducing cheaper data transfers for moving tensors.
|
| 166 |
+
|
| 167 |
+
Third, DeePa uses model parallelism on a small number of GPU workers for fully-connected layers, because synchronizing gradients and moving tensors are both much more expensive than the compute time for fully-connected layers. DeePa reduces the data transfers for synchronizing gradients and moving tensors at the cost of using fewer GPUs.
|
| 168 |
+
|
| 169 |
+
# 7.1.2 ALEXNET
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 9: The global configuration for parallelizing AlexNet on 16 GPU workers.
|
| 173 |
+
|
| 174 |
+
Figure 9 shows the global configuration for AlexNet on 16 GPU workers. Note that DeePa selects the parallelism configuration that optimizes the performance for each layer. Table 2 lists the cost for different configurations of the first fully-connected layer. The standard image parallelism configuration eliminates the cost for transferring the input tensors but introduces additional data transfers for synchronizing gradients. The OWT approach completely eliminates gradient synchronization at the cost of replicating the input tensors on every GPU worker. The configuration chosen by DeePa only uses 2 GPU workers for training the first fully-connected layer, which prolongs the compute time but significantly reduces the cost for both transferring input tensors and synchronizing gradients. As a result, DeePa reduces the total cost by $5 \times$ compared to other approaches.
|
| 175 |
+
|
| 176 |
+
DeePa uses image parallelism for all convolutional and pooling layers, because the additional data transfer cost introduced by transforming configurations outweighs any performance benefits.
|
| 177 |
+
|
| 178 |
+
# 7.1.3 VGG-16
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 10: The global configuration for parallelizing VGG-16 on 16 GPU workers.
|
| 182 |
+
|
| 183 |
+
Table 3: The cost for different configurations for the last three convolutional layers of VGG-16.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Configuration</td><td># GPU Workers</td><td>Transfer Cost</td><td>Compute Cost</td><td>Update Cost</td><td>Total Cost</td><td>Parallelism Configurations</td></tr><tr><td>{n=16,c=1,h=1,w=1}</td><td>16</td><td>0</td><td>+15.9</td><td>+134.4</td><td>=150.3</td><td>ImageParallelism&OWT</td></tr><tr><td>{n=8,c=1,h=1,w=1}</td><td>8</td><td>39.2</td><td>+31.8</td><td>+67.2</td><td>=138.2</td><td></td></tr><tr><td>{n=4,c=1,h=1,w=1}</td><td>4</td><td>39.2</td><td>+63.7</td><td>+33.6</td><td>=136.5</td><td></td></tr><tr><td>n=1,c=1,h=2,w=2}</td><td>4</td><td>39.2</td><td>+54.7</td><td>+33.6</td><td>= 127.5</td><td>DeePa</td></tr><tr><td>{n=2,c=1,h=1,w=1}</td><td>2</td><td>39.2</td><td>+127.4</td><td>+16.8</td><td>= 183.4</td><td></td></tr></table>
|
| 186 |
+
|
| 187 |
+
DeePa uses similar configurations for parallelizing the fully-connected layers in VGG-16 (Figure 10). In addition, DeePa also uses a different configuration to cooperatively accelerate the last three convolutional layers (the yellow node in Figure 10). Table 3 lists the cost for different parallelism configurations for the last three convolutional layers. The configuration with optimal total cost uses only four GPU workers for the last three convolutional layers to reduce data transfers for synchronizing gradients. DeePa also exploits parallelism in the height and width dimensions to further reduce the compute time.
|
| 188 |
+
|
| 189 |
+
# 7.1.4 INCEPTION-V3
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 11: The global configuration for parallelizing Inception-v3 on 16 GPU workers. Each module is shown as a single node for simplicity.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 12: The configurations for parallelizing the InceptionE1 module.
|
| 196 |
+
|
| 197 |
+
The Inception-v3 model has multiple Inception modules (Szegedy et al., 2016). Each module has several branches of convolutional and pooling layers, which are then concatenated as the output tensor of the module. Figure 11 shows the global configuration for Inception-v3. DeePa uses different configurations to parallelize different branches for the InceptionE1 module, as shown in Figure 12. We found that this configuration reduces data transfers by $30 \%$ in InceptionE1 and InceptionE2 and reduces overall data transfers by $20 \%$ .
|
| 198 |
+
|
| 199 |
+
# 7.2 MINIBATCH SIZE
|
| 200 |
+
|
| 201 |
+
The minibatch size plays an important rule on the performance of CNNs. Figure 13 compares DeePa, PyTorch, and TensorFlow with different minibatch sizes. All three networks were trained on 16 Tesla K80 GPUs on a single node, as described in Section 7.1. We were not able to train VGG-16 and Inception-v3 with a minibatch size of 2048 images, because the required metadata size exceeds the aggregate memory capacity of the 16 GPUs.
|
| 202 |
+
|
| 203 |
+
Figure 13 shows that, DeePa achieves constant speedups compared to PyTorch and TensorFlow for various minibatch sizes. In particular, DeePa achieves $4 . 6 { - } 6 . 5 \times$ , $1 . 6 \mathrm { - } 1 . 9 \times$ , and $1 . 2 \mathrm { - } 1 . 5 \times$ speedup for AlexNet, VGG-16, and Inception-v3, respectively.
|
| 204 |
+
|
| 205 |
+
# 7.3 MULTI-NODE RESULTS
|
| 206 |
+
|
| 207 |
+
We evaluate the scalability of different frameworks by comparing their training throughput with different number of GPUs and compute nodes. The experiments were performed on a GPU cluster with 4 nodes, each of which is equipped with two Intel 10-core E5-2600 Xeon processors, 256G main memory, and four NVIDIA Tesla P100 GPUs. GPUs on the same node are connected by NVLink, and nodes are connected over 100Gb/s EDR Infiniband.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 13: Performance comparisons among DeePa, PyTorch, and TensorFlow with different minibatch sizes.
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 14: Performance results for DeePa, PyTorch, and TensorFlow on up to 4 nodes. We perform weak-scaling, where each GPU worker processes a batch of 32 images in every iteration. We use all 4 GPUs on each node in the last two subfigures.
|
| 214 |
+
|
| 215 |
+
Figure 14 shows the performance comparison among DeePa, PyTorch, and TensorFlow for weakscaling. DeePa achieves competitive performance compared to PyTorch and TensorFlow for training on a single GPU, in which all three frameworks place all operations on a single GPU. For training on 4 GPUs on a single node, DeePa achieves $3 . 1 \times$ , $1 . 6 \times$ , and $1 . 3 \times$ speedup for AlexNet, VGG-16, and Inception-v3, respectively. DeePa achieves even better performance speedups for trainings on multiple nodes, where the data transfer time becomes a larger component of the per-iteration training time. For training on 4 nodes, DeePa achieves $8 . 1 \times$ , $3 . 2 \times$ , and $1 . 8 \times$ speedup for AlexNet, VGG-16, and Inception-v3, respectively.
|
| 216 |
+
|
| 217 |
+
# 8 CONCLUSION
|
| 218 |
+
|
| 219 |
+
We have presented DeePa, a deep learning framework that explores parallelism in all parallelizable dimensions to accelerate the training of CNNs. DeePa optimizes the parallelism configuration chosen at the granularity of individual layers. DeePa achieves up to $6 . 5 \times$ for training CNNs and reduces overall data transfers by up to $2 3 \times$ compared to state-of-the-art deep learning frameworks.
|
| 220 |
+
|
| 221 |
+
# REFERENCES
|
| 222 |
+
|
| 223 |
+
A New Lightweight, Modular, and Scalable Deep Learning Framework. https://caffe2.ai, 2016.
|
| 224 |
+
|
| 225 |
+
Dense Linear Algebra on GPUs. https://developer.nvidia.com/cublas, 2016.
|
| 226 |
+
|
| 227 |
+
Tensors and Dynamic neural networks in Python with strong GPU acceleration. https:// pytorch.org, 2017.
|
| 228 |
+
|
| 229 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for largescale machine learning. In OSDI, volume 16, pp. 265–283, 2016.
|
| 230 |
+
|
| 231 |
+
Michael Bauer, Sean Treichler, Elliott Slaughter, and Alex Aiken. Legion: Expressing locality and independence with logical regions. In Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, 2012.
|
| 232 |
+
|
| 233 |
+
Sharan Chetlur, Cliff Woolley, Philippe Vandermersch, Jonathan Cohen, John Tran, Bryan Catanzaro, and Evan Shelhamer. cudnn: Efficient primitives for deep learning. CoRR, abs/1410.0759, 2014. URL http://arxiv.org/abs/1410.0759.
|
| 234 |
+
|
| 235 |
+
Priya Goyal, Piotr Dollar, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, ´ Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: training imagenet in 1 hour. CoRR, abs/1706.02677, 2017. URL http://arxiv.org/abs/1706. 02677.
|
| 236 |
+
|
| 237 |
+
Alex Krizhevsky. One weird trick for parallelizing convolutional neural networks. CoRR, abs/1404.5997, 2014. URL http://arxiv.org/abs/1404.5997.
|
| 238 |
+
|
| 239 |
+
Azalia Mirhoseini, Hieu Pham, Quoc V Le, Benoit Steiner, Rasmus Larsen, Yuefeng Zhou, Naveen Kumar, Mohammad Norouzi, Samy Bengio, and Jeff Dean. Device placement optimization with reinforcement learning. CoRR, abs/1706.04972, 2017. URL http://arxiv.org/abs/ 1706.04972.
|
| 240 |
+
|
| 241 |
+
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, 2015.
|
| 242 |
+
|
| 243 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. URL http://arxiv.org/abs/1409.1556.
|
| 244 |
+
|
| 245 |
+
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.
|
| 246 |
+
|
| 247 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 248 |
+
|
| 249 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, 2014.
|
| 250 |
+
|
| 251 |
+
# A APPENDIX
|
| 252 |
+
|
| 253 |
+
# A.1 NODE AND EDGE ELIMINATION
|
| 254 |
+
|
| 255 |
+
We prove the correctness of the node and edge eliminations in Section 4. In particular, we prove that after applying node and edge eliminations, the modified graph has the same optimal configuration as the original graph.
|
| 256 |
+
|
| 257 |
+
# A.1.1 NODE ELIMINATION
|
| 258 |
+
|
| 259 |
+
For a given computation graph $G = ( V , E )$ , applying a node elimination on $w$ requires $w$ having a single in-edge $\boldsymbol { e } _ { 1 } = ( u , w )$ and a single out-edge $e _ { 2 } = ( w , v )$ . The node elimination results in a modified graph $G ^ { \prime } = ( V ^ { \prime } , E ^ { \prime } )$ , where $V ^ { \prime } = V - \{ w \}$ , $E ^ { \prime } = E - e _ { 1 } - e _ { 2 } + e ^ { \prime }$ , and $\boldsymbol { e } ^ { \prime } = \left( \boldsymbol { u } , \boldsymbol { v } \right)$ .
|
| 260 |
+
|
| 261 |
+
Theorem 1. Consider graphs $( V , E )$ and the result of a single node elimination $( V ^ { \prime } , E ^ { \prime } )$ . Then an optimal configuration of $V , E )$ ) is also an optimal configuration of $( V ^ { \prime } , E ^ { \prime } )$ , and an optimal configuration of $( V ^ { \prime } , E ^ { \prime } )$ is extensible to a an optimal configuration of $( V , E )$ .
|
| 262 |
+
|
| 263 |
+
Proof. The Cost function is defined in Equation 1. Let $g$ be any configuration. We first compute the difference between $C o s t ( g , ( V , E ) )$ and $C o s t ( g , ( V ^ { \prime } , E ^ { \prime } ) )$ .
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\begin{array} { l } { { \displaystyle C o s t ( g , ( V , E ) ) - C o s t ( g , ( V ^ { \prime } , E ^ { \prime } ) ) } } \\ { { \displaystyle = \sum _ { v \in V } \{ v . c o m p u t e ( g ( v ) ) + v . u p d a t e ( g ( v ) ) \} + \sum _ { e = ( u , v ) \in E } e . x f e r ( g ( u ) , g ( v ) ) } } \\ { { \displaystyle ~ - \sum _ { v \in V ^ { \prime } } \{ v . c o m p u t e ( g ( v ) ) + v . u p d a t e ( g ( v ) ) \} + \sum _ { e = ( u , v ) \in E ^ { \prime } } e . x f e r ( g ( u ) , g ( v ) ) } } \\ { { \displaystyle = w . c o m p u t e ( g ( w ) ) + w . u p d a t e ( g ( w ) ) } } \\ { { \displaystyle ~ + e . \cdot x f e r ( g ( u ) , g ( w ) ) + e . \cdot x f e r ( g ( w ) , g ( v ) ) - e ^ { \prime } . x f e r ( g ( u ) , g ( v ) ) } } \end{array}
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
Now assume $g$ is an optimal configuration for $( V , E )$ . Then we have
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
\begin{array} { r l } & { \quad w . c o m p u t e ( g ( w ) ) + w . u p d a t e ( g ( w ) ) + e _ { 1 } . x f e r ( g ( u ) , g ( w ) ) + e _ { 2 } . x f e r ( g ( w ) , g ( v ) ) } \\ & { = \underset { c _ { w } } { \operatorname* { m i n } } \{ w . c o m p u t e ( c _ { w } ) + w . u p d a t e ( c _ { w } ) + e _ { 1 } . x f e r ( g ( u ) , c _ { w } ) + e _ { 2 } . x f e r ( c _ { w } , g ( v ) ) \} } \end{array}
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
Therefore, $g$ is an optimal configuration of $( V ^ { \prime } , E ^ { \prime } )$ . For the other direction, note that if $g$ is an optimal configuration of $( V ^ { \prime } , E ^ { \prime } )$ , then it can be extended to an optimal configuration of $( V , E )$ by adding the node $w$ with the same minimal assignment. □
|
| 276 |
+
|
| 277 |
+
# A.1.2 EDGE ELIMINATION
|
| 278 |
+
|
| 279 |
+
For a computation graph $G ( V , E )$ , applying an edge elimination on $\boldsymbol { e } _ { 1 } = ( u , v )$ and $\boldsymbol { e } _ { 2 } = ( u , v )$ results in a modified graph $G ^ { \prime } = ( V , E ^ { \prime } )$ , where $E ^ { \prime } = E - e _ { 1 } - e _ { 2 } + e ^ { \prime }$ and $\boldsymbol { e } ^ { \prime } = \left( \boldsymbol { u } , \boldsymbol { v } \right)$ . We prove that $C o s t ( g , ( V , E ) ) = C o s t ( g , ( V , E ^ { \prime } ) )$ for any global configuration $g$ of $( V , E )$ .
|
| 280 |
+
|
| 281 |
+
Theorem 2. For any global configuration $g$ of graph $\begin{array} { r c l } { G } & { = } & { ( V , E ) } \end{array}$ , $C o s t ( g , ( V , E ) ) \quad = \quad$ $C o s t ( g , ( V , E ^ { \prime } ) )$ , where $( V , E ^ { \prime } )$ is the modified graph of $( V , E )$ after an edge elimination.
|
| 282 |
+
|
| 283 |
+
Proof. We compute the difference between $C o s t ( g , ( V , E ) )$ and $C o s t ( g , ( V , E ^ { \prime } ) )$ .
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
\begin{array} { r l } & { \quad C o s t ( g , ( V , E ) ) - C o s t ( g , ( V , E ^ { \prime } ) ) } \\ & { = e _ { 1 } . x f e r ( g ( u ) , g ( v ) ) - e _ { 2 } . x f e r ( g ( u ) , g ( v ) ) + e ^ { \prime } . x f e r ( g ( u ) , g ( v ) ) } \\ & { = 0 } \end{array}
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
The last equation uses Equation 3.
|
| 290 |
+
|
| 291 |
+
# A.2 RELATED WORK ON OVERLAPPING COMMUNICATION WITH DATA TRANSFER
|
| 292 |
+
|
| 293 |
+
The overlap optimization in Section 5 is motivated by Goyal et al. (2017), which performs gradient aggregation in parallel with back propagation to scale synchronous training to large number of GPUs. We extend their design and implementation by also enabling the optimization for asynchronous training in DeePa.
|
| 294 |
+
|
| 295 |
+
# A.3 PROFILING RESULTS
|
| 296 |
+
|
| 297 |
+
We show profiling results for visualizing the performance bottlenecks in different parallelism approaches. The experiment was performed on a single node with four Tesla P100 GPUs (as described in Section 7.3). We enable overlapping computation with data transfers (described in Section 5) in this experiment.
|
| 298 |
+
|
| 299 |
+
Figure 15 shows the profiling results for training VGG-16 on 4 GPUs with different parallelism configurations. Note that DeePa with image parallelism achieves $10 \%$ higher training throughput compared to PyTorch and TensorFlow, as shown in Figure 14. Figure 15a shows that all GPUs are highly utilized during forward and backward passes, as indicated by the tight packing of tasks in the timeline. However, the image parallelism approach requires moving 4GB of metadata in every iteration, which cannot be fully overlapped with back propagation, therefore the image parallelism approach has a performance gap between iterations (shown as the white space on the GPU timelines).
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 15: Timelines for training VGG-16 with a minibatch size of 128 images on 4 GPUs. The first horizontal line in each figure shows the overall GPU utilization at different timesteps, and each of the following lines shows the run times for individual operations on each GPU.
|
| 303 |
+
|
| 304 |
+
Figure 15b shows the profiling of the optimal parallelism configuration chosen by DeePa, which uses image parallelism on 4 GPUs for all convolutional layers and pooling layers and uses model parallelism on 2 GPUs for the fully connected layers. Therefore, the training with the optimal configuration includes data transfers for each fully connected layers, which adds small performance gaps at the end of the forward pass and the beginning of the backward pass (shown as the small white space on the GPU timelines). However, the optimal configuration reduces the per-iteration data transfers from 4GB to 490MB, which effectively hides data transfer overhead and achieves better GPU utilization. As a result, the optimal configuration reduces the per-iteration training time from 0.34 seconds to 0.24 seconds.
|
| 305 |
+
|
| 306 |
+
# A.4 IMANGENET-22K
|
| 307 |
+
|
| 308 |
+
We compare the performance of DeePa, PyTorch, and TensorFlow on the ImageNet-22K dataset (Russakovsky et al., 2015) that contains 21,841 different categories (the ImageNet dataset used in Section 7 contains 1,000 catagories). The last fully-connected layer in AlexNet, VGG-16, and Inception-v3 originally have 1,000 neurons followed by a 1,000-way softmax layer. To train the three networks on the ImageNet-22K dataset, we change the last fully-connected layer to have 21,841 neurons and use a 21,841-way softmax layer at the end. The modified networks were trained on 16 Tesla K80 GPUs on a single node with a minibatch size of 512 images.
|
| 309 |
+
|
| 310 |
+
Figure 16 compares the training throughput and per-iteration data transfers among DeePa, PyTorch, and TensorFlow on the ImageNet and ImageNet-22K datasets. Figure 16a shows that, on the ImageNet-22K dataset, the training throughput of PyTorch and TensorFlow is reduced by $20 \%$ - $45 \%$ , while DeePa’s throughput falls off by $3 \%$ , compared to training on the original ImageNet dataset. Figure 16b compares the per-iteration data transfers between image parallelism and the global configurations used by DeePa. Using image parallelism increases the data transfers in each iteration by 5-10GB, while DeePa only increases the per-iteration data transfers by 40MB. As a result, for training on the ImageNet-22K dataset, DeePa reduces the per-iteration data transfers by $3 . 7 – 4 4 . 5 \times$ compared to image parallelism.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 16: Performance comparisons among DeePa, PyTorch, and TensorFlow on the ImageNet-22k dataset.
|
md/train/SJeHwJSYvH/SJeHwJSYvH.md
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING DE-BIASED REPRESENTATIONS WITH BIASED REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Many machine learning algorithms are trained and evaluated by splitting data from a single source into training and test sets. While such focus on in-distribution learning scenarios has led interesting advances, it has not been able to tell if models are relying on dataset biases as shortcuts for successful prediction (e.g., using snow cues for recognising snowmobiles). Such biased models fail to generalise when the bias shifts to a different class. The cross-bias generalisation problem has been addressed by de-biasing training data through augmentation or re-sampling, which are often prohibitive due to the data collection cost (e.g., collecting images of a snowmobile on a desert) and the difficulty of quantifying or expressing biases in the first place. In this work, we propose a novel framework to train a de-biased representation by encouraging it to be different from a set of representations that are biased by design. This tactic is feasible in many scenarios where it is much easier to define a set of biased representations than to define and quantify bias. Our experiments and analyses show that our method discourages models from taking bias shortcuts, resulting in improved performances on de-biased test data.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Most machine learning algorithms are trained and evaluated by randomly splitting a single source of data into training and test sets. Although this is a standard protocol, it is blind to a critical problem: the existence of dataset bias (Torralba & Efros, 2011). For instance, many frog images are taken in swamp scenes, but swamp itself is not a frog. Nonetheless, a neural network will exploit this bias (i.e., take “shortcuts”) if it yields correct predictions for the majority of training examples. If bias is sufficient to achieve high accuracy, there is little motivation for models to learn the complexity of the intended task, despite its full capacity to do so. Consequently, a model that relies on bias will achieve high in-distribution accuracy, yet fail to generalise when the bias shifts.
|
| 12 |
+
|
| 13 |
+
We tackle this “cross-bias generalisation” problem where a model does not exploit its full capacity due to the “sufficiency” of bias cues for prediction of the target label in training data. For example, language models make predictions based on the presence of certain words (e.g., “not” for “contradiction”) (Gururangan et al., 2018) without much reasoning on the actual meaning of sentences, even if they are in principle capable of sophisticated reasoning. Similarly, convolutional neural networks (CNNs) achieve high accuracies on image classification by using local texture cues as shortcut, as opposed to more reliable global shape cues (Geirhos et al., 2019; Brendel & Bethge, 2019).
|
| 14 |
+
|
| 15 |
+
Existing methods attempt to remove a model’s dependency on bias by de-biasing the training data through data augmentation (Geirhos et al., 2019) or re-sampling tactics (Li & Vasconcelos, 2019). Others have introduced a pre-defined set of biases that a model is trained to be independent against (Wang et al., 2019). These prior works assume that bias can easily be defined or quantified, but real-world biases often do not (e.g., texture bias above).
|
| 16 |
+
|
| 17 |
+
To address this limitation, we propose a novel framework to train a de-biased representation by encouraging it to be “different” from a set of representations that are biased by design. Our insight is that biased representations can easily be obtained by utilising models of smaller capacity (e.g., bag of words for word bias and CNNs of small receptive fields for texture bias). Experiments show that our method is effective in reducing a model’s dependency on “shortcuts” in training data, as evidenced by improved accuracies in test data where the bias is either shifted or removed.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Learning scenarios. Different distributional gaps may take place between training and test distributions. Our work is addressing the cross-bias generalisation problem. Background colours on the right three figures indicate the decision boundaries of models trained on given training data.
|
| 21 |
+
|
| 22 |
+
# 2 PROBLEM DEFINITION
|
| 23 |
+
|
| 24 |
+
We provide a rigorous definition of our over-arching goal: overcoming the bias in models trained on biased data. We show that the problem we tackle is novel and realistic.
|
| 25 |
+
|
| 26 |
+
# 2.1 CROSS-BIAS GENERALISATION
|
| 27 |
+
|
| 28 |
+
We first define random variables, signal $S$ and bias $B$ as cues for the recognition of an input $X$ as certain target variable $Y$ . Signals $S$ are the cues essential for the recognition of $X$ as $Y$ ; examples include the shape and skin patterns of frogs for frog image classification. Biases $B$ ’s, on the other hand, are cues not essential for the recognition but correlated with the target $Y$ ; many frog images are taken in swamp scenes, so swamp scenes can be considered as $B$ . A key property of $B$ is that intervening on $B$ should not change $Y$ ; moving a frog from swamp to a dessert scene does not change the “frogness”. We assume that the true predictive distribution $p ( Y | X )$ factorises as $\hat { \int _ { } p ( Y | S , B ) p ( S , B | \bar { X } ) }$ , signifying the sufficiency of $p ( S , B | X )$ for recognition.
|
| 29 |
+
|
| 30 |
+
Under this framework, three learning scenarios are identified depending on the change of relationship $p ( S , B , Y )$ across training and test distributions, $p ( S ^ { \mathrm { t r } } , B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } )$ and $p ( S ^ { \mathrm { t e } } , B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } )$ , respectively: in-distribution, cross-domain, and cross-bias generalisation. See Figure 1 for a summary.
|
| 31 |
+
|
| 32 |
+
In-distribution. $p ( S ^ { \mathrm { t r } } , B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } ) = p ( S ^ { \mathrm { t e } } , B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } )$ . This is the standard learning setup utilised in many benchmarks by splitting data from a single source into training and test data at random.
|
| 33 |
+
|
| 34 |
+
Cross-domain. $p ( S ^ { \mathrm { t r } } , B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } ) \neq p ( S ^ { \mathrm { t e } } , B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } )$ and furthermore $p ( B ^ { \mathrm { t r } } ) \neq p ( B ^ { \mathrm { t e } } )$ . $B$ in this case is often referred to as “domain”. For example, training data consist of images with $Y ^ { \mathrm { t r } } { = } \mathrm { f r o g }$ , $B ^ { \mathrm { t r } } =$ wilderness) and $Y ^ { \mathrm { t r } } { = } \mathrm { b i r d }$ , $B ^ { \mathrm { t r } } =$ wilderness), while test data contain $Y ^ { \mathrm { t e } } =$ frog, $B ^ { \mathrm { t e } }$ =indoors) and $Y ^ { \mathrm { t e } } { = }$ bird, $B ^ { \mathrm { t e } }$ =indoors). This scenario is typically simulated by training and testing on different datasets (Ben-David et al., 2007).
|
| 35 |
+
|
| 36 |
+
Cross-bias. $p ( B ^ { \mathrm { t r } } ) \not \equiv p ( Y ^ { \mathrm { t r } } ) ^ { 1 }$ and the dependency changes across training and test distributions: $p ( B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } ) \ \ne \ p ( B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } )$ . We further assume that $p ( B ^ { \mathrm { { \bar { t } } } } ) ~ = ~ p ( B ^ { \mathrm { { t e } } } )$ , to clearly distinguish the scenario from the cross-domain generalisation. For example, training data only contain images of two types $Y ^ { \mathrm { t r } } { = } \mathrm { f r o g }$ , $B ^ { \mathrm { t r } } { = } \mathrm { s w a m p }$ ) and $Y ^ { \mathrm { t r } } { = } \mathrm { b i r d }$ , $B ^ { \mathrm { t r } } { = } \mathrm { s k y } ,$ ), but test data contain unusual class-bias combinations $Y ^ { \mathrm { t e } } =$ frog, $B ^ { \mathrm { t e } } { = } \mathrm { s k y }$ ) and ( $Y ^ { \mathrm { t e } } { = }$ bird, $B ^ { \mathrm { t e } } { = } \mathrm { s w a m p }$ ). Our work addresses this scenario.
|
| 37 |
+
|
| 38 |
+
# 2.2 EXISTING CROSS-BIAS GENERALISATION METHODS AND THEIR ASSUMPTIONS
|
| 39 |
+
|
| 40 |
+
Under cross-bias generalisation scenarios, the dependency $p ( B ^ { \mathrm { t r } } )$ 6⊥⊥ $p ( Y ^ { \mathrm { t r } } )$ makes bias $B$ a viable cue for recognition. The model trained on such data becomes susceptible to interventions on $B$ , limiting its generalisabililty when the bias is changed or removed in the test data. There exist prior approaches to this problem, but with different types and amounts of assumptions on $B$ . We briefly recap the approaches based on the assumptions they require. In the next part $\ S 2 . 3$ , we will define our novel problem setting that requires an assumption distinct from the ones in prior approaches.
|
| 41 |
+
|
| 42 |
+
When an algorithm to disentangle bias $B$ and signal $S$ exists. Being able to disentangle $B$ and $S$ lets one collapse the feature space corresponding to $B$ in both training and test data. A model trained on such normalised data then becomes free of biases. As ideal as it is, building a model to perfectly disentangle $B$ and $S$ is often unrealistic.
|
| 43 |
+
|
| 44 |
+
When a generative algorithm or data collection procedure for $p ( X | B )$ exists. When additional examples can be supplied through $p ( X | B )$ , the training dataset itself can be de-biased, i.e., $B \perp \perp Y$ . For example, one can either collect or synthesise unusual images like frogs in sky and birds in swamp to balance out the bias. Such a data augmentation strategy is indeed a valid solution adopted by many prior studies (Panda et al., 2018; Geirhos et al., 2019; Shetty et al., 2019). However, collecting unusual inputs can be expensive (Peyre et al., 2017), and building a generative model with pre-defined bias types (Geirhos et al., 2019) may suffer from bias mis-specification and the lack of realism.
|
| 45 |
+
|
| 46 |
+
When a predictive algorithm or ground truth for $p ( B | X )$ exists. Conversely, when one can tell the bias $B$ for every input $X$ , two approaches are feasible. (1) The first is a data re-weighting solution: we give greater weights on frogs in sky than frogs in swamps to even out the correlation in $p ( B , Y )$ (Li et al., 2018; Li & Vasconcelos, 2019). (2) The second approach removes the dependency between the model predictions $f ( X )$ and the bias $B$ . Many existing approaches for fairness in machine learning have proposed independence-based regularisers to encourage $f ( X ) \ \bot \bot B$ (Zemel et al., 2013) or the conditional independence $f ( X ) \ \bot \bot \ B \mid Y$ (called the “separation” constraint, Hardt et al. (2016)). Other approaches have proposed to remove predictability of $p ( B | X )$ based on $f ( X )$ through domain adversarial losses (Li & Vasconcelos, 2019; Wang et al., 2019) or projection (Wang et al., 2019; Quadrianto et al., 2019).
|
| 47 |
+
|
| 48 |
+
The knowledge on $p ( B | X )$ is provided in many realistic scenarios. For example, when the aim is to remove gender biases $B$ in a job application process $p ( Y | X )$ , applicants’ genders $p ( B | X )$ are supplied as ground truths. However, there exist cases when $B$ is difficult to even be defined or quantified but can only be indirectly specified. We tackle such a scenario in the next part.
|
| 49 |
+
|
| 50 |
+
# 2.3 OUR SCENARIO: CAPTURING BIAS WITH A PARTICULAR SET OF MODELS
|
| 51 |
+
|
| 52 |
+
Under the cross-bias generalisation scenario, certain types of biases are not easily addressed by the above methods. Take texture bias as an example (§1, Geirhos et al. (2019)): (1) texture $B$ and shape $S$ cannot easily be disentangled, (2) building a generative model $p ( X | B )$ or collecting unusual images is expensive, (3) building the predictive model $p ( B | X )$ for texture requires enumeration (classifier) or embedding (regression) of all possible textures, which is not feasible.
|
| 53 |
+
|
| 54 |
+
However, slightly modifying the third assumption results in a problem setting that allows interesting application scenarios. Instead of assuming explicit knowledge on $p ( B | X )$ , we approximate $B$ by defining a set of models $G$ that are biased towards $B$ by design. For texture biases, for example, we define $G$ to be the set of convolutional neural network (CNN) architectures with $\leq 5 \times 5$ overall receptive fields. Then, any learned model $g \in G$ can by design make predictions $g ( x )$ based on the patterns that can only be captured with small receptive fields (i.e., textures).
|
| 55 |
+
|
| 56 |
+
More precisely, we define $G$ to be a bias-characterising model class for the bias-signal pair $( B , S )$ if for every possible joint distribution $p ( B , X )$ there exists a $g \in G$ such that $p ( B | X ) \approx g ( X )$ (recall condition) and every $g \in G$ satisfies $g ( X ) \perp \perp S \mid B$ (precision condition). In practice, $G$ may not necessarily include all biases and may also capture important signals (i.e., imperfect recall and precision). With this in mind, our framework is formulated so that $f ( X )$ does not ignore signals captured by $G - \mathrm { w e }$ do not require $\mathbf { G }$ to be perfect. Further detail is provided in $\ S 2 . 3$ .
|
| 57 |
+
|
| 58 |
+
There exist many scenarios when such $G$ can be defined, as we are given several evidence for the type of bias. For instance, action recognition models have been reported to rely heavily on static cues without learning temporal cues (Li et al., 2018; Li & Vasconcelos, 2019); though the actual bias may not precisely be any static cue, we can still regularise the 3D convolutional networks towards better generalisation across static cue biases by defining $\mathbf { G }$ to be the set of 2D convolutional architectures. It has been argued that visual question answering (VQA) models, too, rely overly on language biases rather than the visual cues (e.g. without looking at the image, one knows the answer to what colour is the banana is yellow) (Agrawal et al., 2018). We can define G as the set of models looking at the language modality only. Entailment models are biased towards the presence of certain words (e.g. when there are many nots, the sentence is contradictory), rather than really understanding the underlying meaning of sentences (McCoy et al., 2019; Niven & Kao, 2019). We can design G to be the set of bag-of-words classifiers (He et al., 2019; Clark et al., 2019). Generally, these scenarios exemplify situations when the added architectural capacity is not fully utilised due to the sufficiency of simpler cues for solving the task in the given training set.
|
| 59 |
+
|
| 60 |
+
# 3 PROPOSED METHOD
|
| 61 |
+
|
| 62 |
+
We present a solution for the cross-bias generalisation when the bias-characterising model class $G$ is known (see $\ S 2 . 3 )$ ; the method is referred to as $\mathrm { R E B I ^ { \prime } } \mathrm { S } ^ { 2 }$ . The solution consists of training a model $f$ for the task $p ( Y | X )$ with a regularisation term encouraging the independence between the prediction $f ( X )$ and the set of all possible biased predictions $\{ g ( X ) \mid g \in G \}$ . We will introduce the precise definition of the regularisation term and discuss why and how it leads to the unbiased model.
|
| 63 |
+
|
| 64 |
+
# 3.1 REBI’S: REMOVING BIAS WITH BIAS
|
| 65 |
+
|
| 66 |
+
If $p ( B | X )$ is fully known, we can directly encourage $f ( X ) \ \bot \bot B$ . Since we only have access to the set of biased models $G$ (§2.3), we seek to promote $f ( X ) \perp \perp g ( X )$ for every $g \in G$ . Simply put, we de-bias a representation $f \in F$ by designing a set of biased models $G$ and letting $f$ run away from $G$ . This leads to the independence from bias cues $B$ while leaving signal cues $S$ as valid recognition cues; see $\ S 2 . 3$ . We will specify REBI $^ \prime \mathrm { ~ S ~ }$ learning objective after introducing our independence criterion, HSIC.
|
| 67 |
+
|
| 68 |
+
Hilbert-Schmidt Independence Criterion (HSIC). Since we need to measure degree of independence between continuous random variables $f ( X )$ and $g ( X )$ in high dimensional spaces, it is infeasrando o resoiables $U$ to hiand $V$ gram-basedand kernels $k$ easuand $l$ es; we use HSIC (G, HSIC is defined as $\mathrm { H S I C } ^ { k , l } ( U , V ) : = | | C _ { U V } ^ { k , l } | | _ { \mathrm { H S } } ^ { 2 }$ $C ^ { k , l }$ $k$ and $l$ (Gretton et al., 2005), an RKHS analogue of covariance matrices. $| | \cdot | | _ { \mathrm { H S } }$ is the HilbertSchmidt norm, a Hilbert-space analogue of the Frobenius norm. It is known that for two random variables $U$ and $V$ and radial basis function (RBF) kernels $k$ and $l$ , $\mathrm { H S I C } ^ { k , l } ( U , V ) = 0$ if and only if $U \perp \perp V$ . A finite-sample estimate $\mathrm { H S I C } _ { 0 } ^ { k , l } ( U , V )$ has been used in practice for statistical testing (Gretton et al., 2005; 2008), feature similarity measurement (Kornblith et al., 2019), and model regularisation (Quadrianto et al., 2019; Zhang et al., 2018). $\mathrm { H S I C } _ { 0 } ^ { k , l } ( U , V )$ with $m$ samples is defined as $( m - 1 ) ^ { - 2 } \mathrm { t r } ( \widetilde { U } \widetilde { V } ^ { T } )$ where $\widetilde { U }$ is a mean-subtracted matrix of pairwise kernel similarities $\begin{array} { r } { \widetilde { U } _ { i j } = k ( u _ { i } , u _ { j } ) - m ^ { - 1 } \sum _ { j ^ { \prime } } k ( u _ { i } , u _ { j ^ { \prime } } ) } \end{array}$ among samples $\{ u _ { i } \} \sim U$ . $\widetilde { V }$ is defined similarly.
|
| 69 |
+
|
| 70 |
+
Minimax optimisation for bias removal. In our case, we compute
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\mathrm { H S I C } _ { 0 } ^ { k } ( f ( X ) , G ( X ) ) : = \operatorname* { m a x } _ { g \in G } \mathrm { H S I C } _ { 0 } ^ { k } ( f ( X ) , g ( X ) )
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
with an RBF kernel $k$ for the degree of independence between representation $f \in F$ and the biased representations $G$ . We write $\mathrm { H S I C } _ { 0 } ( f , \mathbf { \bar { G } } )$ and $\mathrm { H S I C } _ { 0 } ( f , g )$ as shorthands. Since the problem $\operatorname* { m i n } _ { f }$ $\mathrm { H S I C } _ { 0 } ( f , G )$ allows trivial solutions $f =$ const, we use the canonical kernel alignment (CKA) (Shawe-Taylor $\&$ Cristianini, 2004; Kornblith et al., 2019) criterion defined by $\Gamma \mathrm { K A } _ { 0 } ( f , g ) = \mathrm { H S I C } _ { 0 } ( f , g ) / ( \mathrm { H S I C } _ { 0 } ( f , f ) ^ { \frac { 1 } { 2 } } \mathrm { H S I C } _ { 0 } ( g , g ) ^ { \frac { 1 } { 2 } } )$ . The learning objective for $f$ is then defined as
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\operatorname* { m i n } _ { f \in F } \left\{ { \mathcal { L } } ( f , X , Y ) + \lambda \operatorname* { m a x } _ { g \in G } { \bf C } { \bf K } { \bf A } _ { 0 } ( f , g ) \right\} ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\mathcal { L } ( f , X , Y )$ is the loss for the main task $p ( Y | X )$ and $\lambda > 0$ . We consider replacing the inner optimisation with $L _ { 2 }$ minimisation $\textstyle \operatorname* { m i n } _ { g \in G } ~ | | f - g | | _ { 2 }$ , while retaining the CKA regularisation for the outer optimisation for $f$ . Intuitively, $L _ { 2 }$ minimisation poses a stronger similarity condition between $f$ and $g$ (in fact identity) than does $C K A$ , leading to better de-biasing performances (§4.2.3).
|
| 83 |
+
|
| 84 |
+
Independence versus separation. The CKA regularisation in equation 2 encourages $f ( X ) ~ \bot$ $\perp \ g ( X )$ . This may lead to less stable optimisation as removing bias often increases the main task loss $\mathcal { L }$ . Furthermore, $g ( X )$ may also capture signals along with bias (imperfect precision), and suppressing important signals is not desirable. To avoid such cases, we formulate our objective as conditional independence $f ( X ) \perp \perp g ( X ) \mid Y$ by computing the separation CKA, $\begin{array} { r } { \mathrm { S C K A } _ { 0 } ( f , g ) \ : = \ : | \mathcal { V } | ^ { - 1 } \sum _ { y \in \mathcal { V } } \mathrm { \ C K A } _ { 0 } ( f ( X | Y = y ) , g ( X | Y = y ) ) } \end{array}$ , where the term “separation” (or “equalised odds”) comes from the fairness literature (Hardt et al., 2016). Unlike independence that requires $f ( X )$ to ignore $g ( X )$ altogether, conditional independence allows $f ( X )$ to utilise cues captured by $g ( X )$ (i.e., whether it is bias or signal) if it highly correlates with ${ \mathrm { Y } } .$ In other words, $\mathbb { R E B I ^ { \prime } S }$ encourages $f ( X )$ to learn features beyond those already captured by $g ( X )$ , so that it can generalise well to test sets with different biases (i.e., cross-bias generalisation).
|
| 85 |
+
|
| 86 |
+
The final learning objective for REBI $^ \prime \mathrm { ~ S ~ }$ is then
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\operatorname* { m i n } _ { f \in { \cal F } } \left\{ { \mathcal { L } } ( f , X , Y ) + \lambda \operatorname* { m a x } _ { g \in { \cal G } } { \mathrm { S C K A } } _ { 0 } ( f , g ) \right\} .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
# 3.2 WHY AND HOW DOES IT WORK?
|
| 93 |
+
|
| 94 |
+
Independence describes relationships between random variables, but we use it for function pairs. Which functional relationship does statistical independence translate to? In this part, we argue with proofs and observations that the answer to the above question is the dissimilarity of invariance types learned by a pair of models.
|
| 95 |
+
|
| 96 |
+
Linear case: Equivalence between independence and orthogonality. We study the set of function pairs $( f , g )$ satisfying $f ( X ) \perp \perp g ( { \bar { X } } )$ for suitable random variable $X \sim p ( X )$ . Assuming linearity of involved functions and the normality of $X$ , we obtain the equivalence between statistical independence and functional orthogonality.
|
| 97 |
+
|
| 98 |
+
Lemma 1. Assume that $f$ and $g$ are affine mappings $f ( x ) = A x + a$ and $g ( x ) = B x + b$ where $A \in \mathbb { R } ^ { m \times n }$ and $B \in \mathbb { R } ^ { l \times n }$ . Assume further that $X$ is a normal distribution with mean $\mu$ and covariance matrix $\Sigma$ . Then, $f ( X )$ ⊥⊥ $g ( X )$ if and only if $\ker ( A ) ^ { \perp } \perp _ { \Sigma } \ker ( B ) ^ { \perp }$ . For a positive semi-definite matrix $\Sigma$ , we define $\langle r , s \rangle _ { \Sigma } = \langle r , { \Sigma } s \rangle$ , and the set orthogonality $\perp _ { \Sigma }$ likewise. Proof in $\ S \mathbf { A }$ .
|
| 99 |
+
|
| 100 |
+
In particular, when $f$ and $g$ have 1-dimensional outputs, the independence condition is translated to the orthogonality of their weight vectors and decision boundaries. From a machine learning point of view, $f$ and $g$ are models with orthogonal invariance types.
|
| 101 |
+
|
| 102 |
+
Non-linear case: HSIC as a metric learning objective. We lack theories to fully characterise general, possibly non-linear, function pairs $( f , g )$ achieving $f ( X ) \perp \perp g ( X )$ ; it is an interesting open question. For now, we make a set of observations in this general case, using the finite-sample independence criterion $\mathrm { H S I C } _ { 0 } ( f , g ) : = ( m - 1 ) ^ { - 2 } \mathrm { t r } ( \widetilde { f } \widetilde { g } ^ { T } ) \stackrel { } { = } 0$ , where $\widetilde { f }$ is the mean-subtracted kernel matrix $\begin{array} { r } { \widetilde { f } _ { i j } = k ( f ( x _ { i } ) , f ( x _ { j } ) ) - m ^ { - 1 } \sum _ { k } k ( f ( x _ { i } ) , f ( x _ { k } ) ) } \end{array}$ and likewise for $\widetilde g$ (see $\ S 3 . 1 \rrangle$ .
|
| 103 |
+
|
| 104 |
+
Note that $\operatorname { t r } ( \widetilde { f } \ \widetilde { g } ^ { T } )$ is an inner product between flattened matrices $\widetilde { f }$ and $\widetilde g$ . We consider the inner eproduct minimising solution for $f$ on an input pair $x _ { 0 } \neq x _ { 1 }$ egiven a fixed $g$ . The problem can be written as $\begin{array} { r } { \operatorname* { m i n } _ { f ( x _ { 0 } ) , f ( x _ { 1 } ) } \ \mathrm { t r } ( \widetilde { f } \widetilde { g } ^ { T } ) } \end{array}$ , which is equivalent to $\begin{array} { r } { \operatorname* { m i n } _ { f ( x _ { 0 } ) , f ( x _ { 1 } ) } \ \widetilde { f } _ { 0 1 } \cdot \widetilde { g } _ { 1 0 } } \end{array}$ .
|
| 105 |
+
|
| 106 |
+
Suppose $\widetilde { g } _ { 1 0 } ~ > ~ 0$ . It indicates a relative invariance of $g$ on $( x _ { 1 } , x _ { 0 } )$ , since $k ( g ( x _ { 1 } ) , g ( x _ { 0 } ) ) \ >$ $\begin{array} { r } { m ^ { - 1 } \sum _ { i } k ( g ( x _ { 1 } ) , g ( x _ { i } ) ) } \end{array}$ . Then, the above problem boils down to $\mathrm { m i n } _ { f ( x _ { 0 } ) , f ( x _ { 1 } ) } \stackrel { \triangledown } { f _ { 0 1 } }$ , signifying the relative variance of $f$ on $( x _ { 0 } , x _ { 1 } )$ . Following a similar argument, we obtain the converse statement: if $g$ is relatively variant on a pair of inputs, invariance of $f$ on the pair minimises the objective.
|
| 107 |
+
|
| 108 |
+
We conclude that $\operatorname* { m i n } _ { f }$ $\mathrm { H S I C } _ { 0 } ( f , g )$ against a fixed $g$ is a metric-learning objective for the embedding $f$ , where ground truth pairwise matches and mismatches are relative mismatches and matches for $g$ , respectively. As a result, $f$ and $g$ learn different sorts of invariances.
|
| 109 |
+
|
| 110 |
+
Effect of HSIC regularisation on toy data. We have established that HSIC regularisation encourages the difference in model invariances. To see how it helps to de-bias a model, we have prepared synthetic two-dimensional training data following the cross-domain generalisation case in Figure 1: $\dot { \boldsymbol X } = ( B , S ) \in \mathbb { R } ^ { 2 }$ and $Y \in$ {red, yellow, green}. Since the training data is perfectly biased, a multi-layer perceptron (MLP) trained on the data only shows $5 5 \%$ accuracy on de-biased test data (see decision boundary figure in Appendix $\ S \mathbf { B }$ ). To overcome the bias, we have trained another MLP with equation 3 where the bias-characterising class $G$ is defined as the set of MLPs that take only the bias dimension as input. This model exhibits de-biased decision boundaries (Appendix $\ S \mathbf { B }$ ) with improved accuracy of $89 \%$ on the de-biased test data.
|
| 111 |
+
|
| 112 |
+
# 4 EXPERIMENTS
|
| 113 |
+
|
| 114 |
+
In the previous section, REBI $^ \prime \mathrm { ~ S ~ }$ has been introduced and theoretically justified. In this section, we present experimental results of REBI’S. We first introduce the setup, including the biases tackled in the experiments, difficulties inherent to the cross-bias evaluation, and the implementation details (§4.1). Results on Biased MNIST (§4.2) and ImageNet (§4.3) are shown afterwards.
|
| 115 |
+
|
| 116 |
+
# 4.1 EXPERIMENTAL SETUP
|
| 117 |
+
|
| 118 |
+
Which biases do we tackle? There is a broad spectrum of bias types to be addressed under the cross-bias generalisation setting. Our work is targeting the biases that arise due to the existence of shortcut cues that are sufficient for recognition in training data. In the experiments, we tackle a representative bias of such type: “local pattern” biases for image classification. Even if a CNN image classifier has wide receptive fields, empirical evidence indicates that they heavily rely on local patterns (i.e., color and texture) as opposed to global shape cues (Geirhos et al., 2019).
|
| 119 |
+
|
| 120 |
+
While it is difficult to precisely define and quantify all local pattern biases, it is easy to capture it through a class of CNN architectures: those with smaller receptive fields. This is precisely the setting where we benefit from REBI’S.
|
| 121 |
+
|
| 122 |
+
Evaluating cross-bias generalisation is difficult. To measure the performance of a model across real-world biases, one requires an unbiased dataset or one where the types and degrees of biases can be controlled. Unfortunately, data in real world arise with biases. To de-bias a frog and bird image dataset with swamp and sky backgrounds (see $\ S 2 . 1 )$ , either rare data samples must be collected (search for photos of a frog on sky) or one must intervene with the data generation process (throw a frog into the sky and take a photo). Either way, it is an expensive procedure (Peyre et al., 2017).
|
| 123 |
+
|
| 124 |
+
Preparing an unbiased data is feasible in some cases when the bias type is simple (e.g., collecting natural language corpus of unbiased gender pronouns, Webster et al. (2018)). However, we are addressing biases that are expressed in terms of a class of representations but perhaps are difficult to precisely express in language, such as texture bias of image classifiers (§2.3).
|
| 125 |
+
|
| 126 |
+
We thus evaluate our method along two axes: (1) Biased MNIST and (2) ImageNet. Biased MNIST contains synthetic biases (colour and texture) which we freely control in training and test data for indepth analysis of REBI’S. In particular, we can measure its performance on perfectly unbiased test data. On ImageNet, we evaluate our method against realistic biases. Due to the difficulty of defining and obtaining bias labels on real images, we use proxy ground truths for the local pattern bias to measure the cross-bias generalisability. MNIST and ImageNet experiments complement each other in terms of experimental control and realism.
|
| 127 |
+
|
| 128 |
+
Implementation of REBI’S. We describe the specific design choices in REBI’S implementation (equation 3) in our experiments. We will open source the code and data.
|
| 129 |
+
|
| 130 |
+
To train a model that overcomes local pattern biases, we first define biased model architecture families $G$ such that they precisely and sufficiently encode biased representations: CNNs with relatively small receptive fields (RFs). The biased models in $G$ will by design learn to predict the target class of an image through only local cues. On the other hand, we define a larger search space $F$ with larger RFs for our unbiased representations.
|
| 131 |
+
|
| 132 |
+
In our work, all networks $f$ and $g$ are fully convolutional networks. $f ( x )$ and $g ( x )$ denote the final convolutional layer outputs (feature maps), on which we compute the independence measures like
|
| 133 |
+
|
| 134 |
+
HSIC, CKA, and SCKA (§3.1). We perform global average pooling and a learnable linear classifier on $f ( x )$ , trained along with the outer optimisation, to compute the cross-entropy loss in equation 3.
|
| 135 |
+
|
| 136 |
+
For Biased MNIST, $F$ is the LeNet $F$ (LeCun et al., 1998) architecture with RF 28. It has two 5- convs3, after each of which max-pooling layers of $2 \times 2$ kernels are applied, followed by three linear layers. $G$ has the same number of layers but either with all convolutional layers of $1 \times 1$ kernels and without max-pooling operations, called BlindNet1, or with one 3-conv and one 1-conv, called BlindNet3, each with a RFs of 1 and 3, respectively. On ImageNet, we use ResNet (He et al., 2016) architecture for $F$ (either ResNet18 with RF of 435 or ResNet50 with RF of 427). $G$ is defined as BagNet (Brendel & Bethge, 2019) architectures with the same depth as ResNet’s (either BagNet18 with RF of 43 or BagNet50 with RF of 91). More implementation details are provided in $\mathrm { \ S C }$ .
|
| 137 |
+
|
| 138 |
+
# 4.2 BIASED MNIST
|
| 139 |
+
|
| 140 |
+
We first verify our model on a dataset where we have full control over the type and amount of bias during training and evaluation. We describe the dataset and present the experimental results.
|
| 141 |
+
|
| 142 |
+
# 4.2.1 DATASET AND EVALUATION
|
| 143 |
+
|
| 144 |
+
We construct a new dataset called Biased MNIST designed to measure the extent to which models generalise to bias shift. We modify MNIST (LeCun et al., 1998) by introducing two types of bias $B$ – colour and texture – that highly correlate with the label $Y$ during training. With $B$ alone, a CNN can achieve high accuracy without
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 2: Biased MNIST. We construct a synthetic dataset with two types of biases – colour and texture – which highly correlate with the label during training. Upper row: colour bias. Lower row: colour and texture biases.
|
| 148 |
+
|
| 149 |
+
having to learn inherent signals for digit recognition $S$ , such as shape, providing little motivation for the model to learn beyond these superficial cues.
|
| 150 |
+
|
| 151 |
+
We inject colour and texture biases by adding colour or texture patterns on training image backgrounds (see Figure 2). We pre-select 10 distinct colour or $3 \times 3$ texture patterns $b ( y )$ for each digit $\bar { y } \in \{ 0 , \cdots , 9 \}$ . Then, for each image of digit $y$ , we assign the pre-defined pattern $b ( y )$ with probability $\rho \in [ 0 , 1 ]$ and any other pattern (pre-defined for other digits) with probability $( 1 - \rho )$ . $\rho$ then controls the bias-target correlation in the training data: $\rho = 1 . 0$ leads to complete bias and $\rho = 0 . 1$ leads to an unbiased dataset. We consider two datasets: Single-bias MNIST with only colour bias and Multi-bias MNIST with both colour and texture biases ${ \bf \zeta } _ { \rho } = 0 . 9 9$ in all the experiments).
|
| 152 |
+
|
| 153 |
+
We evaluate the models generalisability to bias shift by evaluating under the following criterion:
|
| 154 |
+
|
| 155 |
+
Biased. $p ( S ^ { \mathrm { t e } } , B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } ) \ = \ p ( S ^ { \mathrm { t r } } , B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } )$ (an in-distribution case in $\ S 2 . 1 \ r ,$ ). Whatever bias the training set contains, it is replicated in the test set. This measures the ability of de-biased models to maintain high in-distribution performance while generalising to unbiased settings.
|
| 156 |
+
|
| 157 |
+
Unbiased. $B ^ { \mathrm { t e } } ~ \bot \bot ~ Y ^ { \mathrm { t e } }$ . We assign biases on test images independently of the labels. Bias is no longer predictive of $Y$ and a model needs to utilise actual signals $S$ to yield correct predictions.
|
| 158 |
+
|
| 159 |
+
We have additional fine-grained measures on Multi-bias MNIST: removed colour bias (colour; texture bias remains) and removed texture bias (texture; colour bias remains) cases. Colour and texture biases are marginalised out in the test set, respectively, to factorise generalisability across different types of bias.
|
| 160 |
+
|
| 161 |
+
# 4.2.2 RESULTS
|
| 162 |
+
|
| 163 |
+
Results on Single- and Multi-bias MNIST are shown in Table 1.
|
| 164 |
+
|
| 165 |
+
REBI’S lets a model overcome bias. We observe that vanilla LeNet $F$ achieves $100 \%$ accuracy under the “biased” metric (the same bias between training and test data) in Single- and Multi-bias MNIST. This is how most machine learning tasks are evaluated, yet this does not show the extent to which the model depends on bias for prediction. When the bias cues are randomly assigned to the label at evaluation, vanilla LeNet accuracy collapses to $2 7 . 5 \%$ and $2 9 . 6 \%$ under the “unbiased” metric on Single- and Multi-bias MNIST, respectively. The intentionally biased BlindNet models $G$ result in an even lower accuracy of $1 0 . 8 \%$ on Single-bias MNIST, close to the random chance $10 \%$ . This reveals that the seemingly high-performing model has in fact overfitted to bias and has not learned beyond this fallible strategy.
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Description</td><td colspan="2">Single-bias MNIST</td><td colspan="4">Multi-bias MNIST</td></tr><tr><td>biased</td><td>unbiased</td><td>biased</td><td>colour</td><td>texture</td><td>unbiased</td></tr><tr><td>F</td><td>Vanilla</td><td>100.</td><td>27.5</td><td>100.</td><td>45.1</td><td>85.8</td><td>29.6</td></tr><tr><td>G</td><td>Biased</td><td>100.</td><td>10.8</td><td>100.</td><td>10.0</td><td>58.5</td><td>4.7</td></tr><tr><td>FHEX</td><td>Wang et al. (2019)</td><td>97.2</td><td>14.7</td><td>95.0</td><td>31.1</td><td>91.1</td><td>18.1</td></tr><tr><td>FIG</td><td>REBI'S (ours)</td><td>96.1</td><td>74.9</td><td>94.7</td><td>91.9</td><td>90.9</td><td>88.6</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 1: Biased MNIST results. Architecture families are set as $\begin{array} { r } { F = \mathrm { L e N e t } } \end{array}$ and $G =$ BlindNet1 for Single-bias and BlindNet3 for Multi-bias MNIST. Accuracy results are shown.
|
| 170 |
+
|
| 171 |
+
REBI $^ \prime \mathrm { ~ S ~ }$ , on the other hand, achieves robust generalisation across all settings by learning to be different from BlindNet representations $G$ . REBI $^ \prime \mathrm { ~ S ~ }$ achieves a $+ 4 7 . 4$ pp (Single) and $+ 5 9 . 0$ pp (Multi) higher performances than the vanilla model under the cross-bias generalisation setup (the unbiased metric), with a slight degradation in original accuracies $( - 3 . 9 \mathrm { p p }$ and $- 5 . 3 \mathrm { p p }$ , respectively).
|
| 172 |
+
|
| 173 |
+
Comparison against HEX. Previously, HEX (Wang et al., 2019) has attempted to reduce the dependency of a model on “superficial statistics”, or high-frequency textural information. HEX measures texture via neural grey-level co-occurrence matrices (NGLCM) and projects out the NGLCM feature from the output of the model of interest. We observe that $F _ { \mathrm { H E X } }$ , where HEX is applied on $F$ , is effective in removing texture biases $( 8 5 . 8 \%$ to $9 1 . 1 \%$ cross-texture accuracy), but still vulnerable to colour biases (accuracy drops from $4 5 . 1 \%$ to $3 1 . 1 \%$ ). Hand-crafting texture features as done by HEX has resulted in its limited applicability beyond the hand-crafted bias type. By designing the model family architecture, instead of a specific feature extractor, REBI’S achieved a representation free of broader types of biases.
|
| 174 |
+
|
| 175 |
+
# 4.2.3 FACTOR ANALYSIS
|
| 176 |
+
|
| 177 |
+
Some design choices exist, leading to our final model (§3.1). We examine how the factors contribute to the final performance. See Table 2 for ablative studies on the Single-bias MNIST.
|
| 178 |
+
|
| 179 |
+
Impact of the independence criterion. Three independence measures, HSIC, CKA, and SCKA, have been considered. SCKA, the separation CKA, used in $\mathrm { R E B I ^ { \prime } } \mathrm { S }$ , shows a superior de-biasing performance $( 7 4 . 9 \% )$ against baseline choices. It improves upon HSIC by avoiding the trivial solution (a constant function), and upon CKA via more stable optimisation due to the milder conditional independence $f ( X ) \ { \stackrel { \cdot \cdot } { \bot } } \ B \mid Y$ that does not contradict the classification objective.
|
| 180 |
+
|
| 181 |
+
Impact of the $L _ { 2 }$ objective in the inner optimisation. We then study the effect of our choice to replace the inner SCKA optimisation with the $L _ { 2 }$ objective. $L _ { 2 }$ is considered, as it poses a stronger convergence condition than SCKA does. We confirm indeed that the $L _ { 2 }$ objective results in a better de-biasing performance.
|
| 182 |
+
|
| 183 |
+
Table 2: Factor analysis. Default REBI’S parameters: last rows.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Indep.</td><td colspan="2">biased unbiased</td></tr><tr><td>HSIC</td><td>83.5</td><td>51.1</td></tr><tr><td>CKA</td><td>97.4</td><td>22.0</td></tr><tr><td>SCKA</td><td>96.1</td><td>74.9</td></tr><tr><td>Inner opt.</td><td>biased</td><td>unbiased</td></tr><tr><td>SCKA</td><td>95.8</td><td>62.4</td></tr><tr><td>L2</td><td>96.1</td><td>74.9</td></tr><tr><td>Updating g</td><td>biased</td><td>unbiased</td></tr><tr><td>Fixed g</td><td>94.6</td><td>44.7</td></tr><tr><td>Multiple g</td><td>95.9</td><td>58.1</td></tr><tr><td>Updated g</td><td>96.1</td><td>74.9</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Impact of updating $g \in G$ . The advantage of specifying a class of models $G$ instead of a single, fixed model $g _ { 0 }$ is that $\operatorname { H S I C } ( f , G )$ can be computed more precisely (§3.1). We quantify this benefit. Fixing the biased representation to $g _ { 0 }$ results in sub-optimal de-biasing performance, $4 4 . 7 \%$ . By including multiple fixed biased models $\{ g _ { 0 } , \cdot \cdot \cdot , g _ { 7 } \} \subset { \overline { { G } } }$ , de-biasing improves to $5 8 . 1 \%$ , but is not as good as the updated $g$ case, $7 4 . 9 \%$ . It is thus important to precisely compute the representationto-set independence. More detailed analysis around the receptive field sizes of models in $G$ is in Appendix $\mathrm { \ S E }$ .
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Model</td><td>Description</td><td>Biased</td><td>Unbiased</td><td>IN-A</td></tr><tr><td>F</td><td>ResNet18</td><td>93.3</td><td>85.8</td><td>30.5</td></tr><tr><td>G</td><td>BagNet18</td><td>72.4</td><td>58.6</td><td>19.5</td></tr><tr><td>FIG</td><td>REBI'S</td><td>93.7</td><td>88.4</td><td>31.7</td></tr><tr><td>F</td><td>Geirhos et al.</td><td>92.5</td><td>87.6</td><td>29.7</td></tr><tr><td>F</td><td>ResNet50</td><td>91.7</td><td>78.3</td><td>29.5</td></tr><tr><td>G</td><td>BagNet50</td><td>73.0</td><td>60.9</td><td>21.4</td></tr><tr><td>FIG</td><td>REBI'S</td><td>88.7</td><td>89.2</td><td>31.3</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Table 3: ImageNet results. We show results with $F$ and $F _ { \bot \bot G }$ corresponding to $F$ is ResNet18 and $G$ is BagNet18) and ( $F$ is ResNet50 and $G$ is BagNet50). IN-A indicates ImageNet-A.
|
| 192 |
+
|
| 193 |
+
# 4.3 IMAGENET
|
| 194 |
+
|
| 195 |
+
In ImageNet experiments, we further validate the applicability of $\mathbb { R E B I ^ { \prime } S }$ on the local pattern bias in realistic images (i.e,, objects in natural scenes). The local pattern bias often lets a model achieve good in-distribution performances by exploiting the local cue shortcuts (e.g, determining a turtle class by not seeing its shape but the background texture).
|
| 196 |
+
|
| 197 |
+
# 4.3.1 DATASET AND EVALUATION
|
| 198 |
+
|
| 199 |
+
We construct 9-Class ImageNet, a subset of ImageNet (Russakovsky et al., 2015) containing 9 super-classes as done in Ilyas et al. (2019), since full-scale analysis on ImageNet is not scalable. We additionally balance the ratios of sub-class images for each super-class to solely focus on the effect of the local pattern bias.
|
| 200 |
+
|
| 201 |
+
Since it is difficult to evaluate cross-bias generalisability on realistic unbiased data ( 4.1), we settle for alternative evaluations:
|
| 202 |
+
|
| 203 |
+
Biased. $p ( S ^ { \mathrm { t e } } , B ^ { \mathrm { t e } } , Y ^ { \mathrm { t e } } ) = p ( S ^ { \mathrm { t r } } , B ^ { \mathrm { t r } } , Y ^ { \mathrm { t r } } )$ Accuracy is measured on the in-distribution validation set. Though widely-used, this metric is blind to a model’s generalisability to unseen bias-target combinations.
|
| 204 |
+
|
| 205 |
+
Unbiased. $B ^ { \mathrm { t e } } \perp \perp Y ^ { \mathrm { t e } }$ As a proxy to the perfectly de-biased test data, which is difficult to collect ( 4.1), we use texture clusters IDs $\dot { c } \in \{ 1 , \dot { \cdot } \cdot \cdot , K \} \dot $ as the ground truth labels for local pattern bias. For full details of texture clustering algorithm, see Appendix $\mathrm { \ S F }$ . For an unbiased accuracy measurement, we compute accuracies for every set of images corresponding to a target-texture combination $( c , y )$ . The combination-wise accuracy $A _ { c , y }$ is computed by $\mathrm { C o r r } ( c , y ) / \mathrm { P o p } ( c , y )$ , where $\operatorname { C o r r } ( c , y )$ is the number of correctly predicted samples in $( c , y )$ and $\mathrm { P o p } ( c , y )$ is the total number of samples in $( c , y )$ , called the population at $( c , y )$ . The unbiased accuracy is then the mean accuracy over all $A _ { c , y }$ where the population is non-zero $\dot { \operatorname { P o p } } ( c , y ) \neq 0$ . This measure gives more weights on samples of unusual texture-class combinations (smaller $\mathrm { P o p } ( c , y ) )$ that are less represented in the usual biased accuracies. Under this unbiased metric, a biased model basing its recognition on textures is likely to show sub-optimal results on unusual combinations, leading to a drop in the unbiased accuracy.
|
| 206 |
+
|
| 207 |
+
ImageNet-A. ImageNet-A (Hendrycks et al., 2019) contains failure cases of ImageNet pre-trained ResNet50 among web images. The images consist of many failure modes of networks when “frequently appearing background elements” become erroneous cues for recognition (e.g. a bee image feeding on hummingbird feeder is recognised as a hummingbird). Improved performance on ImageNet-A is an indirect signal that the model learns beyond the bias shortcuts.
|
| 208 |
+
|
| 209 |
+
# 4.3.2 RESULTS
|
| 210 |
+
|
| 211 |
+
We measure performances of ResNet18 and ResNet50, each trained to be different from BagNet18 and BagNet50 respectively using REBI’S, under the metrics in the previous part. Results are shown in Table 3.
|
| 212 |
+
|
| 213 |
+
Vanilla models are biased. Both ResNet18 and ResNet50 show good performances on the biased accuracy $( 9 3 . 3 \%$ and $9 1 . 7 \%$ , respectively), but dropped performances on the texture-unbiased accuracies $8 5 . 8 \%$ and $78 . 3 \%$ , respectively). BagNet18 and BagNet50 perform worse than the vanilla ResNets as they are heavily biased towards texture by design (i.e., small receptive field size). The drop signifies the biases of vanilla models towards texture cues; by basing their predictions on texture cues they obtain generally better accuracies on texture-class pairs $( c , y )$ that are represented more. The drop also shows the limitation of current evaluation schemes where cross-bias generalisation is not measured.
|
| 214 |
+
|
| 215 |
+
REBI’S leads to less biased models. When REBI $^ \prime \mathrm { ~ S ~ }$ is applied on ResNet18 and ResNet50 to encourage them to unlearn cues learnable by BagNet18 and BagNet50, respectively, we observe general boost in unbiased accuracies. ResNet18 improves from $8 5 . 8 \%$ to $8 8 . 4 \%$ ; ResNet50 from $7 8 . 3 \%$ to $8 9 . 2 \%$ . Our method thus robustly generalises to less represented texturetarget combinations at test time. We observe that our method also shows improvement on the challenging ImageNet-A subset (e.g. from $2 9 . 5 \%$ to $3 1 . 3 \%$ for ResNet50), which further shows our superiority on generalisability to unusual texture-class combinations. Similarly, data augmentation via Stylised ImageNet (Geirhos et al., 2019) attempts to reduce a model’s dependency on texture by augmenting data with texturised images. While it shows improvements in reducing texture bias $( 8 7 . 6 \%$ for unbiased accuracy), it does not increase the generalisability to the challenging natural adversarial examples $( 2 9 . 7 \%$ for ImageNet-A). More detailed analysis on per-texture and per-class accuracies are included in Appendix $\ S \mathbf G$ ; learning curves for the baseline and $\mathrm { R E B I ^ { \prime } } \mathrm { S }$ are in Appendix $\mathrm { \ S H }$ .
|
| 216 |
+
|
| 217 |
+
Qualitative analysis. We qualitatively present the cases where our method successfully de-biases a texture-target dependency. Figure 3 shows examples of common and uncommon texture-target combinations for “grass” and “close-up” texture clusters. The shown uncommon instances are the ones ResNet18 has incorrectly predicted the class. For example, crab in the grass has been predicted as turtle, presumably because turtles co-occur a lot with grass backgrounds in training data. On the other hand, REBI’S (ours) robustly generalises to unusual texture-class combinations.
|
| 218 |
+
|
| 219 |
+
# 5 CONCLUSION
|
| 220 |
+
|
| 221 |
+
We have identified a practical problem faced by many machine learning algorithms that the learned models exploit bias shortcuts to recognise the target (cross-bias generalisation problem in $\ S 2$ ). In particular, models tend to under-utilise its capacity to extract non-bias signals (e.g. global shapes for object recognition) when bias shortcuts provide sufficient cues for recognition in the training data (e.g. local patterns and background cues for object recognition) (Geirhos et al., 2019). We have addressed this problem with the $\mathrm { R E B I ^ { \prime } } \mathrm { S }$ framework, which does not rely on expensive, if not infeasible, training data debiasing schemes. Given an identified set of models $G$ that encodes the bias to be removed, REBI’S encourages a model $f$ to be statistically independent of $G$ (§3). We have provided theoretical justifications for the use of statistical independence in $\ S 3 . 2$ , and have validated the superiority of REBI’S in removing biases from models through experiments on modified MNIST and ImageNet (§4).
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 3: Qualitative results. Common and uncommon images are shown according to class-texture relationship. Predictions of ResNet18 and REBI’S are shown as well.
|
| 225 |
+
|
| 226 |
+
# REFERENCES
|
| 227 |
+
|
| 228 |
+
Aishwarya Agrawal, Dhruv Batra, Devi Parikh, and Aniruddha Kembhavi. Don’t just assume; look and answer: Overcoming priors for visual question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4971–4980, 2018.
|
| 229 |
+
Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In Advances in neural information processing systems, pp. 137–144, 2007.
|
| 230 |
+
Wieland Brendel and Matthias Bethge. Approximating CNNs with bag-of-local-features models works surprisingly well on imagenet. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=SkfMWhAqYQ.
|
| 231 |
+
|
| 232 |
+
Christopher Clark, Mark Yatskar, and Luke Zettlemoyer. Don’t take the easy way out: Ensemble based methods for avoiding known dataset biases. EMNLP, 2019.
|
| 233 |
+
|
| 234 |
+
Leon Gatys, Alexander S Ecker, and Matthias Bethge. Texture synthesis using convolutional neural networks. In Advances in neural information processing systems, pp. 262–270, 2015.
|
| 235 |
+
|
| 236 |
+
Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id $_ { \cdot } =$ Bygh9j09KX.
|
| 237 |
+
|
| 238 |
+
Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Scholkopf. Measuring statistical dependence with ¨ hilbert-schmidt norms. In International conference on algorithmic learning theory, pp. 63–77. Springer, 2005.
|
| 239 |
+
|
| 240 |
+
Arthur Gretton, Kenji Fukumizu, Choon H Teo, Le Song, Bernhard Scholkopf, and Alex J Smola. A kernel ¨ statistical test of independence. In Advances in neural information processing systems, pp. 585–592, 2008.
|
| 241 |
+
|
| 242 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel Bowman, and Noah A. Smith. Annotation artifacts in natural language inference data. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics, pp. 107–112, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/N18-2017.
|
| 243 |
+
|
| 244 |
+
Moritz Hardt, Eric Price, Nati Srebro, et al. Equality of opportunity in supervised learning. In Advances in neural information processing systems, pp. 3315–3323, 2016.
|
| 245 |
+
|
| 246 |
+
He He, Sheng Zha, and Haohan Wang. Unlearn dataset bias in natural language inference by fitting the residual. EMNLP, 2019.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
|
| 250 |
+
Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. arXiv preprint arXiv:1907.07174, 2019.
|
| 251 |
+
|
| 252 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. arXiv preprint arXiv:1905.02175, 2019.
|
| 253 |
+
|
| 254 |
+
Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and superresolution. In European conference on computer vision, pp. 694–711. Springer, 2016.
|
| 255 |
+
|
| 256 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 257 |
+
|
| 258 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In International Conference on Machine Learning, 2019.
|
| 259 |
+
|
| 260 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document ´ recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 261 |
+
|
| 262 |
+
Yi Li and Nuno Vasconcelos. Repair: Removing representation bias by dataset resampling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9572–9581, 2019.
|
| 263 |
+
|
| 264 |
+
Yingwei Li, Yi Li, and Nuno Vasconcelos. Resound: Towards action recognition without representation bias. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 513–528, 2018.
|
| 265 |
+
|
| 266 |
+
R Thomas McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. ACL, 2019.
|
| 267 |
+
|
| 268 |
+
Timothy Niven and Hung-Yu Kao. Probing neural network comprehension of natural language arguments. ACL, 2019.
|
| 269 |
+
|
| 270 |
+
Rameswar Panda, Jianming Zhang, Haoxiang Li, Joon-Young Lee, Xin Lu, and Amit K Roy-Chowdhury. Contemplating visual emotions: Understanding and overcoming dataset bias. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 579–595, 2018.
|
| 271 |
+
|
| 272 |
+
Julia Peyre, Josef Sivic, Ivan Laptev, and Cordelia Schmid. Weakly-supervised learning of visual relations. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5179–5188, 2017.
|
| 273 |
+
|
| 274 |
+
Novi Quadrianto, Viktoriia Sharmanska, and Oliver Thomas. Discovering fair representations in the data domain. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8227–8236, 2019.
|
| 275 |
+
|
| 276 |
+
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.
|
| 277 |
+
|
| 278 |
+
John Shawe-Taylor and Nello Cristianini. Kernel methods for pattern analysis. Cambridge university press, 2004.
|
| 279 |
+
|
| 280 |
+
Rakshith Shetty, Bernt Schiele, and Mario Fritz. Not using the car to see the sidewalk–quantifying and controlling the effects of context in classification and segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8218–8226, 2019.
|
| 281 |
+
|
| 282 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 283 |
+
|
| 284 |
+
A. Torralba and A. A. Efros. Unbiased look at dataset bias. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1521–1528, June 2011.
|
| 285 |
+
|
| 286 |
+
Haohan Wang, Zexue He, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ } = 1$ rJEjjoR9K7.
|
| 287 |
+
|
| 288 |
+
Kellie Webster, Marta Recasens, Vera Axelrod, and Jason Baldridge. Mind the gap: A balanced corpus of gendered ambiguous pronouns. Transactions of the Association for Computational Linguistics, 6:605–617, 2018.
|
| 289 |
+
|
| 290 |
+
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International Conference on Machine Learning, pp. 325–333, 2013.
|
| 291 |
+
|
| 292 |
+
Changqing Zhang, Yeqinq Liu, Yue Liu, Qinghua Hu, Xinwang Liu, and Pengfei Zhu. Fish-mml: Fisher-hsic multi-view metric learning. In IJCAI, pp. 3054–3060, 2018.
|
| 293 |
+
|
| 294 |
+
# A STATISTICAL INDEPENDENCE IS EQUIVALENT TO FUNCTIONAL ORTHOGONALITY FOR LINEAR MAPS.
|
| 295 |
+
|
| 296 |
+
We provide a proof for the following lemma in $\ S 3 . 2$ .
|
| 297 |
+
|
| 298 |
+
Lemma 1. Assume that $f$ and $g$ are affine mappings $f ( x ) = A x + a$ and $g ( x ) = B x + b$ where $A \in \mathbb { R } ^ { m \times n }$ and $B \in \mathbb { R } ^ { \tilde { l } \times n }$ . Assume further that $X$ is a normal distribution with mean $\mu$ and covariance matrix $\Sigma$ . Then, $f ( X ) \ \bot \bot \ g ( X )$ if and only if $\ker ( A ) ^ { \perp } \perp _ { \Sigma } \ker ( B ) ^ { \perp }$ . For a positive semi-definite matrix $\Sigma$ , we define $\langle r , s \rangle _ { \Sigma } = \langle r , { \Sigma } s \rangle$ , and the set orthogonality $\perp _ { \Sigma }$ likewise.
|
| 299 |
+
|
| 300 |
+
Proof. Due to linearity and normality, the independence $f ( X ) \ \bot \bot g ( X )$ is equivalent to the covariance condition $\operatorname { C o v } ( f ( X ) , g ( X ) ) = 0$ . Covariance is computed as:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\operatorname { C o v } ( f ( X ) , g ( X ) ) = \operatorname { \mathbb { E } } _ { X } A ( X - x ^ { 0 } ) ( X - x ^ { 0 } ) ^ { T } B ^ { T } = A \Sigma B ^ { T }
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
Note that
|
| 307 |
+
|
| 308 |
+
$$
|
| 309 |
+
\begin{array} { r l } & { A \Sigma B ^ { T } = 0 \iff \langle v , A \Sigma B ^ { T } w \rangle = 0 \forall v , w \iff \langle A ^ { T } v , B ^ { T } w \rangle _ { \Sigma } = 0 \forall v , w } \\ & { \qquad \iff \mathrm { i m } ( A ^ { T } ) \perp _ { \Sigma } \mathrm { i m } ( B ^ { T } ) \iff \mathrm { k e r } ( A ) ^ { \perp } \perp _ { \Sigma } \mathrm { k e r } ( B ) ^ { \perp } \sqsupset \sqcap } \end{array}
|
| 310 |
+
$$
|
| 311 |
+
|
| 312 |
+
# B DECISION BOUNDARY VISUALISATION FOR TOY EXPERIMENT
|
| 313 |
+
|
| 314 |
+
We show the decision boundaries of the toy experiment in $\ S 3 . 2$ . See Figure 4. GIF animations of decision boundary changes over training can be found at anonymous link.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 4: Decision boundaries. Left to right: training data, baseline model, and our model.
|
| 318 |
+
|
| 319 |
+
# C IMPLEMENTATION DETAILS
|
| 320 |
+
|
| 321 |
+
We solve the minimax problem in equation 3 through alternating stochastic gradient descents (ADAM Kingma & Ba (2014)), where we alternate between 5 epochs for the outer problem and 5 epochs for the inner one. The regularisation parameter $\lambda$ is set to 7, 000 for CKA and 100 for $L _ { 2 }$ minimisation on MNIST and 0.05 for ImageNet. Note that we use a large $\lambda$ for MNIST as the degree of synthetic bias is excessively large (bias-target correlation set to $\rho = 0 . 9 9 ,$ ) compared to the degree of bias in realistic settings. We have used batch sizes 256 (32 for ResNet50) and learning rates 0.001 with linear decay. We train all models for 80 epochs for Biased MNIST. For 9-class ImageNet, we train ResNet18 for 200 epochs and ResNet50 for 100 epochs.
|
| 322 |
+
|
| 323 |
+
BagNet18 and BagNet50 have 18 and 50 convolutional layers which are the same structure (Basic or Bottleneck blocks) as ResNet18 and ResNet50, respectively. The internal kernel sizes of BagNets are set to $1 \times 1$ following the original paper’s philosophy (Brendel & Bethge (2019)).
|
| 324 |
+
|
| 325 |
+
# D PERFORMANCE BY BIAS AND LABEL ON BIASED MNIST.
|
| 326 |
+
|
| 327 |
+
In the Biased MNIST experiments (§4.2), we have shown either biased or unbiased set statistics. In this section, we provide more detailed results where model accuracies are computed per bias class
|
| 328 |
+
|
| 329 |
+
$B = b$ and per target label $Y = y$ . We visualise the case-wise accuracies of the baseline LeNet and the $\mathrm { R E B I ^ { \prime } S }$ trained LeNet⊥⊥BlindNet in Figure 5. The diagonals in each matrix indicate the pre-defined bias-target pair $( \ S 4 . 2 . 1 )$ . Thus, the biased accuracies can be computed by taking the mean of diagonal entries in each matrix and the unbiased accuracies through the mean of all entries in each matrix.
|
| 330 |
+
|
| 331 |
+
The vanilla LeNet’s tendency to have higher accuracies on diagonal entries and near-zero performances on many other off-diagonal entries indicate the fact that $\mathtt { I } { \in } \mathtt { N } { \in } \mathtt { t }$ is relying a lot on the colour (bias) cues. REBI’S successfully resolves this tendency in the vanilla model, exhibiting more uniform performances across all bias-target pairs $( b , y )$ . Note that accuracies below the main diagonal are relatively high as they are the classes that pre-defined patterns are assigned to at probability $( 1 - \rho )$ . Figure 6 demonstrates that our method is successful across different degrees of bias in a given training data.
|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
Figure 5: Bias-target-wise accuracies. We show accuracies for each bias $B = b$ and target $Y = y$ pair in Single-bias MNIST.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 6: Impact of $\rho .$ . REBI $^ \prime \mathrm { ~ S ~ }$ is effective in de-biasing across different degree of bias in data.
|
| 338 |
+
|
| 339 |
+
# E IMPACT OF RECEPTIVE FIELDS OF $G$ FOR BIASED MNIST
|
| 340 |
+
|
| 341 |
+
It is conceptually important to design a the set of biased models $G$ that encode the bias $B$ as precisely as possible. See precision and recall conditional for $G$ in $\ S 2 . 3 )$ . To see if this is empirically true, we have measured the performance of $\mathrm { R E B I ^ { \prime } } \mathrm { S }$ with $\boldsymbol { F } = \mathrm { L e N e t }$ and $G = \mathtt { B } \bot$ indNet, where the BlindNet receptive fields are controlled by replacing convolutional layers with $1 \times 1$ convolutions, resulting in receptive fields $\{ 1 , 5 , 7 , 2 8 \}$ . The $2 8 \times 2 8$ receptive field indicate the case when LeNet is used as $G$ . We measure the biased and unbiased set performances on Single-bias MNIST $( \ S 4 . 2 . 1 )$ .
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 7: Receptive fields of $G$ . Biased and unbiased accuracies of REBI $^ \prime \mathrm { ~ S ~ }$ with $F = \tt L e N e t$ and $G =$ BlindNet with varying receptive fields.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 8: Texture-class correlation. We show samples from each texture cluster. For each cluster, we visualise its top-3 correlated classes in rows.
|
| 348 |
+
|
| 349 |
+
Results are shown in Figure 7. We observe relatively stable biased set performances and decreasing unbiased set performances. The decrease in de-biasing ability is attributed to the violation of the precision condition for $G$ $( \ S 2 . 3 )$ : $1 \times 1$ receptive fields are sufficient to capture any colour bias variations, and de-biasing against models of larger receptive fields will further make $f$ not see the meaningful signal $S$ (cues beyond $1 \times 1$ -expressible colours). In the extreme case, when $F =$ LeNet is trained to be independent against itself $G = { \mathrm { L e N e t } }$ , the de-biasing performance drops significantly.
|
| 350 |
+
|
| 351 |
+
# F TEXTURE CLUSTERING
|
| 352 |
+
|
| 353 |
+
In our ImageNet experiments (§4.3), we obtained proxy ground truths for the local pattern bias using texture clustering. We extract texture information from images by clustering the gram matrices of low-layer feature maps as done in standard texturisation methods (Gatys et al., 2015; Johnson et al., 2016); we use feature maps from layer relu1 2 of a pre-trained VGG16 (Simonyan & Zisserman, 2014). As we intend to evaluate whether a given model is biased towards local pattern cues, we only utilise features from the lower layer encoding lower layer features like edges and colours rather than high-level semantics. Figure 8 shows that each cluster effectively captures similar local patterns across different classes. For each cluster, we visualise its top-3 correlated classes. We can see that certain classes share a common texture: cat, monkey, and dog share a “face”-like texture. If a certain class is biased towards a particular texture during training, a model can take the shortcut to utilise texture cues for recognising the target class, leading to a sub-optimal cross-bias generalisation to unusual class-texture combinations (e.g. crab on grass).
|
| 354 |
+
|
| 355 |
+

|
| 356 |
+
Figure 9: More clustering samples. Extended version of Figure 8.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
Figure 10: Data and model bias. Rows correspond to image labels and columns correspond to texture clusters. Cells are colour-coded according to the population of samples of corresponding texture-class pair. In each cell, ResNet18 and REBI $^ \prime \mathrm { ~ S ~ }$ accuracies are shown in pairs.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 11: Learning curve. De-biased ImageNet accuracies of vanilla $\mathtt { R e s N e t } 5 0$ and REBI’S trained against BagNet50.
|
| 363 |
+
|
| 364 |
+
# G BIAS IN DATA AND MODELS
|
| 365 |
+
|
| 366 |
+
We study the bias in the 9-class ImageNet data and the models trained on them (§4.3). Figure 10 shows the statistics of texture biases in data and the model biases that result from them. To measure the dataset bias, we empirically observe correlations between texture and target classes by counting the number of samples for each texture-class pair $( c , y )$ (denoted “population” $\mathrm { P o p } ( c , y )$ in the main paper). We observe indeed that there does exist a strong correlation between texture clusters and class labels. We say that a class has a dominant texture cluster if the largest cluster for the class contains more than half of the class samples. 6 out of 9 classes considered has the dominant texture cluster: (“Dog”, “Dog”), (“Cat”, “Face”), (“Monkey”, “Mammal”), (“Frog”, “Spotted”), (“Crab”, “Shell”) and (“Insect”, “Close-up”).
|
| 367 |
+
|
| 368 |
+
Figure 10 further shows the accuracies of the baseline ResNet18 and $\mathrm { R E B I ^ { \prime } } \mathrm { S }$ to indicate the presence of bias in the models, and how REBI’S overcomes the bias despite the bias in data itself. We measure the average of accuracies in classes with dominant texture clusters (biased classes) and the average in less biased classes. We observe that ResNet18 shows higher accuracy on biased classes $( \bar { 8 9 } . 4 \% )$ than on less biased classes (83.9), signifying its bias towards texture. On the other hand, REBI’S achieves similar accuracies $8 8 . 7 \%$ (biased classes) and $8 8 . 2 \%$ (unbiased classes). We stress that REBI $^ \prime \mathrm { ~ S ~ }$ overcomes the bias even if the training data itself is biased.
|
| 369 |
+
|
| 370 |
+
# H LEARNING CURVES ON IMAGENET
|
| 371 |
+
|
| 372 |
+
We visualise the learning curves for the baseline vanilla ResNet50 and REBI’S trained ResNet50 against BagNet50 in Figure 11. We observe that REBI’S gradually de-biases a representation beyond the baseline model.
|
md/train/SJfWKsC5K7/SJfWKsC5K7.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EXPLAINING NEURAL NETWORKS SEMANTICALLY AND QUANTITATIVELY
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper presents a method to explain the knowledge encoded in a convolutional neural network (CNN) quantitatively and semantically. The analysis of the specific rationale of each prediction made by the CNN presents a key issue of understanding neural networks, but it is also of significant practical values in certain applications. In this study, we propose to distill knowledge from the CNN into an explainable additive model, so that we can use the explainable model to provide a quantitative explanation for the CNN prediction. We analyze the typical bias-interpreting problem of the explainable model and develop prior losses to guide the learning of the explainable additive model. Experimental results have demonstrated the effectiveness of our method.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Convolutional neural networks (CNNs) (LeCun et al., 1998; Krizhevsky et al., 2012; He et al., 2016) have achieved superior performance in various tasks, such as object classification and detection. Besides the discrimination power of neural networks, the interpretability of neural networks has received an increasing attention in recent years.
|
| 12 |
+
|
| 13 |
+
In this paper, we focus on a new problem, i.e. explaining the specific rationale of each network prediction semantically and quantitatively. “Semantic explanations” and “quantitative explanations” are two core issues of understanding neural networks.
|
| 14 |
+
|
| 15 |
+
1. Semantic explanations: We hope to explain the logic of each network prediction using clear visual concepts, instead of using middle-layer features without clear meanings or simply extracting pixel-level correlations between network inputs and outputs. We believe that semantic explanations may satisfy specific demands in real applications.
|
| 16 |
+
|
| 17 |
+
2. Quantitative explanations: In contrast to traditional qualitative explanations for neural networks, quantitative explanations enable people to diagnose feature representations inside neural networks and help neural networks earn trust from people. We expect the neural network to provide the quantitative rationale of the prediction, i.e. clarifying which visual concepts activate the neural network and how much they contribute to the prediction score.
|
| 18 |
+
|
| 19 |
+
Above two requirements present significant challenges to state-of-the-art algorithms. To the best of our knowledge, no previous studies simultaneously explained network predictions using clear visual concepts and quantitatively decomposed the prediction score into value components of these visual concepts.
|
| 20 |
+
|
| 21 |
+
Task: Therefore, in this study, we propose to learn another neural network, namely an explainer network, to explain CNN predictions. Accordingly, we can call the target CNN a performer network. Besides the performer, we also require a set of models that are pre-trained to detect different visual concepts. These visual concepts will be used to explain the logic of the performer’s prediction. We are also given input images of the performer, but we do not need any additional annotations on the images. Then, the explainer is learned to mimic the logic inside the performer, i.e. the explainer receives the same features as the performer and is expected to generate similar prediction scores.
|
| 22 |
+
|
| 23 |
+
As shown in Fig. 1, the explainer uses pre-trained visual concepts to explain each prediction. The explainer is designed as an additive model, which decomposes the prediction score into the sum of multiple value components. Each value component is computed based on a specific visual concept. In this way, we can roughly consider these value components as quantitative contributions of the visual concepts to the final prediction score.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Explainer. We distill knowledge of a performer into an explainer as a paraphrase of the performer’s representations. The explainer decomposes the prediction score into value components of semantic concepts, thereby obtaining quantitative semantic explanations for the performer.
|
| 27 |
+
|
| 28 |
+
More specifically, we learn the explainer via knowledge distillation. Note that we do not use any ground-truth annotations on input images to supervise the explainer. It is because the task of the explainer is not to achieve a high prediction accuracy, but to mimic the performer’s logic in prediction, no matter whether the performer’s prediction is correct or not.
|
| 29 |
+
|
| 30 |
+
Thus, the explainer can be regarded as a semantic paraphrase of feature representations inside the performer, and we can use the explainer to understand the logic of the performer’s prediction. Theoretically, the explainer usually cannot recover the exact prediction score of the performer, owing to the limit of the representation capacity of visual concepts. The difference of the prediction score between the performer and the explainer corresponds to the information that cannot be explained by the visual concepts.
|
| 31 |
+
|
| 32 |
+
Challenges: Distilling knowledge from a pre-trained neural network into an additive model usually suffers from the problem of bias-interpreting. When we use a large number of visual concepts to explain the logic inside the performer, the explainer may biasedly select very few visual concepts, instead of all visual concepts, as the rationale of the prediction (Fig. 4 in the appendix visualizes the bias-interpreting problem). Just like the typical over-fitting problem, theoretically, the bias interpreting is an ill-defined problem. To overcome this problem, we propose two types of losses for prior weights of visual concepts to guide the learning process. The prior weights push the explainer to compute a similar Jacobian of the prediction score w.r.t. visual concepts as the performer in early epochs, in order to avoid bias-interpreting.
|
| 33 |
+
|
| 34 |
+
Originality: Our “semantic-level” explanation for CNN predictions has essential differences from traditional studies of “pixel-level” interpreting neural networks, such as the visualization of features in neural networks (Zeiler & Fergus, 2014; Mahendran & Vedaldi, 2015; Simonyan et al., 2013; Dosovitskiy & Brox, 2016; Fong & Vedaldi, 2017; Selvaraju et al., 2017), the extraction of pixellevel correlations between network inputs and outputs (Koh & Liang, 2017; Ribeiro et al., 2016; Lundberg & Lee, 2017), and the learning of neural networks with interpretable middle-layer features (Zhang et al., 2018b; Sabour et al., 2017).
|
| 35 |
+
|
| 36 |
+
In particular, the explainer explains the performer without affecting the original discrimination power of the performer. As discussed in (Bau et al., 2017), the interpretability of features is not equivalent to, and usually even conflicts with the discrimination power of features. Compared to forcing the performer to learn interpretable features, our strategy of explaining the performer solves the dilemma between the interpretability and the discriminability. In addition, our quantitative explanation has special values beyond the qualitative analysis of CNN predictions (Zhang et al., 2018c).
|
| 37 |
+
|
| 38 |
+
Potential values of the explainer: Quantitatively and semantically explaining a performer is of considerable practical values when the performer needs to earn trust from people in critical applications. As mentioned in (Zhang et al., 2018a), owing to the potential bias in datasets and feature representations, a high testing accuracy still cannot fully ensure correct feature representations in neural networks. Thus, semantically and quantitatively clarifying the logic of each network prediction is a direct way to diagnose feature representations of neural networks. Fig. 3 shows example explanations for the performer’s predictions. Predictions whose explanations conflict people’s common sense may reflect problematic feature representations inside the performer.
|
| 39 |
+
|
| 40 |
+
Contributions of this study are summarized as follows. (i) In this study, we focus on a new task, i.e. semantically and quantitatively explaining CNN predictions. (ii) We propose a new method to explain neural networks, i.e. distilling knowledge from a pre-trained performer into an interpretable additive explainer. Our strategy of using the explainer to explain the performer avoids hurting the discrimination power of the performer. (iii) We develop novel losses to overcome the typical biasinterpreting problem. Preliminary experimental results have demonstrated the effectiveness of the proposed method. (iv) Theoretically, the proposed method is a generic solution to the problem of interpreting neural networks. We have applied our method to different benchmark CNNs for different applications, which has proved the broad applicability of our method.
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
In this paper, we limit our discussion within the scope of understanding feature representations of neural networks.
|
| 45 |
+
|
| 46 |
+
Network visualization: The visualization of feature representations inside a neural network is the most direct way of opening the black-box of the neural network. Related techniques include gradient-based visualization (Zeiler & Fergus, 2014; Mahendran & Vedaldi, 2015; Simonyan et al., 2013; Yosinski et al., 2015) and up-convolutional nets (Dosovitskiy & Brox, 2016) to invert feature maps of conv-layers into images. However, recent visualization results with clear semantic meanings were usually generated with strict constraints. These constraints made visualization results biased towards people’s preferences. Subjectively visualizing all information of a filter usually produced chaotic results. Thus, there is still a considerable gap between network visualization and semantic explanations for neural networks.
|
| 47 |
+
|
| 48 |
+
Network diagnosis: Some studies diagnose feature representations inside a neural network. (Yosinski et al., 2014) measured features transferability in intermediate layers of a neural network. (Aubry & Russell, 2015) visualized feature distributions of different categories in the feature space. (Ribeiro et al., 2016; Lundberg & Lee, 2017; Kindermans et al., 2018; Fong & Vedaldi, 2017; Selvaraju et al., 2017) extracted rough pixel-level correlations between network inputs and outputs, i.e. estimating image regions that directly contribute the network output. Network-attack methods (Koh & Liang, 2017; Szegedy et al., 2014) computed adversarial samples to diagnose a CNN. (Lakkaraju et al., 2017) discovered knowledge blind spots of a CNN in a weakly-supervised manner. (Zhang et al., 2018a) examined representations of conv-layers and automatically discover biased representations of a CNN due to the dataset bias. However, above methods usually analyzed a neural network at the pixel level and did not summarize the network knowledge into clear visual concepts.
|
| 49 |
+
|
| 50 |
+
(Bau et al., 2017) defined six types of semantics for CNN filters, i.e. objects, parts, scenes, textures, materials, and colors. Then, (Zhou et al., 2015) proposed a method to compute the image-resolution receptive field of neural activations in a feature map. Other studies retrieved middle-layer features from CNNs representing clear concepts. (Simon & Rodner, 2015) retrieved features to describe objects from feature maps, respectively. (Zhou et al., 2015; 2016) selected neural units to describe scenes. Note that strictly speaking, each CNN filter usually represents a mixture of multiple semantic concepts. Unlike previous studies, we are more interested in analyzing the quantitative contribution of each semantic concept to each prediction, which was not discussed in previous studies.
|
| 51 |
+
|
| 52 |
+
Learning interpretable representations: A new trend in the scope of network interpretability is to learn interpretable feature representations in neural networks (Hu et al., 2016; Stone et al., 2017; Liao et al., 2016) in an un-/weakly-supervised manner. Capsule nets (Sabour et al., 2017) and interpretable RCNN (Wu et al., 2017b) learned interpretable features in intermediate layers. InfoGAN (Chen et al., 2016) and $\beta$ -VAE (Higgins et al., 2017) learned well-disentangled codes for generative networks. Interpretable CNNs (Zhang et al., 2018b) learned filters in intermediate layers to represent object parts without given part annotations. However, as mentioned in (Bau et al., 2017; Zhang et al., 2018c), interpretable features usually do not have a high discrimination power. Therefore, we use the explainer to interpret the pre-trained performer without hurting the discriminability of the performer.
|
| 53 |
+
|
| 54 |
+
Explaining neural networks via knowledge distillation: Distilling knowledge from a black-box model into an explainable model is an emerging direction in recent years. (Zhang et al., 2018d) used a tree structure to summarize the inaccurate1 rationale of each CNN prediction into generic decision-making models for a number of samples. In contrast, we pursue the explicitly quantitative explanation for each CNN prediction. (Choi et al., 2017) learned an explainable additive model, and (Vaughan et al., 2018) distilled knowledge of a network into an additive model. (Frosst & Hinton, 2017; Tan et al., 2018; Che et al., 2016; Wu et al., 2017a) distilled representations of neural networks into tree structures. These methods did not explain the network knowledge using humaninterpretable semantic concepts. More crucially, compared to previous additive models (Vaughan et al., 2018), our research successfully overcomes the bias-interpreting problem, which is the core challenge when there are lots of visual concepts for explanation.
|
| 55 |
+
|
| 56 |
+
# 3 ALGORITHM
|
| 57 |
+
|
| 58 |
+
In this section, we distill knowledge from a pre-trained performer $f$ to an explainable additive model. We are given a performer $f$ and $n$ neural networks $\{ f _ { i } | i = 1 , 2 , \dots , n \}$ that are pre-trained to detect $n$ different visual concepts. We learn the $n$ neural networks along with the performer, and the $n$ neural networks are expected to share low-layer features with the performer. Our method also requires a set of training samples for the performer $f$ . The goal of the explainer is to use inference values of the $n$ visual concepts to explain prediction scores of the performer. Note that we do not need any annotations on training samples w.r.t. the task, because additional supervision will push the explainer towards a good performance of the task, instead of objectively reflecting the knowledge in the performer.
|
| 59 |
+
|
| 60 |
+
Given an input image $I$ , let ${ \hat { y } } = f ( I )$ denote the output of the performer. Without loss of generality, we assume that $\hat { y }$ is a scalar. If the performer has multiple outputs (e.g. a neural network for multicategory classification), we can learn an explainer to interpret each scalar output of the performer. In particular, when the performer takes a softmax layer as the last layer, we use the feature score before the softmax layer as $\hat { y }$ , so that $\hat { y }$ ’s neighboring scores will not affect the value of $\hat { y }$ .
|
| 61 |
+
|
| 62 |
+
We design the following additive explainer model, which uses a mixture of visual concepts to approximate the function of the performer. The explainer decomposes the prediction score $\hat { y }$ into value components of pre-defined visual concepts.
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l } { \hat { y } \approx \ } & { { } \underset { \mathcal { S } } { \underbrace { \alpha _ { 1 } ( I ) \cdot y _ { 1 } } } + \alpha _ { 2 } ( I ) \cdot y _ { 2 } + \ldots + \alpha _ { n } ( I ) \cdot y _ { n } + b , \quad y _ { i } = f _ { i } ( I ) , \quad i = 1 , 2 , \ldots , n } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
| {z }Quantitative contribution from the first visual concept
|
| 69 |
+
|
| 70 |
+
where $y _ { i }$ and $\alpha _ { i } ( I )$ denote the scalar value and the weight for the $i$ -th visual concept, respectively. $b$ is a bias term. $y _ { i }$ is given as the strength or confidence of the detection of the $i$ -th visual concept. We can regard the value of $\alpha _ { i } ( I ) \cdot y _ { i }$ as the quantitative contribution of the $i$ -th visual concept to the final prediction. In most cases, the explainer cannot recover all information of the performer. The prediction difference between the explainer and the performer reflects the limit of the representation capacity of visual concepts.
|
| 71 |
+
|
| 72 |
+
According to the above equation, the core task of the explainer is to estimate a set of weights $_ { \alpha } =$ $[ \alpha _ { 1 } , \alpha _ { 2 } , \ldots , \alpha _ { n } ]$ , which minimizes the difference of the prediction score between the performer and the explainer. Different input images may obtain different weights $_ { \pmb { \alpha } }$ , which correspond to different decision-making modes of the performer. For example, a performer may mainly use head patterns to classify a standing bird, while it may increase the weight for the wing concept to classify a flying bird. Therefore, we design another neural network $g$ with parameters $\theta _ { g }$ (i.e. the explainer), which uses the input image $I$ to estimate the $n$ weights. We learn the explainer with the following knowledge-distillation loss.
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\pmb { \alpha } = g ( I ) , \qquad L = \| \hat { \boldsymbol y } - \sum _ { i = 1 } ^ { n } \boldsymbol { \alpha } _ { i } \cdot \boldsymbol { y } _ { i } - b \| ^ { 2 }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
However, without any prior knowledge about the distribution of the weight $\alpha _ { i }$ , the learning of $g$ usually suffers from the problem of bias-interpreting. The neural network $g$ may biasedly select very few visual concepts to approximate the performer as a shortcut solution, instead of sophisticatedly learning relationships between the performer output and all visual concepts.
|
| 79 |
+
|
| 80 |
+
Thus, to overcome the bias-interpreting problem, we use a loss $\mathcal { L }$ for priors of $_ { \pmb { \alpha } }$ to guide the learning process in early epochs.
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname* { m i n } _ { \theta _ { g } , b } L o s s , \quad \quad L o s s = L + \lambda ( t ) \cdot \mathcal { L } ( \alpha , \mathbf { w } ) , \quad \quad \mathrm { s . t . } \operatorname* { l i m } _ { t \to \infty } \lambda ( t ) = 0
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Two typical types of neural networks. (left) A performer models interpretable visual concepts in its intermediate layers. For example, each filter in a certain conv-layer represents a specific visual concept. (right) The performer and visual concepts are jointly learned, and they share features in intermediate layers.
|
| 88 |
+
|
| 89 |
+
where w denotes prior weights, which represent a rough relationship between the performer’s prediction value and $n$ visual concepts. Just like $_ { \pmb { \alpha } }$ , different input images also have different prior weights w. The loss $\mathcal { L } ( \alpha , \mathbf { w } )$ penalizes the dissimilarity between $_ { \pmb { \alpha } }$ and w.
|
| 90 |
+
|
| 91 |
+
Note that the prior weights w are approximated with strong assumptions (we will introduce two different ways of computing w later). We use inaccurate w to avoid significant bias-interpreting, rather than pursue a high accuracy. Thus, we set a decreasing weight for $\mathcal { L }$ , i.e. $\begin{array} { r } { \lambda ( t ) = \frac { \beta } { \sqrt { t } } } \end{array}$ , where $\beta$ is a scalar constant, and $t$ denotes the epoch number. In this way, we mainly apply the prior loss $\mathcal { L }$ in early epochs. Then, in late epochs, the influence of $\mathcal { L }$ gradually decreases, and our method gradually shifts its attention to the distillation loss for a high distillation accuracy.
|
| 92 |
+
|
| 93 |
+
We design two types of losses for prior weights, as follows.
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal { L } ( \alpha , \mathbf { w } ) = \left\{ \begin{array} { l l } { c r o s s { E n t r o p y } \big ( \frac { \alpha } { \lVert \alpha \rVert _ { 1 } } , \frac { \mathbf { w } } { \lVert \mathbf { w } \rVert _ { 1 } } \big ) , } & { \forall i , \alpha _ { i } , w _ { i } \ge 0 } \\ { \lVert \frac { \alpha } { \lVert \alpha \rVert _ { 2 } } - \frac { \mathbf { w } } { \lVert \mathbf { w } \rVert _ { 2 } } \lVert _ { 2 } ^ { 2 } , } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Some applications require a positive relationship between the prediction of the performer and each visual concept, i.e. each weight $\alpha _ { i }$ must be a positive scalar. In this case, we use the cross-entropy between $_ { \pmb { \alpha } }$ and $\mathbf { w }$ as the prior loss. In other cases, the MSE loss between $_ { \pmb { \alpha } }$ and $\mathbf { w }$ is used as the loss. $\| \cdot \| _ { 1 }$ and $\| \cdot \| _ { 2 }$ denote the L-1 norm and L-2 norm, respectively.
|
| 100 |
+
|
| 101 |
+
In particular, in order to ensure $\alpha _ { i } \geq 0$ in certain applications, we add a non-linear activation layer as the last layer of $g$ , i.e. $\alpha = \log [ 1 + \exp ( x ) ]$ , where $x$ is the output of the last conv-layer.
|
| 102 |
+
|
| 103 |
+
# 3.1 COMPUTATION OF PRIOR WEIGHTS w
|
| 104 |
+
|
| 105 |
+
In this subsection, we will introduce two techniques to efficiently compute rough prior weights w, which are oriented to the following two cases in application.
|
| 106 |
+
|
| 107 |
+
Case 1, filters in intermediate conv-layers of the performer are interpretable: As shown in Fig. 2(left), learning a neural network with interpretable filters is an emerging research direction in recent years. For example, (Zhang et al., 2018b) proposed a method to learn CNNs for object classification, where each filter in a high conv-layer is exclusively triggered by the appearance of a specific object part (see Fig. 10 in the appendix for the visualization of filters). Thus, we can interpret the classification score of an object as a linear combination of elementary scores for the detection of object parts. Because such interpretable filters are automatically learned without part annotations, the quantitative explanation for the CNN (i.e. the performer) can be divided into the following two tasks: (i) annotating the name of the object part that is represented by each filter, and (ii) learning an explainer to disentangle the exact additive contribution of each filter (or each object part) to the performer output.
|
| 108 |
+
|
| 109 |
+
In this way, each $f _ { i }$ , $i = 1 , 2 , \ldots , n$ , is given as an interpretable filter of the performer. According to (Zhang et al., 2018a), we can roughly represent the network prediction as
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
{ \hat { y } } \approx \sum _ { i } w _ { i } y _ { i } + b , \qquad { \mathrm { s . t . } } \quad { \left\{ \begin{array} { l l } { y _ { i } } & { = \sum _ { h , w } x _ { h w i } } \\ { w _ { i } } & { = { \frac { 1 } { Z } } \sum _ { h , w } { \frac { \partial { \hat { y } } } { \partial x _ { h w i } } } } \end{array} \right. }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\boldsymbol { x } \in \mathbb { R } ^ { H \times W \times n }$ denotes a feature map of the interpretable conv-layer, and $x _ { h w i }$ is referred to as the activation unit in the location $( h , w )$ of the $i$ -th channel. $y _ { i }$ measures the confidence of detecting the object part corresponding to the $i$ -th filter. Here, we can roughly use the Jacobian of the network output w.r.t. the filter to approximate the weight $w _ { i }$ of the filter. $Z$ is for normalization. Considering that the normalization operation in Equation (4) eliminates Z, we can directly use Ph,w ∂yˆ∂xhwi as prior weights w in Equation (4) without a need to compute the exact value of .
|
| 116 |
+
|
| 117 |
+
Case 2, neural networks for visual concepts share features in intermediate layers with the performer: As shown in Fig. 2(right), given a neural network for the detection of multiple visual concepts, using certain visual concepts to explain a new visual concept is a generic way to interpret network predictions with broad applicability. Let us take the detection of a certain visual concept as the target $\hat { y }$ and use other visual concepts as $\{ y _ { i } \}$ to explain $\hat { y }$ . All visual concepts share features in intermediate layers.
|
| 118 |
+
|
| 119 |
+
Then, we estimate a rough numerical relationship between $\hat { y }$ and the score of each visual concept $y _ { i }$ . Let $x$ be a middle-layer feature shared by both the target and the $i$ -th visual concept. When we modify the feature $x$ , we can represent the value change of $y _ { i }$ using a Taylor series, $\Delta y _ { i } =$ $\begin{array} { r } { \frac { \partial y _ { i } } { \partial x } \otimes \Delta x + O ( \Delta ^ { 2 } x ) } \end{array}$ , where $\otimes$ denotes the convolution operation. Thus, when we push the feature ∂x towards the direction of boosting $y _ { i }$ , i.e. $\Delta x = \epsilon \frac { \partial y _ { i } } { \partial x }$ $\epsilon$ is a small constant), the change of the $i$ -th visual concept can be approximated as $\Delta y _ { i } = \epsilon \| \frac { \partial y _ { i } } { \partial x } \| _ { F } ^ { 2 }$ , where $\| \cdot \| _ { F }$ denotes the Frobenius norm. Meanwhile, ∆x also affects the target concept by ∆ˆy = ∂yˆ∂x ∂yi∂x . Thus, we can roughly estimate the weight as wi = ∆ˆy∆yi .
|
| 120 |
+
|
| 121 |
+
# 4 EXPERIMENTS
|
| 122 |
+
|
| 123 |
+
We designed two experiments to use our explainers to interpret different benchmark CNNs oriented to two different applications, in order to demonstrate the broad applicability of our method. In the first experiment, we used the detection of object parts to explain the detection of the entire object. In the second experiment, we used various face attributes to explain the prediction of another face attribute. We evaluated explanations obtained by our method qualitatively and quantitatively.
|
| 124 |
+
|
| 125 |
+
# 4.1 EXPERIMENT 1: USING OBJECT PARTS TO EXPLAIN OBJECT CLASSIFICATION
|
| 126 |
+
|
| 127 |
+
In this experiment, we used the method proposed in (Zhang et al., 2018b) to learn a CNN, where each filter in the top conv-layer represents a specific object part. We followed exact experimental settings in (Zhang et al., 2018b), which used the Pascal-Part dataset (Chen et al., 2014) to learn six CNNs for the six animal2 categories in the dataset. Each CNN was learned to classify the target animal from random images. We considered each CNN as a performer and regarded its interpretable filters in the top conv-layer as visual concepts to interpret the classification score.
|
| 128 |
+
|
| 129 |
+
Four types of CNNs as performers: Following experimental settings in (Zhang et al., 2018b), we applied our method to four types of CNNs, including the AlexNet (Krizhevsky et al., 2012), the VGG-M, VGG-S, and VGG-16 networks (Simonyan & Zisserman, 2015), i.e. we learned CNNs for six categories based on each network structure. Note that as discussed in (Zhang et al., 2018b), skip connections in residual networks (He et al., 2016) increased the difficulty of learning part features, so they did not learn interpretable filters in residual networks.
|
| 130 |
+
|
| 131 |
+
Learning the explainer: The AlexNet/VGG-M/VGG-S/VGG-16 performer had 256/512/512/512 filters in its top conv-layer, so we set $n = 2 5 6$ , 512, 512, 512 for these networks. We used the masked output of the top conv-layer as $x$ and plugged $x$ to Equation (5) to compute $\{ y _ { i } \} ^ { 1 }$ . We used the 152- layer ResNet (He et al., $2 0 1 6 ) ^ { 3 }$ as $g$ to estimate weights of visual concepts4. We set $\beta = 1 0$ for the learning of all explainers. Note that all interpretable filters in the performer represented object parts of the target category on positive images, instead of describing random (negative) images.
|
| 132 |
+
|
| 133 |
+
Table 1: Entropy of contribution distributions estimated by the explainer. A lower entropy of contribution distributions reflects more significant bias-interpreting. Our method suffered much less from the bias-interpreting problem than the baseline. Please see the appendix for more results.
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan="2"></td><td colspan="4">Experiment1</td><td colspan="5">Experiment 2</td></tr><tr><td>AlexNet</td><td>VGG-M</td><td>VGG-S</td><td>VGG-16</td><td>attractive</td><td>makeup</td><td>male</td><td>young</td><td>Avg.</td></tr><tr><td>Baseline</td><td>3.636</td><td>4.957</td><td>3.962</td><td>4.218</td><td>3.185</td><td>3.120</td><td>3.139</td><td>3.100</td><td>3.136</td></tr><tr><td>Ours</td><td>5.199</td><td>5.908</td><td>5.913</td><td>6.054</td><td>3.216</td><td>3.134</td><td>3.139</td><td>3.160</td><td>3.162</td></tr></table>
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="4">Experiment 1</td><td colspan="5">Experiment 2</td></tr><tr><td>AlexNet</td><td>VGG-M</td><td>VGG-S</td><td>VGG-16</td><td>attractive</td><td>makeup</td><td>male</td><td>young</td><td>Avg.</td></tr><tr><td>Classification</td><td>Performer</td><td>93.9</td><td>94.2</td><td>95.5</td><td>95.4</td><td>81.5</td><td>92.3</td><td>98.7</td><td>88.3</td><td>90.2</td></tr><tr><td>accuracy</td><td>Explainer</td><td>93.6</td><td>94.0</td><td>94.9</td><td>96.6</td><td>76.0</td><td>88.8</td><td>97.6</td><td>82.8</td><td>87.1</td></tr><tr><td>Relative</td><td>Performer</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>deviation</td><td>Explainer</td><td>0.045</td><td>0.040</td><td>0.041</td><td>0.038</td><td>0.163</td><td>0.100</td><td>0.067</td><td>0.139</td><td>0.117</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 2: Classification accuracy and relative deviations of the explainer and the performer. We used relative deviations and the decrease of the classification accuracy to measure the information that could not be explained by pre-defined visual concepts. Please see the appendix for more results.
|
| 140 |
+
|
| 141 |
+
Intuitively, we needed to ensure a positive relationship between $\hat { y }$ and $y _ { i }$ . Thus, we filtered out negative prior weights $w _ { i } \gets \operatorname* { m a x } \{ w _ { i } , 0 \}$ and applied the cross-entropy loss in Equation (4) to learn the explainer.
|
| 142 |
+
|
| 143 |
+
Evaluation metric: The evaluation has two aspects. Firstly, we evaluated the correctness of the estimated explanation for the performer prediction. In fact, there is no ground truth about exact reasons for each prediction. We showed example explanations of for a qualitative evaluation of explanations. We also used grad-CAM visualization (Selvaraju et al., 2017) of feature maps to prove the correctness of our explanations (see the appendix). In addition, we normalized the absolute contribution from each visual concept as a distribution of contributions $c _ { i } = | \alpha _ { i } y _ { i } | / \sum _ { j } | \alpha _ { j } y _ { j } |$ . We used the entropy of contribution distribution $H ( \mathbf { c } )$ as an indirect evaluation metric for biasinterpreting. A biased explainer usually used very few visual concepts, instead of using most visual concepts, to approximate the performer, which led to a low entropy $H ( \mathbf { c } )$ .
|
| 144 |
+
|
| 145 |
+
Secondly, we also measured the performer information that could not be represented by the visual concepts, which was unavoidable. We proposed two metrics for evaluation. The first metric is the prediction accuracy. We compared the prediction accuracy of the performer with the prediction accuracy of using the explainer’s output $\sum _ { i } ^ { - } \alpha _ { i } y _ { i } + b$ . Another metric is the relative deviation, which measures a normalized output difference between the performer and the explainer. The relative deviation of the image $I$ is normalized as $\begin{array} { r } { \vert \hat { y } _ { I } - \sum _ { i } \bar { \alpha _ { I , i } } y _ { I , i } - b \vert / \big ( \mathrm { { m a x } } _ { I ^ { \prime } \in \mathbf { I } } \hat { y } _ { I ^ { \prime } } - \mathrm { { m i n } } _ { I ^ { \prime } \in \mathbf { I } } \hat { y } _ { I ^ { \prime } } \big ) } \end{array}$ , where $\hat { y } _ { I ^ { \prime } }$ denotes the performer’s output for the image $I ^ { \prime }$ .
|
| 146 |
+
|
| 147 |
+
Considering the limited representation power of visual concepts, the relative deviation on an image reflected inference patterns, which were not modeled by the explainer. The average relative deviation over all images was reported to evaluate the overall representation power of visual concepts. Note that our objective was not to pursue an extremely low relative deviation, because the limit of the representation power is an objective existence.
|
| 148 |
+
|
| 149 |
+
# 4.2 EXPERIMENT 2: EXPLAINING FACE ATTRIBUTES BASED ON FACE ATTRIBUTES
|
| 150 |
+
|
| 151 |
+
In this experiment, we learned a CNN based on the VGG-16 structure to estimate face attributes. We used the Large-scale CelebFaces Attributes (CelebA) dataset (Liu et al., 2015) to train a CNN to estimate 40 face attributes. We selected a certain attribute as the target and used its prediction score as $\hat { y }$ . Other 39 attributes were taken as visual concepts to explain the score of $\hat { y }$ $\left( n = 3 9 \right.$ ). The target attribute was selected from those representing global features of the face, i.e. attractive, heavy makeup, male, and young. It is because global features can usually be described by local visual concepts, but the inverse is not. We learned an explainer for each target attribute. We used the same 152-layer ResNet structure as in Experiment 1 (expect for $n = 3 9$ ) as $g$ to estimate weights. We followed the Case-2 implementation in Section 3.1 to compute prior weights $\mathbf { w }$ , in which we used the 4096-dimensional output of the first fully-connected layer as the shared feature $x$ . We set $\beta = 0 . 2$ and used the L-2 norm loss in Equation (4) to learn all explainers. We used the same evaluation metric as in Experiment 1.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Quantitative explanations for the object classification (top) and the face-attribution prediction (bottom) made by performers. For performers oriented to object classification, we annotated the part that was represented by each interpretable filter in the performer, and we assigned contributions of filters $\alpha _ { i } y _ { i }$ to object parts (see the appendix). Thus, this figure illustrates contributions of different object parts. All object parts made positive contributions to the classification score. Note that in the bottom, bars indicate elementary contributions $\alpha _ { i } y _ { i }$ from features of different face attributes, rather than prediction values $y _ { i }$ of these attributes. For example, the network predicts a negative goatee attribute $y _ { \mathrm { g o a t e e } } < 0$ , and this information makes a positive contribution to the target attractive attribute, $\alpha _ { i } y _ { i } > 0$ . Please see the appendix for more results.
|
| 155 |
+
|
| 156 |
+
# 4.3 EXPERIMENTAL RESULTS AND ANALYSIS
|
| 157 |
+
|
| 158 |
+
We compared our method with the traditional baseline of only using the distillation loss to learn the explainer. Table 1 evaluates bias-interpreting of explainers that were learned using our method and the baseline. In addition, Table 2 uses the classification accuracy and relative deviations of the explainer to measure the representation capacity of visual concepts. Our method suffered much less from the bias-interpreting problem than the baseline.
|
| 159 |
+
|
| 160 |
+
Fig. 3 shows examples of quantitative explanations for the prediction made by the performer. We also used the grad-CAM visualization (Selvaraju et al., 2017) of feature maps of the performer to demonstrate the correctness of our explanations in Fig. 9 in the appendix. In particular, Fig. 4 in the appendix illustrates the distribution of contributions of visual concepts $\left\{ c _ { i } \right\}$ when we learned the explainer using different methods. Compared to our method, the distillation baseline usually used very few visual concepts for explanation and ignored most strongly activated interpretable filters, which could be considered as bias-interpreting.
|
| 161 |
+
|
| 162 |
+
# 5 CONCLUSION AND DISCUSSIONS
|
| 163 |
+
|
| 164 |
+
In this paper, we focus on a new task, i.e. explaining the logic of each CNN prediction semantically and quantitatively, which presents considerable challenges in the scope of understanding neural networks. We propose to distill knowledge from a pre-trained performer into an interpretable additive explainer. We can consider that the performer and the explainer encode similar knowledge. The additive explainer decomposes the prediction score of the performer into value components from semantic visual concepts, in order to compute quantitative contributions of different concepts. The strategy of using an explainer for explanation avoids decreasing the discrimination power of the performer. In preliminary experiments, we have applied our method to different benchmark CNN performers to prove the broad applicability.
|
| 165 |
+
|
| 166 |
+
Note that our objective is not to use pre-trained visual concepts to achieve super accuracy in classification/prediction. Instead, the explainer uses these visual concepts to mimic the logic of the performer and produces similar prediction scores as the performer.
|
| 167 |
+
|
| 168 |
+
In particular, over-interpreting is the biggest challenge of using an additive explainer to interpret another neural network. In this study, we design two losses to overcome the bias-interpreting problems. Besides, in experiments, we also measure the amount of the performer knowledge that could not be represented by visual concepts in the explainer.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Mathieu Aubry and Bryan C. Russell. Understanding deep features with computer-generated imagery. In ICCV, 2015.
|
| 173 |
+
|
| 174 |
+
David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In CVPR, 2017.
|
| 175 |
+
|
| 176 |
+
Zhengping Che, Sanjay Purushotham, Robinder Khemani, and Yan Liu. Interpretable deep models for icu outcome prediction. In American Medical Informatics Association (AMIA) Annual Symposium, 2016.
|
| 177 |
+
|
| 178 |
+
X. Chen, R. Mottaghi, X. Liu, S. Fidler, R. Urtasun, and A. Yuille. Detect what you can: Detecting and representing objects using holistic models and body parts. In CVPR, 2014.
|
| 179 |
+
|
| 180 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2016.
|
| 181 |
+
|
| 182 |
+
Edward Choi, Mohammad Taha Bahadori, Joshua A. Kulas, Andy Schuetz, Walter F. Stewart, and Jimeng Sun. Retain: an interpretable predictive model for healthcare using reverse time attention mechansim. in arXiv:1608.05745v4, 2017.
|
| 183 |
+
|
| 184 |
+
Alexey Dosovitskiy and Thomas Brox. Inverting visual representations with convolutional networks. In CVPR, 2016.
|
| 185 |
+
|
| 186 |
+
Ruth C. Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. In arXiv:1704.03296v1, 2017.
|
| 187 |
+
|
| 188 |
+
Nicholas Frosst and Geoffrey Hinton. Distilling a neural network into a soft decision tree. In arXiv:1711.09784, 2017.
|
| 189 |
+
|
| 190 |
+
Tommaso Furlanello, Zachary C. Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born again neural networks. In arXiv:1805.04770, 2018.
|
| 191 |
+
|
| 192 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 193 |
+
|
| 194 |
+
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 ICLR, 2017.
|
| 195 |
+
|
| 196 |
+
Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric P. Xing. Harnessing deep neural networks with logic rules. In arXiv:1603.06318v2, 2016.
|
| 197 |
+
|
| 198 |
+
Pieter-Jan Kindermans, Kristof T. Schutt, Maximilian Alber, Klaus-Robert M ¨ uller, Dumitru Erhan, Been Kim,¨ and Sven Dahne. Learning how to explain neural networks: Patternnet and patternattribution. ¨ In ICLR, 2018.
|
| 199 |
+
|
| 200 |
+
PangWei Koh and Percy Liang. Understanding black-box predictions via influence functions. In ICML, 2017.
|
| 201 |
+
|
| 202 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
|
| 203 |
+
|
| 204 |
+
Himabindu Lakkaraju, Ece Kamar, Rich Caruana, and Eric Horvitz. Identifying unknown unknowns in the open world: Representations and policies for guided exploration. In AAAI, 2017.
|
| 205 |
+
|
| 206 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document \` recognition. In Proceedings of the IEEE, 1998.
|
| 207 |
+
|
| 208 |
+
Renjie Liao, Alex Schwing, Richard Zemel, and Raquel Urtasun. Learning deep parsimonious representations. In NIPS, 2016.
|
| 209 |
+
|
| 210 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In ICCV, 2015.
|
| 211 |
+
|
| 212 |
+
Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In NIPS, 2017.
|
| 213 |
+
|
| 214 |
+
Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In CVPR, 2015.
|
| 215 |
+
|
| 216 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. “why should i trust you?” explaining the predictions of any classifier. In KDD, 2016.
|
| 217 |
+
|
| 218 |
+
Sara Sabour, Nicholas Frosst, and Geoffrey E. Hinton. Dynamic routing between capsules. In NIPS, 2017.
|
| 219 |
+
Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV, 2017.
|
| 220 |
+
Marcel Simon and Erik Rodner. Neural activation constellations: Unsupervised part model discovery with convolutional networks. In ICCV, 2015.
|
| 221 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 222 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: visualising image classification models and saliency maps. In arXiv:1312.6034, 2013.
|
| 223 |
+
Austin Stone, Huayan Wang, Yi Liu, D. Scott Phoenix, and Dileep George. Teaching compositionality to cnns. In CVPR, 2017.
|
| 224 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In arXiv:1312.6199v4, 2014.
|
| 225 |
+
Sarah Tan, Rich Caruana, Giles Hooker, and Albert Gordo. Transparent model distillation. In arXiv:1801.08640, 2018.
|
| 226 |
+
Joel Vaughan, Agus Sudjianto, Erind Brahimi, Jie Chen, and Vijayan N. Nair. Explainable neural networks based on additive index models. in arXiv:1806.01933, 2018.
|
| 227 |
+
Mike Wu, Michael C. Hughes, Sonali Parbhoo, Maurizio Zazzi, Volker Roth, and Finale Doshi-Velez. Beyond sparsity: Tree regularization of deep models for interpretability. In NIPS TIML Workshop, 2017a.
|
| 228 |
+
Tianfu Wu, Xilai Li, Xi Song, Wei Sun, Liang Dong, and Bo Li. Interpretable r-cnn. In arXiv:1711.05226, 2017b.
|
| 229 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In NIPS, 2014.
|
| 230 |
+
Jason Yosinski, Jeff Clune, Anh Nguyen, Thomas Fuchs, and Hod Lipson. Understanding neural networks through deep visualization. In ICML Deep Learning Workshop, 2015.
|
| 231 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In ECCV, 2014.
|
| 232 |
+
Q. Zhang, W. Wang, and S.-C. Zhu. Examining cnn representations with respect to dataset bias. In AAAI, 2018a.
|
| 233 |
+
Quanshi Zhang, Ying Nian Wu, and Song-Chun Zhu. Interpretable convolutional neural networks. In CVPR, 2018b.
|
| 234 |
+
Quanshi Zhang, Yu Yang, Yuchen Liu, Ying Nian Wu, and Song-Chun Zhu. Unsupervised learning of neural networks to explain neural networks. in arXiv:1805.07468, 2018c.
|
| 235 |
+
Quanshi Zhang, Yu Yang, Ying Nian Wu, and Song-Chun Zhu. Interpreting cnns via decision trees. In arXiv:1802.00121, 2018d.
|
| 236 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Object detectors emerge in deep scene cnns. In ICRL, 2015.
|
| 237 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016.
|
| 238 |
+
|
| 239 |
+
# DETAILED RESULTS
|
| 240 |
+
|
| 241 |
+
Table 3: Entropy of contribution distributions. The entropy of contribution distributions reflects the level of bias-interpreting. The lower entropy indicates a larger bias. Our method suffered much less from the bias-interpreting problem than the baseline.
|
| 242 |
+
|
| 243 |
+
<table><tr><td></td><td colspan="2">AlexNet</td><td colspan="2">VGG-M</td><td colspan="2">VGG-S</td><td colspan="2">VGG-16</td></tr><tr><td>bird</td><td>Baseline 3.681</td><td>Ours 5.201</td><td>Baseline 4.543</td><td>Ours 5.885</td><td>Baseline 3.988</td><td>Ours 5.870</td><td>Baseline</td><td>Ours</td></tr><tr><td></td><td>3.294</td><td>5.103</td><td>5.604</td><td></td><td>3.954</td><td>5.913</td><td>4.165</td><td>6.040</td></tr><tr><td>cat</td><td></td><td></td><td></td><td>5.902</td><td></td><td></td><td>4.894</td><td>6.056</td></tr><tr><td>Cow</td><td>3.607</td><td>5.236</td><td>4.616</td><td>5.941</td><td>3.786</td><td>5.901</td><td>3.763</td><td>6.084</td></tr><tr><td>dog</td><td>3.774</td><td>5.243</td><td>5.510</td><td>6.023</td><td>4.087</td><td>5.954</td><td>4.570</td><td>6.061</td></tr><tr><td>horse</td><td>3.745 3.716</td><td>5.278 5.135</td><td>4.722 4.747</td><td>5.921 5.773</td><td>3.802</td><td>5.973 5.869</td><td>4.064</td><td>6.060</td></tr><tr><td>sheep</td><td></td><td></td><td></td><td></td><td>4.152</td><td></td><td>3.850</td><td>6.022</td></tr><tr><td>Avg.</td><td>3.636</td><td>5.199</td><td>4.957</td><td>5.908</td><td>3.962</td><td>5.913</td><td>4.218</td><td>6.054</td></tr></table>
|
| 244 |
+
|
| 245 |
+
<table><tr><td rowspan="2"></td><td colspan="3">AlexNet</td><td colspan="3">VGG-M</td><td colspan="3">VGG-S</td><td colspan="3">VGG-16</td></tr><tr><td>Performer</td><td>Baseline</td><td>Ours</td><td>Performer</td><td>Baseline</td><td>Ours</td><td>Performer</td><td>Baseline</td><td>Ours</td><td>PerformerI</td><td>Baseline</td><td>Ours</td></tr><tr><td>bird</td><td>92.8</td><td>92.8</td><td>93.8</td><td>96.8</td><td>97.3</td><td>97.8</td><td>96.5</td><td>97.0</td><td>96.0</td><td>97.3</td><td>98.5</td><td>98.8</td></tr><tr><td>cat</td><td>96.3</td><td>95.7</td><td>95.2</td><td>94.3</td><td>95.7</td><td>95.5</td><td>95.3</td><td>95.5</td><td>96.0</td><td>94.3</td><td>97.0</td><td>97.0</td></tr><tr><td>cow</td><td>93.4</td><td>92.6</td><td>93.4</td><td>95.2</td><td>94.2</td><td>94.7</td><td>94.4</td><td>94.2</td><td>93.7</td><td>91.1</td><td>97.0</td><td>95.4</td></tr><tr><td>dog</td><td>92.5</td><td>92.5</td><td>92.0</td><td>93.8</td><td>94.7</td><td>94.5</td><td>95.3</td><td>95.5</td><td>93.0</td><td>94.5</td><td>95.0</td><td>94.5</td></tr><tr><td>horse</td><td>91.4</td><td>89.1</td><td>88.1</td><td>92.9</td><td>88.9</td><td>88.9</td><td>92.9</td><td>91.7</td><td>92.7</td><td>99.2</td><td>96.5</td><td>97.7</td></tr><tr><td>sheep</td><td>97.2</td><td>97.2</td><td>99.2</td><td>92.2</td><td>92.7</td><td>92.5</td><td>98.5</td><td>97.0</td><td>98.2</td><td>96.0</td><td>95.7</td><td>96.0</td></tr><tr><td>Average</td><td>93.9</td><td>93.3</td><td>93.6</td><td>94.2</td><td>93.9</td><td>94.0</td><td>95.5</td><td>95.2</td><td>94.9</td><td>95.4</td><td>96.6</td><td>96.6</td></tr></table>
|
| 246 |
+
|
| 247 |
+
<table><tr><td></td><td>Attractive</td><td>Makeup</td><td>Male</td><td>Young</td><td>Avg.</td></tr><tr><td>Performer</td><td>81.5</td><td>92.3</td><td>98.7</td><td>88.3</td><td>90.2</td></tr><tr><td>Explainer, baseline</td><td>73.2</td><td>89.0</td><td>97.6</td><td>81.8</td><td>85.4</td></tr><tr><td>Explainer, ours</td><td>76.0</td><td>88.8</td><td>97.6</td><td>82.8</td><td>86.3</td></tr></table>
|
| 248 |
+
|
| 249 |
+
Table 4: Classification accuracy of the explainer and the performer. We use the the classification accuracy to measure the information loss when using an explainer to interpret the performer. Note that the additional loss for bias-interpreting successfully overcame the bias-interpreting problem, but did not decrease the classification accuracy of the explainer. Another interesting finding of this research is that sometimes, the explainer even outperformed the performer in classification. A similar phenomenon has been reported in (Furlanello et al., 2018). A possible explanation for this phenomenon is given as follows. When the student network in knowledge distillation had sufficient representation power, the student network might learn better representations than the teacher network, because the distillation process removed abnormal middle-layer features corresponding to irregular samples and maintained common features, so as to boost the robustness of the student network.
|
| 250 |
+
|
| 251 |
+
Table 5: Relative deviations of the explainer. The additional loss for bias-interpreting successfully overcame the bias-interpreting problem and just increased a bit (ignorable) relative deviation of the explainer.
|
| 252 |
+
|
| 253 |
+
<table><tr><td rowspan="2"></td><td colspan="2">AlexNet</td><td colspan="2">VGG-M</td><td colspan="2">VGG-S</td><td colspan="2">VGG-16</td></tr><tr><td>Baseline</td><td>Ours</td><td>Baseline</td><td>Ours</td><td>Baseline</td><td>Ours</td><td>Baseline</td><td>Ours</td></tr><tr><td>bird</td><td>0.050</td><td>0.045</td><td>0.033</td><td>0.035</td><td>0.030</td><td>0.031</td><td>0.040</td><td>0.034</td></tr><tr><td>cat</td><td>0.041</td><td>0.040</td><td>0.029</td><td>0.030</td><td>0.036</td><td>0.039</td><td>0.027</td><td>0.030</td></tr><tr><td>cow</td><td>0.047</td><td>0.048</td><td>0.058</td><td>0.062</td><td>0.041</td><td>0.047</td><td>0.051</td><td>0.061</td></tr><tr><td>dog</td><td>0.041</td><td>0.047</td><td>0.025</td><td>0.026</td><td>0.041</td><td>0.047</td><td>0.028</td><td>0.026</td></tr><tr><td>horse</td><td>0.044</td><td>0.043</td><td>0.051</td><td>0.049</td><td>0.045</td><td>0.043</td><td>0.036</td><td>0.034</td></tr><tr><td>sheep</td><td>0.045</td><td>0.049</td><td>0.036</td><td>0.038</td><td>0.035</td><td>0.037</td><td>0.032</td><td>0.041</td></tr><tr><td>Average</td><td>0.045</td><td>0.045</td><td>0.039</td><td>0.040</td><td>0.038</td><td>0.041</td><td>0.036</td><td>0.038</td></tr></table>
|
| 254 |
+
|
| 255 |
+
# IMAGE-SPECIFIC EXPLANATIONS V.S. GENERIC EXPLANATIONS
|
| 256 |
+
|
| 257 |
+
(Zhang et al., 2018d) used a tree structure to summarize the inaccurate rationale of each CNN prediction into generic decision-making models for a number of samples. This method assumed the significance of a feature to be proportional to the Jacobian w.r.t. the feature, which is quite problematic. This assumption is acceptable for (Zhang et al., 2018d), because the objective of (Zhang et al.,
|
| 258 |
+
|
| 259 |
+
2018d) is to learn a generic explanation for a group of samples, and the inaccuracy in the explanation for each specific sample does not significantly affect the accuracy of the generic explanation. In comparisons, our method focuses on the quantitative explanation for each specific sample, so we design an additive model to obtain more convincing explanations.
|
| 260 |
+
|
| 261 |
+
# VISUALIZATION OF BIAS-INTERPRETING
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 4: We compared the contribution distribution of different visual concepts (filters) that was estimated by our method and the distribution that was estimated by the baseline. The baseline usually used very few visual concepts to make predictions, which was a typical case of bias-interpreting. In comparisons, our method provided a much more reasonable contribution distribution of visual concepts.
|
| 265 |
+
|
| 266 |
+
# Most important reasons
|
| 267 |
+
|
| 268 |
+
No heavy makeup
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 5: Quantitative explanations for the attractive attribute. Bars indicate elementary contributions $\alpha _ { i } y _ { i }$ from features of different face attributes, rather than the prediction of these attributes. For example, the network predicts a negative goatee attribute $y _ { \mathrm { g o a t e e } } < 0$ , and this information makes a positive contribution to the target attractive attribute, $\alpha _ { i } y _ { i } > 0$ .
|
| 272 |
+
|
| 273 |
+
No heavy makeup
|
| 274 |
+
|
| 275 |
+
# Most important reasons
|
| 276 |
+
|
| 277 |
+
5‐o’clock shadow No bald No heavy makeup No earrings Not wearing lipstick Not wearing necktie
|
| 278 |
+
|
| 279 |
+
No heavy makeup Not wearing earrings Not wearing lipstick Not wearing necktie
|
| 280 |
+
|
| 281 |
+
No 5‐o’clock shadow
|
| 282 |
+
No goatee
|
| 283 |
+
No receding
|
| 284 |
+
hairline
|
| 285 |
+
No sideburns
|
| 286 |
+
Not wearing earrings
|
| 287 |
+
Not wearing necktie
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 6: Quantitative explanations $\alpha _ { i } y _ { i }$ for the male attribute.
|
| 291 |
+
|
| 292 |
+
No heavy makeup Not wearing earrings Not wearing lipstick Not wearing necklace
|
| 293 |
+
|
| 294 |
+
No heavy makeup Not wearing earrings Not wearing lipstick
|
| 295 |
+
|
| 296 |
+
# Most important reasons
|
| 297 |
+
|
| 298 |
+
No goatee Not male Wearing lipstick
|
| 299 |
+
|
| 300 |
+
No eyeglasses Not male No rosy cheeks Wear lipstick
|
| 301 |
+
|
| 302 |
+
Not attractive High cheekbones No mustache No pointy nose No rosy cheeks Not wearing lipstick Not wearing necklace
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 7: Quantitative explanations $\alpha _ { i } y _ { i }$ for the heavy makeup attribute.
|
| 306 |
+
|
| 307 |
+
No eyeglasses
|
| 308 |
+
No gray hear
|
| 309 |
+
Male
|
| 310 |
+
Not wearing lipstick
|
| 311 |
+
Not wearing necklace
|
| 312 |
+
Young
|
| 313 |
+
No bangs
|
| 314 |
+
Not blurry
|
| 315 |
+
No eyeglasses
|
| 316 |
+
Male
|
| 317 |
+
No rosy cheeks
|
| 318 |
+
Wearing hat
|
| 319 |
+
Not wearing lipstick
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 8: Quantitative explanations $\alpha _ { i } y _ { i }$ for the young attribute.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 9: Quantitative explanations for object classification. We assigned contributions of filters to their corresponding object parts, so that we obtained contributions of different object parts. According to top figures, we found that different images had similar explanations, i.e. the CNN used similar object parts to classify objects. Therefore, we showed the grad-CAM visualization of feature maps (Selvaraju et al., 2017) on the bottom, which proved this finding.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 10: We visualized interpretable filters in the top conv-layer of a CNN, which were learned based on (Zhang et al., 2018b). We projected activation regions on the feature map of the filter onto the image plane for visualization. Each filter represented a specific object part through different images.
|
| 329 |
+
|
| 330 |
+
# ANNOTATIONS OF PART NAMES OF INTERPRETABLE FILTERS
|
| 331 |
+
|
| 332 |
+
(Zhang et al., 2018b) learned a CNN, where each filter in the top conv-layer represented a specific object part. Thus, we annotated the name of the object part that corresponded to each filter based on visualization results (see Fig. 10 for examples). We simply annotate each filter of the top conv-layer in a performer once, so the total annotation cost was $O \bar { ( } N )$ , where $N$ is the filter number.
|
| 333 |
+
|
| 334 |
+
Then, we assigned the contribution of a filter to its corresponding part, i.e. $C o n t r i _ { p a r t } ~ =$
|
| 335 |
+
$\textstyle \sum _ { i : 1 }$ -th filter represents the part $\alpha _ { i } y _ { i }$ .
|
| 336 |
+
|
| 337 |
+
# DETAILS IN EXPERIMENT 1
|
| 338 |
+
|
| 339 |
+
We changed the order of the ReLU layer and the mask layer after the top conv-layer, i.e. placing the mask layer between the ReLU layer and the top conv-layer. According to (Zhang et al., 2018b), this operation did not affect the performance of the pre-trained performer. We used the output of the mask layer as $x$ and plugged $x$ to Equation (5) to compute $\{ y _ { i } \}$ .
|
| 340 |
+
|
| 341 |
+
Because the distillation process did not use any ground-truth class labels, the explainer’s output $\textstyle \sum _ { i } { \alpha _ { i } y _ { i } + b }$ was not sophisticatedly learned for classification. Thus, we used a threshold $\sum _ { i } \alpha _ { i } y _ { i } +$ $b \ > \ \tau \ ( \tau \ \approx \ 0 )$ , instead of 0, as the decision boundary for classification. $\tau$ was selected as the one that maximized the accuracy. Such experimental settings made a fairer comparison between the performer and the explainer.
|
md/train/SJl5Np4tPr/SJl5Np4tPr.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSS-DOMAIN FEW-SHOT CLASSIFICATION VIA LEARNED FEATURE-WISE TRANSFORMATION
|
| 2 |
+
|
| 3 |
+
Hung-Yu Tseng University of California, Merced htseng6@ucmerced.edu
|
| 4 |
+
|
| 5 |
+
Hsin-Ying Lee University of California, Merced hlee246@ucmerced.edu
|
| 6 |
+
|
| 7 |
+
Jia-Bin HuangVirginia Techjbhuang@vt.edu
|
| 8 |
+
|
| 9 |
+
Ming-Hsuan Yang
|
| 10 |
+
University of California, Merced
|
| 11 |
+
Google Research
|
| 12 |
+
Yonsei University
|
| 13 |
+
mhyang@ucmerced.edu
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
Few-shot classification aims to recognize novel categories with only few labeled images in each class. Existing metric-based few-shot classification algorithms predict categories by comparing the feature embeddings of query images with those from a few labeled images (support examples) using a learned metric function. While promising performance has been demonstrated, these methods often fail to generalize to unseen domains due to large discrepancy of the feature distribution across domains. In this work, we address the problem of few-shot classification under domain shifts for metric-based methods. Our core idea is to use feature-wise transformation layers for augmenting the image features using affine transforms to simulate various feature distributions under different domains in the training stage. To capture variations of the feature distributions under different domains, we further apply a learning-to-learn approach to search for the hyper-parameters of the feature-wise transformation layers. We conduct extensive experiments and ablation studies under the domain generalization setting using five few-shot classification datasets: mini-ImageNet, CUB, Cars, Places, and Plantae. Experimental results demonstrate that the proposed feature-wise transformation layer is applicable to various metric-based models, and provides consistent improvements on the few-shot classification performance under domain shift.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Few-shot classification (Lake et al., 2015) aims to recognize instances from novel categories (query instances) with only few labeled examples in each class (support examples). Among various recent approaches for addressing the few-shot classification problem, metric-based meta-learning methods (Garcia & Bruna, 2018; Sung et al., 2018; Vinyals et al., 2016; Snell et al., 2017; Oreshkin et al., 2018) have received considerable attention due to their simplicity and effectiveness. In general, metric-based few-shot classification methods make the prediction based on the similarity between the query image and support examples. As illustrated in Figure 1, metric-based approaches consist of 1) a feature encoder and 2) a metric function. Given an input task consisting of few labeled images (the support set) and unlabeled images (the query set) from novel classes, the encoder first extracts the image features. The metric function then takes the features of both the labeled and unlabeled images as input and predicts the category of the query images. Despite the success of recognizing novel classes sampled from the same domain as in the training stage (e.g., , both training and testing are on mini-ImageNet classes), Chen et al. (Chen et al., 2019a) recently raise the issue that existing metric-based approaches often do not generalize well to categories from different domains. The generalization ability to unseen domains, however, is of critical importance due to the difficulty to construct large training datasets for rare classes (e.g., , recognizing rare bird species in a fine-grained classification setting). As a result, understanding and addressing the domain shift problem for few-shot classification is of great interest.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Problem formulation and motivation. Metric-based meta-learning models usually consist of a feature encoder $E$ and metric function $M$ . We aim to improve the generalization ability of the models training from seen domains to arbitrary unseen domains. The key observation is that the distributions of the image features extracted from tasks in the unseen domains are significantly different from those in the seen domains.
|
| 25 |
+
|
| 26 |
+
To alleviate the domain shift issue, numerous unsupervised domain adaptation techniques have been proposed (Pan & Yang, 2010; Chen et al., 2018; Tzeng et al., 2017). These methods focus on adapting the classifier of the same category from the source to the target domain. Building upon the domain adaptation formulation, Dong and Xing (Dong & Xing, 2018) relax the constraint and transfer knowledge across domains for recognizing novel category in the one-shot setting. However, unsupervised domain adaptation approaches assume that numerous unlabeled images are available in the target domain during training. In many cases, this assumption may not be realistic. For example, the cost and efforts of collecting numerous images of rare bird species can be prohibitively high. On the other hand, domain generalization methods have been developed (Blanchard et al., 2011; Li et al., 2019) to learn classifiers that generalize well to multiple unseen domains without requiring the access to data from those domains. Yet, existing domain generalization approaches aim at recognizing instance from the same category in the training stage.
|
| 27 |
+
|
| 28 |
+
In this paper, we tackle the domain generalization problem for recognizing novel category in the few-shot classification setting. As shown in Figure 1(c), our key observation is that the distributions of the image features extracted from the tasks in different domains are significantly different. As a result, during the training stage, the metric function may overfit to the feature distributions encoded only from the seen domains and thus fail to generalize to unseen domains. To address the issue, we propose to integrate feature-wise transformation layer to modulate the feature activations with affine transformations into the feature encoder. The use of these feature-wise transformation layers allows us to simulate various distributions of image features during the training stage, and thus improve the generalization ability of the metric function in the testing phase. Nevertheless, the hyper-parameters of the feature-wise transformation layers may require meticulous hand-tuning due to the difficulty to model the complex variation of the image feature distributions across various domains. In light of this, we develop a learning-to-learn algorithm to optimize the proposed feature-wise transformation layers. The core idea is to optimize the feature-wise transformation layers so that the model can work well on the unseen domains after training the model using the seen domains. We make the source code and datasets public available to simulate future research in this field.1
|
| 29 |
+
|
| 30 |
+
We make the following three contributions in this work:
|
| 31 |
+
|
| 32 |
+
• We propose to use feature-wise transformation layers to simulate various image feature distributions extracted from the tasks in different domains. Our feature-wise transformation layers are method-agnostic and can be applied to various metric-based few-shot classification approaches for improving their generalization to unseen domains.
|
| 33 |
+
|
| 34 |
+
• We develop a learning-to-learn method to optimize the hyper-parameters of the featurewise transformation layers. In contrast to the exhaustive parameter hand-tuning process, the proposed learning-to-learn algorithm is capable of finding the hyper-parameters for the feature-wise transformation layers to capture the variation of image feature distribution across various domains.
|
| 35 |
+
|
| 36 |
+
• We evaluate the performance of three metric-based few-shot classification models (including MatchingNet (Vinyals et al., 2016), RelationNet (Sung et al., 2018), and Graph Neural Networks (Garcia & Bruna, 2018)) with extensive experiments under the domain generalization setting. We show that the proposed feature-wise transformation layers can effectively improve the generalization ability of metric-based models to unseen domains. We also demonstrate further performance improvement with our learning-to-learn scheme for learning the feature-wise transformation layers.
|
| 37 |
+
|
| 38 |
+
# 2 RELATED WORK
|
| 39 |
+
|
| 40 |
+
Few-shot classification. Few-shot classification aims to learn to recognize novel categories with a limited number of labeled examples in each class. Significant progress has been made using the meta-learning based formulation. There are three main classes of meta-learning approaches for addressing the few-shot classification problem. First, recurrent-based frameworks (Rezende et al., 2016; Santoro et al., 2016) sequentially process and encode the few labeled images of novel categories. Second, optimization-based schemes (Finn et al., 2017; Rusu et al., 2019; Tseng et al., 2019; Vuorio et al., 2019) learn to fine-tune the model with the few example images by integrating the fine-tuning process in the meta-training stage. Third, metric-based methods (Koch et al., 2015; Vinyals et al., 2016; Snell et al., 2017; Oreshkin et al., 2018; Sung et al., 2018; Lifchitz et al., 2019) classify the query images by computing the similarity between the query image and few labeled images of novel categories.
|
| 41 |
+
|
| 42 |
+
Among these three classes, metric-based methods have attracted considerable attention due to their simplicity and effectiveness. Metric-based few-shot classification approaches consist of 1) a feature encoder to extract features from both the labeled and unlabeled images and 2) a metric function that takes image features as input and predict the category of unlabeled images. For example, MatchingNet (Vinyals et al., 2016) applies cosine similarity along with a recurrent network, ProtoNet (Snell et al., 2017) utilizes euclidean distance, RelationNet (Sung et al., 2018) uses CNN modules, GNN (Garcia & Bruna, 2018) employs graph convolution modules as the metric functions. However, these metric functions may fail to generalize to unseen domains since the distributions of the image features extracted from the task in various domains can be drastically different. Chen et al. (Chen et al., 2019a) recently show that the performance of existing few-shot classification methods degrades significantly under domain shifts. Our work focuses on improving the generalization ability of metric-based few-shot classification models to unseen domains. Very recently, Triantafillou et al. (Triantafillou et al., 2020) also target on the cross-domain few-shot classification problem. We encourage the readers to review for a more complete picture.
|
| 43 |
+
|
| 44 |
+
Domain adaptation. Domain adaptation methods (Pan & Yang, 2010) aim to reduce the domain shift between the source and target domains. Since the emergence of domain adversarial neural networks (DANN) (Ganin et al., 2016), numerous frameworks have been proposed to apply adversarial training to align the source and target distributions on the feature-level (Tzeng et al., 2017; Chen et al., 2018; Hsu et al., 2020) or on the pixel-level (Tsai et al., 2018; Hoffman et al., 2018; Bousmalis et al., 2017; Chen et al., 2019b; Lee et al., 2018). Most domain frameworks, however, target at adapting knowledge of the same category learned from the source to target domain and thus are less effective to handle novel category as in the few-shot classification scenarios. One exception is the work by Dong and Xing (Dong & Xing, 2018) that address the domain shift issue in the one-shot learning setting. Nevertheless, these domain adaptation methods require access to the unlabeled images in the target domain during the training. Such an assumption may not be feasible in many applications due to the difficulty of collecting abundant examples of rare categories (e.g., rare bird species).
|
| 45 |
+
|
| 46 |
+
Domain generalization. In contrast to the domain adaptation frameworks, domain generalization (Blanchard et al., 2011) methods aim at generalizing from a set of seen domains to the unseen domain without accessing instances from the unseen domain during the training stage. Before the emerging of learning-to-learn (i.e., meta-learning) (Ravi & Larochelle, 2017; Finn et al., 2017) approaches, several methods have been proposed for tackling the domain generalization problem. Examples include extracting domain-invariant features from various seen domains (Blanchard et al., 2011; Li et al., 2018b; Muandet et al., 2013), improving the classifiers by fusing classifiers learned from seen domains (Niu et al., 2015a;b), and decomposing the classifiers into domain-specific and domain-invariant components (Khosla et al., 2012; Li et al., 2017a). Another stream of work learns to augment the input data with adversarial learning (Shankar et al., 2018; Volpi et al., 2018). Most recently, a number of methods apply the learning-to-learn strategy to simulate the generalization process in the training stage (Balaji et al., 2018; Li et al., 2018a; 2019). Our method adopts a similar approach to train the proposed feature-wise transformation layers. The application context, however, differs from prior work as we focus on recognizing novel category from unseen domains in few-shot classification. The goal of this work is to make few-shot classification algorithms robust to domain shifts.
|
| 47 |
+
|
| 48 |
+
Learning-based data augmentation. Data augmentation methods are designed to increase the diversity of data for the training process. Unlike the hand-crafted approaches such as horizontal flipping and random cropping, several recent approaches have been proposed to learn the data augmentation (Cubuk et al., 2019; DeVries & Taylor, 2017a; Lemley et al., 2017; Perez & Wang, 2017; Sixt et al., 2018; Tran et al., 2017). For instance, the SmartAugmentation (Lemley et al., 2017) scheme trains a network that combines multiple images from the same category. The Bayesian DA (Tran et al., 2017) method augments the data according to the distribution learned from the training set, and the RenderGAN (Sixt et al., 2018) model simulates realistic images using generative adversarial networks. In addition, the AutoAugment (Cubuk et al., 2019) algorithm learns the augmentation via reinforcement learning. Two recent frameworks (Shankar et al., 2018; Volpi et al., 2018) target at augmenting the data by modeling to the variation across different domains with adversarial learning. Similar to these approaches for capturing the variations across multiple domains, we develop a learning-to-learn process to optimize the proposed feature-wise transformation layers for simulating various distributions of image features encoded from different domains.
|
| 49 |
+
|
| 50 |
+
Conditional normalization. Conditional normalization aims to modulate the activation via a learned affine transformation conditioned on external data (e.g., an image of an artwork for capturing a specific style). Conditional normalization methods, including Conditional Batch Normalization (Dumoulin et al., 2017), Adaptive Instance Normalization (Huang & Belongie, 2017), and SPADE (Park et al., 2019), are widely used in the style transfer and image synthesis tasks (Karras et al., 2019; Lee et al., 2020; AlBahar & Huang, 2019). In addition to image stylization and generation, conditional normalization has also been applied to align different data distributions for domain adaptation (Cariucci et al., 2017; Li et al., 2017b). In particular, the TADAM method (Oreshkin et al., 2018) applies conditional batch normalization to metric-based models for the few-shot classification task. The TADAM method aims to model the training task distribution under the same domain. In contrast, we focus on simulating various features distributions from different domains.
|
| 51 |
+
|
| 52 |
+
Regularization for neural networks. Adding some form of randomness in the training stage is an effective way to improve generalization (Srivastava et al., 2014; Wan et al., 2013; Larsson et al., 2017; DeVries & Taylor, 2017b; Zhang et al., 2018; Ghiasi et al., 2018). The proposed featurewise transformation layer for modulating the feature activations of intermediate layers (by applying random affine transformations) can also be viewed as a way to regularize network training.
|
| 53 |
+
|
| 54 |
+
# 3 METHODOLOGY
|
| 55 |
+
|
| 56 |
+
# 3.1 PRELIMINARIES
|
| 57 |
+
|
| 58 |
+
Few-shot classification and metric-based method. The few-shot classification problem is typically characterized as $N _ { w }$ way (number of categories) and $N _ { s }$ shot (number of labeled examples for each category). Figure 1 shows an example of how the metric-based frameworks operate in the 3-way 3-shot few shot classification task. A metric-based algorithm generally contains a feature encoder $E$ and a metric function $M$ . For each iteration during the training stage, the algorithm randomly samples $N _ { w }$ categories and constructs a task $T$ . We denote the collection of input images as $\mathcal { X } = \{ { \bf x } _ { 1 } , { \bf x } _ { 2 } , \cdot \cdot \cdot , { \bf x } _ { n } \}$ and the corresponding categorical labels as and $\mathcal { Y } = \{ y _ { 1 } , y _ { 2 } , \cdot \cdot \cdot , y _ { n } \}$ . A task $T$ consists of a support set $\mathbf { S } = \{ ( \bar { \mathcal { X } } _ { s } , \mathcal { Y } _ { s } ) \bar \}$ and a query set $\mathbf { Q } = \{ ( \mathcal { X } _ { q } , \mathcal { Y } _ { q } ) \}$ . The support set S and query set $\mathbf { Q }$ are respectively formed by randomly selecting $N _ { s }$ and $N _ { q }$ samples for each of the $N _ { w }$ categories.
|
| 59 |
+
|
| 60 |
+
The feature encoder $E$ first extracts the features from both the support and query images. The metric function $M$ then predicts the categories of the query images $\mathcal { X } _ { q }$ according to the label of support images $\mathcal { \partial } _ { s }$ , the encoded query image $E ( \mathbf { x } ^ { q } )$ , and the encoded support images $E ( \mathcal { X } _ { s } )$ . The process can be formulated as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\hat { \mathcal { Y } } _ { q } = M ( \mathcal { Y } _ { s } , E ( \mathcal { X } _ { s } ) , E ( \mathcal { X } _ { q } ) ) .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Finally, the training objective of a metric-based framework is the classification loss of the images in the query set,
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
L = L _ { \mathrm { c l s } } ( \mathcal { V } _ { q } , \hat { \mathcal { V } } _ { q } ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The main difference between various metric-based algorithms lies in the design choice for the metric function $M$ . For instance, the MatchingNet (Vinyals et al., 2016) method utilizes long-short-term memories (LSTM), the RelationNet (Sung et al., 2018) model applies convolutional neural networks (CNN), and the GNN (Garcia & Bruna, 2018) scheme uses graph convolutional networks.
|
| 73 |
+
|
| 74 |
+
Problem setting. In this work, we address the few-shot classification problem under the domain generalization setting. We denote a domain consisting of a collection of few-shot classification tasks as $\mathcal { T } = \{ T _ { 1 } , T _ { 2 } , \cdot \cdot \cdot , T _ { n } \}$ . We assume $N$ seen domains $\{ T _ { 1 } ^ { \mathrm { s e e n } } , T _ { 2 } ^ { \mathrm { s e e n } } , \cdot \cdot \cdot , T _ { N } ^ { \mathrm { s e e n } } \}$ available in the training phase. The goal is to learn a metric-based few-show classification model using the seen domains, such that the model can generalize well to an unseen domain $\tau ^ { \mathrm { u n s e e n } }$ . For example, one can train the model with the mini-ImageNet (Ravi & Larochelle, 2017) dataset as well as some public available fine-grained few-shot classification domains, e.g., CUB (Welinder et al., 2010), and then evaluate the generalization ability of the model on an unseen plants domain. Note that our problem formulation does not access images in the unseen domain at the training stage.
|
| 75 |
+
|
| 76 |
+
# 3.2 FEATURE-WISE TRANSFORMATION LAYER
|
| 77 |
+
|
| 78 |
+
Our focus in this work is to improve the generalization ability of metric-based few-shot classification models to arbitrary unseen domains. As shown in Figure 1, due to the discrepancy between the feature distributions extracted from the task in the seen and unseen domains, the metric function $M$ may overfit to the seen domains and fail to generalize to the unseen domains. To address the problem, we propose to integrate a feature-wise transformation to augment the intermediate feature activations with affine transformations into the feature encoder $E$ . Intuitively, the feature encoder $E$ integrated with the feature-wise transformation layers can produce more diverse feature distributions which improve the generalization ability of the metric function $M$ . As shown in Figure 2(b), we insert the feature-wise transformation layer after the batch normalization layer in the feature encoder $E$ . The hyper-parameters $\theta _ { \gamma } \in \ R ^ { C \times 1 \times 1 }$ and $\theta _ { \beta } \in R ^ { C \times 1 \times 1 }$ indicate the standard deviations of the Gaussian distributions for sampling the affine transformation parameters. Given an intermediate feature activation map $\mathbf { z }$ in the feature encoder with the dimension of $C \times H \times W$ , we first sample the scaling term $\gamma$ and bias term $\beta$ from Gaussian distributions,
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\gamma \sim N ( { \bf 1 } , \mathrm { s o f t p l u s } ( \theta _ { \gamma } ) ) \quad \mathrm { ~ } \beta \sim N ( { \bf 0 } , \mathrm { s o f t p l u s } ( \theta _ { \beta } ) ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
We then compute the modulated activation $\hat { \mathbf { z } }$ as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\hat { z } _ { c , h , w } = \gamma _ { c } \times z _ { c , h , w } + \beta _ { c } ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $\hat { z } _ { c , h , w } \in \hat { \mathbf { z } }$ and $z _ { c , h , w } \in \mathbf { z }$ . In practice, we insert the feature-wise transformation layers to the feature encoder $E$ at multiple levels.
|
| 91 |
+
|
| 92 |
+
# 3.3 LEARNING THE FEATURE-WISE TRANSFORMATION LAYERS
|
| 93 |
+
|
| 94 |
+
While we can empirically determine hyper-parameters $\theta _ { f } = \{ \theta _ { \gamma } , \theta _ { \beta } \}$ of the feature-wise transformation layer, it remains challenging to hand-tune a generic set of parameters which are effective on different settings (i.e., different metric-based frameworks and different seen domains). To address this problem, we design a learning-to-learn algorithm to optimize the hyper-parameters of the feature-wise transformation layer. The core idea is that training the metric-based model integrated with the proposed layers on the seen domains should improve the performance of the model on the unseen domains.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 2: Method overview. (a) We propose a feature-wise transformation layer to modulate intermediate feature activation $\mathbf { z }$ in the feature encoder $E$ with the scaling and bias terms sampled from the Gaussian distributions parameterized by the hyper-parameters $\theta _ { \gamma }$ and $\theta _ { \beta }$ . During the training phase, we insert a collection of feature-wise transformation layers into the feature encoder to simulate feature distributions extracted from the tasks in various domains. (b) We design a learningto-learn algorithm to optimize the hyper-parameters $\theta _ { \gamma }$ and $\theta _ { \beta }$ of feature-wise transformation layers by maximizing the performance of the applied metric-based model on the pseudo-unseen domain (bottom) after it is optimized on the pseudo-seen domain $( t o p )$ .
|
| 98 |
+
|
| 99 |
+
We illustrate the process in Figure 2(b) and Algorithm 1. In each training iteration $t$ , we sample a pseudo-seen domain $\mathcal { T } ^ { \mathrm { p s } }$ and a pseudo-unseen domain $\mathcal { T } ^ { \mathrm { p u } }$ from a set of seen domains $\{ T _ { 1 } ^ { \mathrm { s e e n } } , T _ { 2 } ^ { \mathrm { s e e n } } , \cdot \cdot \cdot , T _ { N } ^ { \mathrm { s e e n } } \}$ . Given a metric-based model with feature encoder $E _ { \theta _ { e } ^ { t } }$ and metric function $M _ { \theta _ { m } ^ { t } }$ , we first integrate the proposed layers with hyper-parameters $\theta _ { f } ^ { t } \ = \ \mathrm { \bar { \{ \theta } } _ { \gamma } ^ { t } , \theta _ { \beta } ^ { t } \}$ into the feature encoder (i.e., $E _ { \theta _ { e } ^ { t } , \theta _ { f } ^ { t } } )$ . We then use the loss in equation 2 to update the parameters in the metric-based model with the pseudo-seen task $T ^ { \mathrm { p s } } = \{ ( \mathcal { X } _ { s } ^ { \mathrm { p s } } , \mathcal { V } _ { s } ^ { \mathrm { p s } } ) , ( \mathcal { X } _ { q } ^ { \mathrm { p s } } , \mathcal { V } _ { q } ^ { \mathrm { p s } } ) \} \in T ^ { \mathrm { p s } }$ , namely
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r } { ( \theta _ { e } ^ { t + 1 } , \theta _ { m } ^ { t + 1 } ) = ( \theta _ { e } ^ { t } , \theta _ { m } ^ { t } ) - \alpha \nabla \theta _ { e } ^ { t } , \theta _ { m } ^ { \mathrm { { t } } } \ L _ { \mathrm { { c l s } } } ( \mathcal { V } _ { q } ^ { \mathrm { p s } } , \mathcal { M } _ { \theta _ { m } ^ { t } } ( \mathcal { V } _ { s } ^ { \mathrm { p s } } , \mathcal { E } _ { \theta _ { e } ^ { t } , \theta _ { f } ^ { t } } ( \mathcal { X } _ { s } ^ { \mathrm { p s } } ) , \mathcal { E } _ { \theta _ { e } ^ { t } , \theta _ { f } ^ { t } } ( \mathcal { X } _ { q } ^ { \mathrm { p s } } ) ) ) , } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\alpha$ is the learning rate. We then measure the generalization ability of the updated metric-based model by 1) removing the feature-wise transformation layers from the model and 2) computing the classification loss of the updated model on the pseudo-unseen task $\begin{array} { r l } { T ^ { \mathrm { p u } } } & { { } = } \end{array}$ $\{ ( \chi _ { s } ^ { \mathrm { p u } } , \mathbf { \tilde { \Gamma } } ^ { \mathrm { p p u } } ) , ( \chi _ { q } ^ { \mathrm { p u } } , \mathcal { V } _ { q } ^ { \mathrm { p u } } ) \} \in T ^ { \mathrm { p u } }$ , namely
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
L ^ { \mathrm { p u } } = L _ { \mathrm { c l s } } ( { \mathcal { Y } _ { q } ^ { \mathrm { p u } } } , { M _ { \theta _ { m } ^ { t + 1 } } } ( { \mathcal { Y } _ { s } ^ { \mathrm { p u } } } , E _ { \theta _ { e } ^ { t + 1 } } ( { \mathcal { X } _ { s } ^ { \mathrm { p u } } } ) , E _ { \theta _ { e } ^ { t + 1 } } ( { \mathcal { X } _ { q } ^ { \mathrm { p u } } } ) ) ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Finally, as the loss $L ^ { \mathrm { p u } }$ reflects the effectiveness of the feature-wise transformation layers, we optimize the hyper-parameters $\theta _ { f }$ by
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r } { \theta _ { f } ^ { t + 1 } = \theta _ { f } ^ { t } - \alpha \bigtriangledown \theta _ { f } ^ { t } \ L ^ { \mathrm { p u } } . } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Note that the metric-based model and feature-wise transformation layers are jointly optimized in the training stage.
|
| 118 |
+
|
| 119 |
+
# Algorithm 1: Learning-to-Learn Feature-Wise Transformation.
|
| 120 |
+
|
| 121 |
+
1 Require: Seen domains $\{ T _ { 1 } ^ { \mathrm { s e e n } } , T _ { 2 } ^ { \mathrm { s e e n } } , \cdot \cdot \cdot , T _ { n } ^ { \mathrm { s e e n } } \}$ , learning rate $\alpha$
|
| 122 |
+
2 Randomly initialize $\theta _ { e }$ , $\theta _ { m }$ and $\theta _ { f }$
|
| 123 |
+
3 while training do
|
| 124 |
+
4 Randomly sample non-overlapping pseudo-seen $\mathcal { T } ^ { \mathrm { p s } }$ and psuedo-unseen $\mathcal { T } ^ { \mathrm { p u } }$ domains from
|
| 125 |
+
the seen domains
|
| 126 |
+
5 Sample a pesudo-seen task $T ^ { \mathrm { p s } } \in \mathcal { T } ^ { \mathrm { p s } }$ and a pseudo-unseen task $T ^ { \mathrm { p u } } \in \mathcal { T } ^ { \mathrm { p u } }$
|
| 127 |
+
6 // Update metric-based model with pseudo-seen task:
|
| 128 |
+
7 Obtain $\theta _ { e } ^ { t + 1 }$ , $\theta _ { m } ^ { t + 1 }$ using equation 5
|
| 129 |
+
8 // Update feature-wise transformation layers with pseudo-unseen task:
|
| 130 |
+
9 Obtain $\theta _ { f } ^ { t + 1 }$ using equation 6 and equation 7
|
| 131 |
+
|
| 132 |
+
# 10 end
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTAL RESULTS
|
| 135 |
+
|
| 136 |
+
# 4.1 EXPERIMENTAL SETUPS
|
| 137 |
+
|
| 138 |
+
We validate the efficacy of the proposed feature-wise transformation layer with three existing metricbased algorithms (Vinyals et al., 2016; Sung et al., 2018; Garcia & Bruna, 2018) under two experimental settings.First, we empirically determine the hyper-parameters $\theta _ { f } = \{ \theta _ { \gamma } , \theta _ { \beta } \}$ of the featurewise transformation layers and analyze the impact of the feature-wise transformation layers. We train the few-shot classification model on the mini-ImageNet (Bousmalis et al., 2017) domain and evaluate the trained model on four different domains: CUB (Welinder et al., 2010), Cars (Krause et al., 2013), Places (Zhou et al., 2017), and Plantae (Van Horn et al., 2018). Second, we demonstrate the importance of the proposed learning-to-learn scheme for optimizing the hyper-parameters of feature-wise transformation layers. We adopt the leave-one-out setting by selecting an unseen domain from CUB, Cars, Places, and Plantae domains. The mini-ImageNet (Bousmalis et al., 2017) and the remaining domains then serve as the seen domains for training both the metric-based model and feature-wise transformation layers using Algorithm 1. After the training, we evaluate the trained model on the selected unseen domain.
|
| 139 |
+
|
| 140 |
+
Datasets. We conduct experiments using five datasets: mini-ImageNet (Ravi & Larochelle, 2017), CUB (Welinder et al., 2010), Cars (Krause et al., 2013), Places (Zhou et al., 2017), and Plantae (Van Horn et al., 2018). Since the mini-ImageNet dataset serves as the seen domain for all experiments, we select the training iterations with the best accuracy on the validation set of the miniImageNet dataset for evaluation. More details of dataset processing are presented in Appendix A.1.
|
| 141 |
+
|
| 142 |
+
Implementation details. We apply the feature-wise transformation layers to three metric-based frameworks: MatchingNet (Vinyals et al., 2016), RelationNet (Sung et al., 2018), and GNN (Garcia & Bruna, 2018). We use the public implementation from Chen et al. (Chen et al., 2019a) to train both the MatchingNet and RelationNet model.2 For the GNN approach, we integrate the official implementation for graph convolutional network into Chen’s implementation.3 In all experiments, we adopt the ResNet-10 (He et al., 2016) model as the backbone network for our feature encoder $E$ .
|
| 143 |
+
|
| 144 |
+
We present the average results over 1, 000 trials for all the experiments. In each trial, we randomly sample $N _ { w }$ categories (e.g., 5 classes for 5-way classification). For each category, we randomly select $N _ { s }$ images (e.g., 1-shot or 5-shot) for the support set $\mathcal { X } _ { s }$ and 16 images for the query set $\mathcal { X } _ { q }$ . We discuss the implementation details in Appendix A.2.
|
| 145 |
+
|
| 146 |
+
Pre-trained feature encoder. Prior to the few-shot classification training stage, we first pre-train the feature encoder $E$ by minimizing the standard cross-entropy classification loss on the 64 training categories in the mini-ImageNet dataset. This strategy can significantly improve the performance of metric-based models and is widely adopted in several recent frameworks (Rusu et al., 2019; Gidaris & Komodakis, 2018; Lifchitz et al., 2019).
|
| 147 |
+
|
| 148 |
+
Table 1: Few-shot classification results trained with the mini-ImageNet dataset. We train the model on the mini-ImageNet domain and evaluate the trained model on another domain. FT indicates that we apply the feature-wise transformation layers with empirically determined hyperparameters to train the model.
|
| 149 |
+
|
| 150 |
+
<table><tr><td>5-way 1-Shot</td><td>FT</td><td>mini-ImageNet</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td rowspan="2">MatchingNet</td><td></td><td>59.10 ± 0.64%</td><td>35.89 ±0.51%</td><td>30.77 ± 0.47%</td><td>49.86 ± 0.79%</td><td>32.70 ±0.60%</td></tr><tr><td>√</td><td>58.76 ±0.61%</td><td>36.61 ±0.53%</td><td>29.82 ±0.44%</td><td>51.07 ± 0.68%</td><td>34.48 ±0.50%</td></tr><tr><td rowspan="2">RelationNet</td><td></td><td>57.80 ±0.88%</td><td>42.44 ±0.77%</td><td>29.11 ± 0.60%</td><td>48.64 ± 0.85%</td><td>33.17± 0.64%</td></tr><tr><td>专</td><td>58.64±0.85%</td><td>44.07± 0.77%</td><td>28.63±0.59%</td><td>50.68±0.87%</td><td>33.14±0.62%</td></tr><tr><td rowspan="2">GNN</td><td></td><td>60.77 ±0.75%</td><td>45.69 ±0.68%</td><td>31.79 ±0.51%</td><td>53.10 ±0.80%</td><td>35.60 ±0.56%</td></tr><tr><td>专</td><td>66.32 ±0.80%</td><td>47.47±0.75%</td><td>31.61 ± 0.53%</td><td>55.77±0.79%</td><td>35.95 ±0.58%</td></tr><tr><td>5-way 5-Shot</td><td>FT</td><td>mini-ImageNet</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td rowspan="2">MatchingNet</td><td></td><td>70.96 ± 0.65%</td><td>51.37 ±0.77%</td><td>38.99 ± 0.64%</td><td>63.16 ±0.77%</td><td>46.53 ± 0.68%</td></tr><tr><td>√</td><td>72.53±0.69%</td><td>55.23±0.83%</td><td>41.24± 0.65%</td><td>64.55 ±0.75%</td><td>41.69 ± 0.63%</td></tr><tr><td rowspan="2">RelationNet</td><td></td><td>71.00 ±0.69%</td><td>57.77 ±0.69%</td><td>37.33 ± 0.68%</td><td>63.32 ±0.76%</td><td>44.00 ± 0.60%</td></tr><tr><td>专</td><td>73.78 ±0.64%</td><td>59.46 ±0.71%</td><td>39.91 ±0.69%</td><td>66.28±0.72%</td><td>45.08 ±0.59%</td></tr><tr><td rowspan="2">GNN</td><td>-</td><td>80.87±0.56%</td><td>62.25±0.65%</td><td>44.28± 0.63%</td><td>70.84 ± 0.65%</td><td>52.53±0.59%</td></tr><tr><td>√</td><td>81.98±0.55%</td><td>66.98 ±0.68%</td><td>44.90 ± 0.64%</td><td>73.94±0.67%</td><td>53.85±0.62%</td></tr></table>
|
| 151 |
+
|
| 152 |
+
# 4.2 FEATURE-WISE TRANSFORMATION WITH MANUAL PARAMETER TUNING
|
| 153 |
+
|
| 154 |
+
We train the model using the mini-ImageNet dataset and evaluate the trained model with four other unseen domains: CUB, Cars, Places, and Plantae. We add the proposed feature-wise transformation layers after the last batch normalization layer of all the residual blocks in the feature encoder $E$ during the training stage. We empirically set $\theta _ { \gamma }$ and $\theta _ { \beta }$ in all feature-wise transformation layers to be 0.3 and 0.5, respectively. Table 1 shows the metric-based model trained with the featurewise transformation layers performs favorably against the individual baselines. We attribute the improvement of generalization to the use of the proposed layers for making the feature encoder $E$ produce more diverse feature distributions in the training stage. As a by-product, we also observe the improvement on the seen domain (i.e., mini-ImageNet) since there is still a slight discrepancy between the feature distributions extracted from the training and testing sets of the same domain. It is noteworthy that we also compare the proposed method with several recent approaches (e.g., Lee et al. (2019)) in Table 8 and Table 9. With the proposed feature-wise transformation layers, the GNN (Garcia & Bruna, 2018) model performs favorably against the state-of-the-art frameworks on both the seen domain (i.e., mini-ImageNet) and unseen domains.
|
| 155 |
+
|
| 156 |
+
# 4.3 GENERALIZATION FROM MULTIPLE DOMAINS
|
| 157 |
+
|
| 158 |
+
Here we validate the effectiveness of the proposed learning-to-learn algorithm for optimizing the hyper-parameters of the feature-wise transformation layers. We compare the metric-model trained with the proposed learning procedure to the model trained with the pre-determined feature-wise transformation layers. The leave-one-out setting is used to select one domain from the CUB, Cars, Places, and Plantae as the unseen domain for the evaluation. The mini-ImageNet and the remaining domains serve as the seen domains for training the model. Since we select the training iteration according to the validation performance on the mini-ImageNet domain for evaluation, we do not consider the mini-ImageNet as the unseen domain. We present the results in Table 2. We denote FT and LFT as applying pre-determined feature-wise transformation layers and those layers optimized with the proposed learning-to-learn algorithm, respectively. The models optimized with proposed learning scheme outperforms those trained with the pre-determined feature-wise transformation layers since the optimized feature-wise transformation layers can better capture the variation of feature distributions across different domains. Table 1 and Table 2 show that the proposed feature-wise transformation layers together with the learning-to-learn algorithm effectively mitigate the domain shift problem for metric-based frameworks.
|
| 159 |
+
|
| 160 |
+
Table 2: Few-shot classification results trained with multiple datasets. We use the leave-one-out setting to select the unseen domain and train the model as well as the feature-wise transformation layers using Algorithm 1. FT and LFT indicate applying the pre-determined and learning-to-learned feature-wise transformation, respectively.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>5-way 1-Shot</td><td></td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>MatchingNet</td><td>=</td><td>37.90 ± 0.55%</td><td>28.96±0.45%</td><td>49.01 ± 0.65%</td><td>33.21 ± 0.51%</td></tr><tr><td></td><td>FT</td><td>41.74± 0.59%</td><td>28.30 ±0.44%</td><td>48.77 ± 0.65%</td><td>32.15± 0.50%</td></tr><tr><td></td><td>LFT</td><td>43.29 ± 0.59%</td><td>30.62 ±0.48%</td><td>52.51 ± 0.67%</td><td>35.12 ± 0.54%</td></tr><tr><td>RelationNet</td><td>1</td><td>44.33± 0.59%</td><td>29.53± 0.45%</td><td>47.76 ± 0.63%</td><td>33.76 ± 0.52%</td></tr><tr><td></td><td>FT</td><td>44.67 ± 0.58%</td><td>30.38 ± 0.47%</td><td>48.40 ± 0.64%</td><td>35.40 ± 0.53%</td></tr><tr><td></td><td>LFT</td><td>48.38 ±0.63%</td><td>32.21 ±0.51%</td><td>50.74±0.66%</td><td>35.00 ± 0.52%</td></tr><tr><td>GNN</td><td>1</td><td>49.46 ± 0.73%</td><td>32.95 ± 0.56%</td><td>51.39 ± 0.80%</td><td>37.15 ± 0.60%</td></tr><tr><td></td><td>FT</td><td>48.24 ± 0.75%</td><td>33.26 ± 0.56%</td><td>54.81± 0.81%</td><td>37.54± 0.62%</td></tr><tr><td></td><td>LFT</td><td>51.51 ± 0.80%</td><td>34.12 ± 0.63%</td><td>56.31 ± 0.80%</td><td>42.09 ± 0.68%</td></tr><tr><td>5-way 5-Shot</td><td></td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>MatchingNet</td><td></td><td>51.92 ± 0.80%</td><td>39.87 ± 0.51%</td><td>61.82 ± 0.57%</td><td>47.29 ± 0.51%</td></tr><tr><td></td><td>FT</td><td>56.29 ± 0.80%</td><td>39.58 ± 0.54%</td><td>62.32 ± 0.58%</td><td>46.48± 0.52%</td></tr><tr><td></td><td>LFT</td><td>61.41 ± 0.57%</td><td>43.08 ± 0.55%</td><td>64.99 ± 0.59%</td><td>48.32 ± 0.57%</td></tr><tr><td>RelationNet</td><td>-</td><td>62.13 ± 0.74%</td><td>40.64± 0.54%</td><td>64.34± 0.57%</td><td>46.29 ± 0.56%</td></tr><tr><td></td><td>FT</td><td>63.64± 0.77%</td><td>42.24± 0.57%</td><td>65.42± 0.58%</td><td>47.81 ± 0.51%</td></tr><tr><td></td><td>LFT</td><td>64.99 ± 0.54%</td><td>43.44 ± 0.59%</td><td>67.35 ± 0.54%</td><td>50.39 ± 0.52%</td></tr><tr><td>GNN</td><td>1</td><td>69.26 ± 0.68%</td><td>48.91 ± 0.67%</td><td>72.59 ± 0.67%</td><td>58.36 ± 0.68%</td></tr><tr><td></td><td>FT</td><td>70.37 ± 0.68%</td><td>47.68 ± 0.63%</td><td>74.48± 0.70%</td><td>57.85 ± 0.68%</td></tr><tr><td></td><td>LFT</td><td>73.11 ± 0.68%</td><td>49.88 ± 0.67%</td><td>77.05 ± 0.65%</td><td>58.84± 0.66%</td></tr></table>
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 3: T-SNE visualization of the image features extracted from tasks in different domains. We show the t-SNE visualization of the features extracted by the (a) original feature encoder $E$ , (b) feature encoder with pre-determined feature-wise transformation layers, and (c) feature encoder with learning-to-learned feature-wise transformation.
|
| 166 |
+
|
| 167 |
+
Note since the proposed learning-to-learn approach optimizes the hyper-parameters via stochastic gradient descent, it may not find the global minimum that achieves the best performance. It is certainly possible to manually find another set of hyper-parameter setting that achieves better performance. However, this requires meticulous and computationally expensive hyper-parameter tuning. Specifically, the dimension of the hyper-parameters $\theta _ { \gamma }$ and $\theta _ { \beta }$ is $c _ { i } \times 1 \times 1$ for the $i$ -th feature-wise transformation layer in the feature encoder, where $c _ { i }$ is the number of feature channels. As there are $n$ feature-wise transformation layers in the feature encoder $E$ , we need to perform the hyperparameter search in a $( c _ { 1 } + c _ { 2 } \cdot \cdot \cdot + c _ { n } ) \times 2 \cdot$ -dimensional space. In practice, the dimension of the the search space is 1920.
|
| 168 |
+
|
| 169 |
+
Visualizing feature-wise transformed features. To demonstrate that the proposed feature-wise transformation layers can simulate various feature distributions extracted from the task in different domains, we show the t-SNE visualizations of the image features extracted by the feature encoder in the RelationNet (Sung et al., 2018) model in Figure 3. The model is trained with 5-way 5-shot classification setting on the mini-ImageNet, Cars, Places, and Plantae domains (i.e., corresponding to the fifth block of the second column in Table 2). We observe that the distance between features extracted from different domains becomes smaller with the help of feature-wise transformation layers. Furthermore, the proposed learning-to-learn scheme can further help the feature-wise transformation layers capture the variation of feature distributions from various domains, thus close the domain gap and improve the generalization ability of metric-based models.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 4: Visualization of the feature-wise transformation layers. We show the quartile visualization of the activations softplus $( \theta _ { \gamma } )$ and softplus $\left( \theta _ { \beta } \right)$ from each feature-wise transformation layer that are optimized by the proposed learning-to-learn algorithm.
|
| 173 |
+
|
| 174 |
+
Visualizing feature-wise transformation layers. To better understand how the learned featurewise transformation layers operate, we show the values of the softplus $\left( \boldsymbol { \theta } _ { \gamma } \right)$ and softplus $\left( \boldsymbol { \theta } _ { \gamma } \right)$ in the feature-wise transformation layer. Figure 4 presents the visualization. The values of scaling terms softplus $\left( \boldsymbol { \theta } _ { \gamma } \right)$ tend to become smaller in the deeper layers, particularly for those in the last residual block. On the other hand, the depth of the layer does not seem to have an apparent impact on the distributions of the bias terms softplus $\left( \theta _ { \beta } \right)$ . The distributions are also different across different metric-based classification methods. These results suggest the importance of the proposed learningto-learn algorithm because there does not exist a set of optimal hyper-parameters of the feature-wise transformation layers which work well with all metric-based approaches.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSIONS
|
| 177 |
+
|
| 178 |
+
We propose a method to effectively enhance metric-based few-shot classification frameworks under domain shifts. The core idea of our method lies in using the feature-wise transformation layer to simulate various feature distributions extracted from the tasks in different domains. We develop a learning-to-learn approach for optimizing the hyper-parameters of the feature-wise transformation layers by simulating the generalization process using multiple seen domains. From extensive experiments, we demonstrate that our technique is applicable to different metric-based few-shot classification algorithms and show consistent improvement over the baselines.
|
| 179 |
+
|
| 180 |
+
# 6 ACKNOWLEDGEMENTS
|
| 181 |
+
|
| 182 |
+
This work is supported in part by the NSF CAREER Grant #1149783, the NSF Grant #1755785, and gifts from Google.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Badour AlBahar and Jia-Bin Huang. Guided image-to-image translation with bi-directional feature transformation. In ICCV, 2019. 4
|
| 187 |
+
|
| 188 |
+
Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using meta-regularization. In NeurIPS, 2018. 4
|
| 189 |
+
|
| 190 |
+
Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. In NIPS, 2011. 2, 4
|
| 191 |
+
|
| 192 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In CVPR, 2017. 3, 7
|
| 193 |
+
Fabio Maria Cariucci, Lorenzo Porzi, Barbara Caputo, Elisa Ricci, and Samuel Rota Bulo. Autodial:\` Automatic domain alignment layers. In ICCV, 2017. 4
|
| 194 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Wang, and Jia-Bin Huang. A closer look at few-shot classification. In ICLR, 2019a. 1, 3, 7, 15
|
| 195 |
+
Yuhua Chen, Wen Li, Christos Sakaridis, Dengxin Dai, and Luc Van Gool. Domain adaptive faster r-cnn for object detection in the wild. In CVPR, 2018. 2, 3
|
| 196 |
+
Yun-Chun Chen, Yen-Yu Lin, Ming-Hsuan Yang, and Jia-Bin Huang. Crdoco: Pixel-level domain transfer with cross-domain consistency. In CVPR, 2019b. 3
|
| 197 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation policies from data. In CVPR, 2019. 4
|
| 198 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In CVPR, 2009. 15
|
| 199 |
+
Terrance DeVries and Graham W Taylor. Dataset augmentation in feature space. In ICLR Workshop, 2017a. 4
|
| 200 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017b. 4
|
| 201 |
+
Nanqing Dong and Eric P Xing. Domain adaption in one-shot learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2018. 2, 3
|
| 202 |
+
Vincent Dumoulin, Jonathon Shlens, and Manjunath Kudlur. A learned representation for artistic style. In ICLR, 2017. 4
|
| 203 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017. 3, 4
|
| 204 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. JMLR, 17(1):2096–2030, 2016. 3
|
| 205 |
+
Victor Garcia and Joan Bruna. Few-shot learning with graph neural networks. In ICLR, 2018. 1, 3, 5, 7, 8, 15
|
| 206 |
+
Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional networks. In NeurIPS, 2018. 4
|
| 207 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018. 8, 15
|
| 208 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 7, 15
|
| 209 |
+
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. 15
|
| 210 |
+
Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei A. Efros, and Trevor Darrell. Cycada: Cycle consistent adversarial domain adaptation. In ICML, 2018. 3
|
| 211 |
+
Han-Kai Hsu, Chun-Han Yao, Yi-Hsuan Tsai, Wei-Chih Hung, Hung-Yu Tseng, Maneesh Singh, and Ming-Hsuan Yang. Progressive domain adaptation for object detection. In WACV, 2020. 3
|
| 212 |
+
Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017. 4
|
| 213 |
+
|
| 214 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. 4
|
| 215 |
+
|
| 216 |
+
Aditya Khosla, Tinghui Zhou, Tomasz Malisiewicz, Alexei A Efros, and Antonio Torralba. Undoing the damage of dataset bias. In ECCV, 2012. 4
|
| 217 |
+
|
| 218 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Workshop, 2015. 3
|
| 219 |
+
|
| 220 |
+
Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition, 2013. 7, 15
|
| 221 |
+
|
| 222 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. 1
|
| 223 |
+
|
| 224 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. In ICLR, 2017. 4
|
| 225 |
+
|
| 226 |
+
Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Kumar Singh, and Ming-Hsuan Yang. Diverse image-to-image translation viadisentangled representations. In ECCV, 2018. 3
|
| 227 |
+
|
| 228 |
+
Hsin-Ying Lee, Hung-Yu Tseng, Qi Mao, Jia-Bin Huang, Yu-Ding Lu, Maneesh Kumar Singh, and Ming-Hsuan Yang. Drit++: Diverse image-to-image translation viadisentangled representations. IJCV, 2020. 4
|
| 229 |
+
|
| 230 |
+
Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In CVPR, 2019. 8, 18
|
| 231 |
+
|
| 232 |
+
Joseph Lemley, Shabab Bazrafkan, and Peter Corcoran. Smart augmentation learning an optimal data augmentation strategy. IEEE Access, 5:5858–5869, 2017. 4
|
| 233 |
+
|
| 234 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In ICCV, 2017a. 4
|
| 235 |
+
|
| 236 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Metalearning for domain generalization. In AAAI, 2018a. 4
|
| 237 |
+
|
| 238 |
+
Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In CVPR, 2018b. 4
|
| 239 |
+
|
| 240 |
+
Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. In ICLR, 2017b. 4
|
| 241 |
+
|
| 242 |
+
Yiying Li, Yongxin Yang, Wei Zhou, and Timothy M Hospedales. Feature-critic networks for heterogeneous domain generalization. In ICML, 2019. 2, 4
|
| 243 |
+
|
| 244 |
+
Y. Lifchitz, Y. Avrithis, S. Picard, and A. Bursuc. Dense classification and implanting for few-shot learning. In CVPR, 2019. 3, 8, 15, 18
|
| 245 |
+
|
| 246 |
+
Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain generalization via invariant ¨ feature representation. In ICML, 2013. 4
|
| 247 |
+
|
| 248 |
+
Li Niu, Wen Li, and Dong Xu. Multi-view domain generalization for visual recognition. In ICCV, 2015a. 4
|
| 249 |
+
|
| 250 |
+
Li Niu, Wen Li, and Dong Xu. Visual recognition by learning from web data: A weakly supervised domain generalization approach. In ICCV, 2015b. 4
|
| 251 |
+
|
| 252 |
+
Boris Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. Tadam: Task dependent adaptive ´ metric for improved few-shot learning. In NeurIPS, 2018. 1, 3, 4, 18
|
| 253 |
+
|
| 254 |
+
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345–1359, 2010. 2, 3
|
| 255 |
+
|
| 256 |
+
Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In CVPR, 2019. 4
|
| 257 |
+
|
| 258 |
+
Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning. arXiv preprint arXiv:1712.04621, 2017. 4
|
| 259 |
+
|
| 260 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In CVPR, 2018. 18
|
| 261 |
+
|
| 262 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017. 4, 5, 7, 15, 17
|
| 263 |
+
|
| 264 |
+
Danilo Jimenez Rezende, Shakir Mohamed, Ivo Danihelka, Karol Gregor, and Daan Wierstra. Oneshot generalization in deep generative models. JMLR, 48, 2016. 3
|
| 265 |
+
|
| 266 |
+
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. 3, 8, 15, 18
|
| 267 |
+
|
| 268 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In ICML, 2016. 3
|
| 269 |
+
|
| 270 |
+
Shiv Shankar, Vihari Piratla, Soumen Chakrabarti, Siddhartha Chaudhuri, Preethi Jyothi, and Sunita Sarawagi. Generalizing across domains via cross-gradient training. In ICLR, 2018. 4
|
| 271 |
+
|
| 272 |
+
Leon Sixt, Benjamin Wild, and Tim Landgraf. Rendergan: Generating realistic labeled data. Frontiers in Robotics and AI, 5:66, 2018. 4
|
| 273 |
+
|
| 274 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NIPS, 2017. 1, 3
|
| 275 |
+
|
| 276 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014. 4
|
| 277 |
+
|
| 278 |
+
Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In CVPR, 2018. 1, 3, 5, 7, 9, 15
|
| 279 |
+
|
| 280 |
+
Toan Tran, Trung Pham, Gustavo Carneiro, Lyle Palmer, and Ian Reid. A bayesian data augmentation approach for learning deep models. In NIPS, 2017. 4
|
| 281 |
+
|
| 282 |
+
Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. Metadataset: A dataset of datasets for learning to learn from few examples. In ICLR, 2020. 3
|
| 283 |
+
|
| 284 |
+
Yi-Hsuan Tsai, Wei-Chih Hung, Samuel Schulter, Kihyuk Sohn, Ming-Hsuan Yang, and Manmohan Chandraker. Learning to adapt structured output space for semantic segmentation. In CVPR, 2018. 3
|
| 285 |
+
|
| 286 |
+
Hung-Yu Tseng, Shalini De Mello, Jonathan Tremblay, Sifei Liu, Stan Birchfield, Ming-Hsuan Yang, and Jan Kautz. Few-shot viewpoint estimation. In BMVC, 2019. 3
|
| 287 |
+
|
| 288 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In CVPR, 2017. 2, 3
|
| 289 |
+
|
| 290 |
+
Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In CVPR, 2018. 7, 15
|
| 291 |
+
|
| 292 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NIPS, 2016. 1, 3, 5, 7, 15
|
| 293 |
+
|
| 294 |
+
Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. In NeurIPS, 2018. 4
|
| 295 |
+
|
| 296 |
+
Risto Vuorio, Shao-Hua Sun, Hexiang Hu, and Joseph J. Lim. Multimodal model-agnostic metalearning via task-aware modulation. In NeurIPS, 2019. 3
|
| 297 |
+
Li Wan, Matthew Zeiler, Sixin Zhang, Yann Le Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In ICML, 2013. 4
|
| 298 |
+
P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech-UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010. 5, 7, 15
|
| 299 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018. 4
|
| 300 |
+
Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. TPAMI, 2017. 7, 15
|
| 301 |
+
|
| 302 |
+
# A APPENDIX
|
| 303 |
+
|
| 304 |
+
# A.1 DATASET COLLECTION
|
| 305 |
+
|
| 306 |
+
We use five few-shot classification datasets in all of our experiments: mini-ImageNet, CUB, Cars, Places, and Plantae. We follow the setting in Ravi & Larochelle (2017) and Hilliard et al. (2018) to process mini-ImageNet and CUB datasets. As for the other datasets, we manually process the dataset by random splitting the classes. The number of training, validation, testing categories for each dataset are summarized in Table 3.
|
| 307 |
+
|
| 308 |
+
Table 3: Summarization of the datasets (domains). We additionally collect and split the Cars, Places, and Plantae datasets.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Datasets</td><td>mini-ImageNet</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>Source</td><td>Deng et al. (2009)</td><td>Welinder et al. (2010)</td><td>Krause et al. (2013)</td><td>Zhou et al. (2017)</td><td>Van Horn et al. (2018)</td></tr><tr><td># Training categories</td><td>64</td><td>100</td><td>98</td><td>183</td><td>100</td></tr><tr><td># Validation categories</td><td>16</td><td>50</td><td>49</td><td>91</td><td>50</td></tr><tr><td># Testing categories</td><td>20</td><td>50</td><td>49</td><td>91</td><td>50</td></tr><tr><td>Split setting</td><td>Ravi & Larochelle (2017)</td><td>Hilliard et al. (2018)</td><td>randomly split</td><td>randomly split</td><td>randomly split</td></tr></table>
|
| 311 |
+
|
| 312 |
+
# A.2 ADDITIONAL IMPLEMENTATION DETAILS
|
| 313 |
+
|
| 314 |
+
We use the implementation and adopt the setting of hyper-parameters from Chen et al. (Chen et al., 2019a).4 We train the metric-based model and feature-wise transformation layers with a learning rate of 0.001 and 40, 000 iterations. For feature-wise transformation layers, we apply L2 regularization with a weight of $1 0 ^ { - 8 }$ . The number of inner iterations adopted in the learning-to-learn scheme is set to be 1.
|
| 315 |
+
|
| 316 |
+
Matching Network. We cannot utilize the MatchingNet implementation from Chen et al. (Chen et al., 2019a) since they applied the Pytorch built-in LSTM module, which does not support secondorder backpropagation. Without the second-order backpropagation, we are unable to optimize the feature augmentation layers using the proposed learning-to-learn algorithm. As a result, we reimplement the LSTM module for the MatchingNet model. To verify the correctness of our implementation, we evaluate the 5-way 5-shot performance with the ResNet-10 (He et al., 2016) backbone network on the mini-ImageNet dataset (Ravi & Larochelle, 2017). Our implementation reports $6 8 . 8 8 \pm 0 . 6 9 \%$ accuracy, which is similar to the result (i.e., $6 8 . 8 2 \pm 0 . 6 5 \%$ ) reported by Chen et al. (Chen et al., 2019a). We make the source code and datasets public available to foster future progress in this field.5
|
| 317 |
+
|
| 318 |
+
# A.3 ADDITIONAL EXPERIMENTAL RESULTS
|
| 319 |
+
|
| 320 |
+
Ablation study on pre-trained metric encoder. As described in Section 4.1, we pre-trained the metric encoder $E$ by minimizing the cross-entropy classification loss using the 64 training categories from the mini-ImageNet dataset. To understand the impact of the pre-training, we conduct an ablation study using the leave-one-out experiment illustrated in Section 4.3. As shown in Table 4, pre-training the metric encoder $E$ substantially improve the few-shot classification performance of metric-based frameworks. Note that such a pre-training process is also adopted by several recent frameworks (Rusu et al., 2019; Gidaris & Komodakis, 2018; Lifchitz et al., 2019) to boost the fewshot classification performance.
|
| 321 |
+
|
| 322 |
+
Number of ways in testing stage. In this experiment, we consider a practical scenario that the number of ways $N _ { w }$ in the testing phase is different from that in the training stage. Since the GNN (Garcia & Bruna, 2018) framework requires the numbers of ways to be consistent in the training and testing, we evaluate the MatchingNet (Vinyals et al., 2016) and RelationNet (Sung et al., 2018) model with this setting. Table 5 reports the performances of the models trained on the miniImageNet, Cars, Places, and Plantae domains under the 5-way 5-shot setting (i.e., corresponding to the fourth and fifth block of the second column in Table 2). Our proposed learning-to-learned feature-wise transformation layers are capable of improving the generalization of metric-based models to the unseen domain under various numbers of ways in the testing stage.
|
| 323 |
+
|
| 324 |
+
Table 4: Ablation study on pre-trained metric encoder. We conduct leave-one-out setting to select the unseen domain to study the effectiveness of pre-training the feature encoder $E$ on the mini-ImageNet dataset.
|
| 325 |
+
|
| 326 |
+
<table><tr><td>1-Shot</td><td>Pre-trained</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>MatchingNet</td><td>-</td><td>37.37 ± 0.55%</td><td>30.60 ± 0.51%</td><td>41.42±0.59%</td><td>31.93 ± 0.51%</td></tr><tr><td></td><td>√</td><td>37.90 ± 0.55%</td><td>28.96±0.45%</td><td>49.01 ± 0.65%</td><td>33.21 ± 0.51%</td></tr><tr><td>RelationNet</td><td>1</td><td>38.46 ± 0.56%</td><td>30.77 ± 0.51%</td><td>37.49 ± 0.58%</td><td>32.86 ±0.53%</td></tr><tr><td></td><td>√</td><td>44.33 ± 0.59%</td><td>29.53± 0.45%</td><td>47.76 ± 0.63%</td><td>33.76 ± 0.52%</td></tr><tr><td>GNN</td><td>1</td><td>37.21 ± 0.63%</td><td>29.01±0.56%</td><td>36.06 ± 0.62%</td><td>34.99 ±0.63%</td></tr><tr><td></td><td>√</td><td>49.46±0.73%</td><td>32.95±0.56%</td><td>51.39±0.80%</td><td>37.15 ±0.60%</td></tr><tr><td>5-Shot</td><td>Pre-trained</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>MatchingNet</td><td>1</td><td>49.83 ± 0.55%</td><td>39.41± 0.53%</td><td>59.18± 0.60%</td><td>43.53 ± 0.53%</td></tr><tr><td></td><td>√</td><td>51.92 ± 0.80%</td><td>39.87 ± 0.51%</td><td>61.82 ± 0.57%</td><td>47.29 ± 0.51%</td></tr><tr><td>RelationNet</td><td>-</td><td>55.85± 0.55%</td><td>42.55 ± 0.58%</td><td>59.85± 0.54%</td><td>45.24± 0.55%</td></tr><tr><td></td><td>√</td><td>62.13 ± 0.74%</td><td>40.64± 0.54%</td><td>64.34± 0.57%</td><td>46.29 ±0.56%</td></tr><tr><td>GNN</td><td></td><td>60.13 ± 0.64%</td><td>43.60 ± 0.67%</td><td>56.67 ± 0.64%</td><td>49.17 ±0.62%</td></tr><tr><td></td><td></td><td>69.26 ± 0.68%</td><td>48.91 ± 0.67%</td><td>72.59 ± 0.67%</td><td>58.36 ± 0.68%</td></tr></table>
|
| 327 |
+
|
| 328 |
+
Table 5: Few-shot classification results under various numbers of ways in testing stage. We compare the 5-shot performance under various number of ways in the testing phase. The CUB dataset is select as the testing (unseen) domain. All the models are trained with 5-way 5-shot setting.
|
| 329 |
+
|
| 330 |
+
<table><tr><td>5-Shot</td><td></td><td>CUB 2-way</td><td>CUB 5-way</td><td>CUB 10-way</td><td>CUB 20-way</td></tr><tr><td>MatchingNet</td><td>1</td><td>78.46±0.78%</td><td>51.92 ± 0.80%</td><td>38.22 ± 0.38%</td><td>26.17±0.24%</td></tr><tr><td></td><td>FT</td><td>80.74±0.77%</td><td>56.29 ±0.80%</td><td>41.09 ± 0.39%</td><td>29.19 ±0.24%</td></tr><tr><td></td><td>LFT</td><td>83.88± 0.72%</td><td>61.41 ± 0.57%</td><td>45.69 ± 0.39%</td><td>32.81 ± 0.23%</td></tr><tr><td>RelationNet</td><td>-</td><td>84.25± 0.72%</td><td>62.13± 0.74%</td><td>47.15± 0.40%</td><td>34.52± 0.24%</td></tr><tr><td></td><td>FT</td><td>85.48 ± 0.69%</td><td>63.64± 0.77%</td><td>48.35± 0.38%</td><td>35.30± 0.24%</td></tr><tr><td></td><td>LFT</td><td>85.44±0.72%</td><td>64.99 ± 0.54%</td><td>49.90 ± 0.40%</td><td>37.20 ± 0.25%</td></tr></table>
|
| 331 |
+
|
| 332 |
+
Pre-determined hyper-parameters of feature-wise transformation layers. We demonstrate the difficulty to hand-tune the hyper-parameters of the proposed feature-wise transformation layers in this experiment. Different from the setting described in Section 4.2, we set the hyper-parameters $\theta _ { \gamma }$ and $\theta _ { \beta }$ in all feature-wise transformation layers to be 1. The model is trained under 5-way setting using the mini-ImageNet domain, and evaluate it on the other domains. We report the 1- shot and 5-shot performance in Table 6. We denote applying feature-wise transformation layers with $\{ \theta _ { \gamma } , \theta _ { \beta } \} \ = \ \{ 0 . 3 , 0 . 5 \}$ as FT and those with $\{ \theta _ { \gamma } , \theta _ { \beta } \} \ = \ \{ 1 , 1 \}$ as $\mathrm { F T ^ { * } }$ . We observe that the metric-based models applied with FT perform favorably against to those applied with $\mathrm { F T ^ { * } }$ . In several cases, applying $\mathrm { F T ^ { * } }$ even yields inferior results compared to the original training without the feature-wise transformation layers. This suggests the difficulty of hand-tuning the hyper-parameters and the importance of the proposed learning-to-learn scheme for optimizing the hyper-parameters of the feature-wise transformation layers.
|
| 333 |
+
|
| 334 |
+
Hyper-parameter initialization for learning-to-learn. For all the experiments, we initialize the parameters $\theta _ { \gamma }$ and $\theta _ { \beta }$ to 0.3 and 0.5, which we empirically determine in Section 4.2, to train the feature-wise transformation layers. In practice, we find that the cross-domain performance is not sensitive as long as the initialized values are within the same order (e.g., 0.1 and 0.3). Here we report the results of training the RelationNet with the initialization $\{ \theta _ { \gamma } , \bar { \theta } _ { \beta } \} = \{ 0 . 1 , 0 . 3 \}$ . In this experiment, we use the CUB dataset as the unseen domain for evaluation and conduct the training described in Algorithm 1. The 5-way 5-shot classification accuracy on the CUB dataset is $6 4 . 7 9 \pm$ $0 . 5 5 \%$ , which is similar to the one we report in Table 2 ( i.e., $6 4 . 9 9 \pm 0 . 5 4 \%$ ).
|
| 335 |
+
|
| 336 |
+
Table 6: Few-shot classification results by applying different pre-determined hyper-parameters of feature-wise transformation layers. We train the model on the mini-ImageNet with a different set of pre-determined hyper-parameters of feature-wise transformation layers. FT and $\mathrm { F T ^ { * } }$ indicate that we apply the feature-wise transformation layers with hyper-parameters $\{ \theta _ { \gamma } , \theta _ { \beta } \}$ to be $\{ 0 . 3 , 0 . 5 \}$ and $\{ 1 , 1 \}$ , respectively.
|
| 337 |
+
|
| 338 |
+
<table><tr><td>1-Shot</td><td></td><td>mini-ImageNet</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td rowspan="2">MatchingNet</td><td>FT</td><td>58.76±0.61%</td><td>36.61 ± 0.53%</td><td>29.82±0.44%</td><td>51.07 ± 0.68%</td><td>33.48±0.50%</td></tr><tr><td>FT*</td><td>51.66 ± 0.64%</td><td>31.74 ± 0.51%</td><td>27.08 ±0.41%</td><td>45.04± 0.64%</td><td>28.73±0.42%</td></tr><tr><td rowspan="2">RelationNet</td><td>FT</td><td>58.64±0.85%</td><td>44.07 ±0.77%</td><td>28.63 ±0.59%</td><td>50.68 ± 0.87%</td><td>33.14±0.62%</td></tr><tr><td>FT*</td><td>57.45±0.66%</td><td>40.20± 0.53%</td><td>29.15±0.45%</td><td>49.40 ± 0.64%</td><td>33.21±0.47%</td></tr><tr><td rowspan="2">GNN</td><td>FT</td><td>66.32 ±0.80%</td><td>47.47 ± 0.75%</td><td>31.61 ± 0.53%</td><td>55.77 ±0.79%</td><td>35.95 ±0.58%</td></tr><tr><td>FT*</td><td>62.63±0.76%</td><td>44.61 ± 0.66%</td><td>31.56 ±0.52%</td><td>53.39 ±0.74%</td><td>36.73 ±0.57%</td></tr><tr><td rowspan="2">5-Shot</td><td></td><td>mini-ImageNet</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>FT</td><td>72.53 ±0.69%</td><td>55.23± 0.83%</td><td>41.24± 0.65%</td><td>64.55 ± 0.75%</td><td>41.69 ± 0.63%</td></tr><tr><td rowspan="2">MatchingNet RelationNet</td><td>FT*</td><td>64.93±0.60%</td><td>42.83 ±0.61%</td><td>32.19 ±0.48%</td><td>59.47 ±0.63%</td><td>39.61±0.49%</td></tr><tr><td>FT</td><td>73.78 ±0.64%</td><td>59.46 ±0.71%</td><td>39.91 ± 0.69%</td><td>66.28 ±0.72%</td><td>45.08 ±0.59%</td></tr><tr><td rowspan="2"></td><td>FT*</td><td>72.79 ±0.64%</td><td>59.18 ±0.57%</td><td>40.54 ±0.54%</td><td>65.73 ±0.52%</td><td>43.64 ±0.49%</td></tr><tr><td>FT</td><td>81.98 ± 0.55%</td><td>66.98 ±0.68%</td><td>44.90 ± 0.64%</td><td>73.94 ± 0.67%</td><td>53.85 ±0.62%</td></tr><tr><td rowspan="2">GNN</td><td>FT*</td><td>82.40±0.58%</td><td>66.33 ±0.73%</td><td>47.63 ± 0.64%</td><td>75.48 ± 0.65%</td><td>51.92 ±0.59%</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 339 |
+
|
| 340 |
+
Table 7: Few-shot classification results by applying the learning-to-learn approach trained with a single seen domain. We attempt to conduct the proposed learning-to-learn trainin with as singe seen domain, denoted as $\mathrm { L F T ^ { * } }$ . We train the model using the mini-ImageNet dataset and report the 5-way 5-shot classification accuracy.
|
| 341 |
+
|
| 342 |
+
<table><tr><td>5-way 5-Shot</td><td>mini-ImageNet</td><td></td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td>RelationNet</td><td>FT</td><td>73.78±0.64%</td><td>59.46±0.71%</td><td>39.91± 0.69%</td><td>66.28 ±0.72%</td><td>45.08 ±0.59%</td></tr><tr><td>RelationNet</td><td>LFT*</td><td>73.50 ±0.50%</td><td>58.19 ±0.52%</td><td>39.35 ±0.54%</td><td>66.17 ± 0.57%</td><td>46.75 ±0.51%</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Learning-to-learn using a single domain. The proposed learning-to-learn method requires multiple domains for training. Here we apply the learning-to-learn method based on one single domain. More specifically, we randomly sample two different tasks from the mini-ImageNet dataset in each iteration of the training process described in Algorithm 1. One task serves as the pseudo-seen task, while the other one serves as the pseudo-unseen task. We train the RelationNet model with the above-mentioned setting on 5-way 5-shot classification using the mini-ImageNet dataset only. As shown in Table 7, the performance improvement of the RelationNet model is not significant compared to the model trained with pre-determined hyper-parameters $\{ \theta _ { \gamma } , \theta _ { \beta } \} = \{ 0 . 3 , 0 . 5 \}$ . This suggests that utilizing one single domain for learning the feature-wise transformation is not as effective as that using multiple domains (demonstrated in Table 2). The reason is that during the training phase, the discrepancy of the feature distributions extracted from the psudo-seen and pseudo-unseen tasks is not as significant since these two tasks are sampled from the same domain. As a result, the hyper-parameters $\{ \theta _ { \gamma } , \theta _ { \beta } \}$ cannot be effectively optimized to capture the variation of feature distributions sampled from various domains.
|
| 345 |
+
|
| 346 |
+
Comparison with the state-of-the-art few-shot classification on the mini-ImageNet. We compare the metric-based frameworks applied with the proposed feature-wise transformation layers to the state-of-the-art few-shot classification methods in Table 8. In this experiment, we train the model with the pre-determined hyper-parameters of feature-wise transformation layers on the training set of the mini-ImageNet (Ravi & Larochelle, 2017) dataset. Note that we do not use the learned version of the feature-wise transformation layers in the training to ensure fair comparison. Combining Table 4 and Table 8, we observe that the metric-based frameworks train with 1) pre-trained feature encoder, and 2) feature-wise transformation layers with carefully hand-tuned hyper-parameters can demonstrate competitive performance.
|
| 347 |
+
|
| 348 |
+
Table 8: Comparison to the state-of-the-art few-shot classification algorithms. We compare the metric-based frameworks applied with the proposed feature-wise transformation layers using predetermined hyper-parameter $\mathsf { \bar { \{ \theta _ { \gamma } , \theta _ { \beta } \} } = \{ 0 . \bar { 3 } , \bar { 0 . } 5 \} }$ (denoted as FT) to other state-of-the-art few-shot classification methods. Note that all the methods are trained only on the mini-ImageNet dataset. To ensure fair comparisons with other methods, we are unable to use the learned version of the featurewise transformation layers described in Section 3.3. By augmenting existing metric-based few-shot classification models with the proposed feature-wise transformation layer, we obtain competitive performance when compared with many recent and more complicated methods. The best results in each block are highlighted in bold.
|
| 349 |
+
|
| 350 |
+
<table><tr><td>backbone</td><td colspan="2">method</td><td> 5-way 1-shot</td><td> 5-way 5-shot</td></tr><tr><td rowspan="4">ResNet-12</td><td colspan="2">TADAM (Oreshkin et al., 2018)</td><td>58.50 ± 0.30%</td><td>76.70± 0.30%</td></tr><tr><td colspan="2">DC (Lifchitz et al., 2019)</td><td>62.53 ± 0.19%</td><td>78.95 ± 0.13%</td></tr><tr><td colspan="2">DC + IMP (Lifchitz et al., 2019)</td><td>=</td><td>79.77 ± 0.19%</td></tr><tr><td colspan="2">MetaOptNet-SVM-trainval (Lee et al., 2019)</td><td>64.09 ± 0.62%</td><td>80.00 ±0.45%</td></tr><tr><td rowspan="2">WRN-28</td><td colspan="2">Qiao et al. (2018)</td><td>59.60 ± 0.41%</td><td>77.74±0.19%</td></tr><tr><td colspan="2">LEO (Rusu et al., 2019)</td><td>61.76 ± 0.08%</td><td>77.59 ± 0.12%</td></tr><tr><td rowspan="5">ResNet-10</td><td rowspan="2">MatchingNet</td><td></td><td>59.10 ± 0.64%</td><td>70.96 ± 0.65%</td></tr><tr><td>FT</td><td>58.76 ± 0.61%</td><td>72.53 ± 0.69%</td></tr><tr><td rowspan="3">RelationNet</td><td>-</td><td>57.80 ± 0.88%</td><td>71.00 ± 0.69%</td></tr><tr><td>FT</td><td>58.64± 0.85%</td><td>73.78 ± 0.64%</td></tr><tr><td>=</td><td>60.77 ± 0.75%</td><td>80.87 ± 0.56%</td></tr><tr><td colspan="2">GNN</td><td>FT</td><td>66.32 ± 0.80%</td><td>81.98 ± 0.55%</td></tr></table>
|
| 351 |
+
|
| 352 |
+
Table 9: Evaluation with the state-of-the-art approach under the cross-domain setting. We evaluate the metric-based frameworks with the proposed feature-wise transformation layers using pre-determined hyper-parameter $\{ \theta _ { \gamma } , \theta _ { \beta } \} = \{ 0 . { \overset { \textstyle } { 3 } } , { \overset { \textstyle } { 0 . } { 5 } } \}$ (denoted as FT) against the state-of-the-art MetaOptNet-SVM-trainval Lee et al. (2019) method. Note that all the methods are trained only on the mini-ImageNet dataset. To ensure fair comparisons with other methods, we do not use the learned version of the feature-wise transformation layers described in Section 3.3. By augmenting the existing metric-based few-shot classification models with the proposed feature-wise transformation layer, we obtain competitive performance when compared with recent and more complicated methods. The best results are highlighted in bold.
|
| 353 |
+
|
| 354 |
+
<table><tr><td colspan="2">method</td><td>CUB</td><td>Cars</td><td>Places</td><td>Plantae</td></tr><tr><td colspan="2">MetaOptNet-SVM-trainval</td><td>54.67 ± 0.56%</td><td>45.90± 0.49%</td><td>65.83± 0.57%</td><td>46.48± 0.52%</td></tr><tr><td rowspan="2">MatchingNet</td><td>1</td><td>51.37±0.77%</td><td>38.99 ±0.64%</td><td>63.16± 0.77%</td><td>46.53 ± 0.68%</td></tr><tr><td>FT</td><td>55.23±0.83%</td><td>41.24 ± 0.65%</td><td>64.55 ± 0.75%</td><td>41.69 ± 0.63%</td></tr><tr><td rowspan="2">RelationNet</td><td>-</td><td>57.77 ± 0.69%</td><td>37.33 ± 0.68%</td><td>63.32 ± 0.76%</td><td>44.00 ± 0.60%</td></tr><tr><td>FT</td><td>59.46 ± 0.71%</td><td>39.91 ±0.69%</td><td>66.28±0.72%</td><td>45.08±0.59%</td></tr><tr><td rowspan="2">GNN</td><td>-</td><td>62.25 ± 0.65%</td><td>44.28 ± 0.63%</td><td>70.84 ±0.65%</td><td>52.53±0.59%</td></tr><tr><td>FT</td><td>66.98±0.68%</td><td>44.90 ± 0.64%</td><td>73.94± 0.67%</td><td>53.85±0.62%</td></tr></table>
|
| 355 |
+
|
| 356 |
+
Comparison to the state-of-the-art few-shot classification under domain shift. We evaluate the metric-based frameworks with the proposed feature-wise transformation layers and the state-ofthe-art MetaOptNet approach Lee et al. (2019). We use the model trained on the mini-ImageNet dataset provided by the authors for the evaluation on the other datasets.6 As shown in Table 9, while the MetaOptNet method achieves state-of-the-art performance on the mini-ImageNet dataset, this approach also suffers from the domain shifts in the cross-domain setting. Training the GNN framework with the pre-trained feature encoder and the proposed feature-wise transformation layers performs favorably against the MetaOptNet method under the cross-domain setting.
|
md/train/SkEYojRqtm/SkEYojRqtm.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REPRESENTATION DEGENERATION PROBLEM IN TRAINING NATURAL LANGUAGE GENERATION MODELS
|
| 2 |
+
|
| 3 |
+
Jun $\mathbf { G a o } ^ { 1 , 2 : }$ ∗, Di $\mathbf { H e ^ { 3 } }$ , $\mathbf { X } \mathbf { u } \ \mathbf { T a n } ^ { 4 }$ , Tao $\mathbf { Q } \mathbf { i n } ^ { 4 }$ , Liwei Wang3,5 & Tie-Yan Liu4
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Toronto
|
| 6 |
+
jungao@cs.toronto.edu
|
| 7 |
+
2Vector Institute, Canada
|
| 8 |
+
3Key Laboratory of Machine Perception, MOE, School of EECS, Peking University
|
| 9 |
+
di he@pku.edu.cn, wanglw@cis.pku.edu.cn
|
| 10 |
+
4Microsoft Research
|
| 11 |
+
{xuta,taoqin,tyliu}@microsoft.com
|
| 12 |
+
5Center for Data Science, Peking University, Beijing Institute of Big Data Research
|
| 13 |
+
|
| 14 |
+
# ABSTRACT
|
| 15 |
+
|
| 16 |
+
We study an interesting problem in training neural network-based models for natural language generation tasks, which we call the representation degeneration problem. We observe that when training a model for natural language generation tasks through likelihood maximization with the weight tying trick, especially with big training datasets, most of the learnt word embeddings tend to degenerate and be distributed into a narrow cone, which largely limits the representation power of word embeddings. We analyze the conditions and causes of this problem and propose a novel regularization method to address it. Experiments on language modeling and machine translation show that our method can largely mitigate the representation degeneration problem and achieve better performance than baseline algorithms.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
Neural Network (NN)-based algorithms have made significant progresses in natural language generation tasks, including language modeling (Kim et al., 2016; Jozefowicz et al., 2016), machine translation (Wu et al., 2016; Britz et al., 2017; Vaswani et al., 2017; Gehring et al., 2017) and dialog systems (Shang et al., 2015). Despite the huge variety of applications and model architectures, natural language generation mostly relies on predicting the next word given previous contexts and other conditional information. A standard approach is to use a deep neural network to encode the inputs into a fixed-size vector referred as hidden state1, which is then multiplied by the word embedding matrix (Vaswani et al., 2017; Merity et al., 2018; Yang et al., 2018; Press & Wolf, 2017). The output logits are further consumed by the softmax function to give a categorical distribution of the next word. Then the model is trained through likelihood maximization.
|
| 21 |
+
|
| 22 |
+
While studying the learnt models for language generation tasks, we observe some interesting and surprising phenomena. As the word embedding matrix is tied with the softmax parameters (Vaswani et al., 2017; Merity et al., 2018; Inan et al., 2017; Press & Wolf, 2017), it has a dual role in the model, serving as the input in the first layer and the weights in the last layer. Given its first role as input word embedding, it should contain rich semantic information that captures the given context which will be further used for different tasks. Given its role as output softmax matrix, it should have enough capacity to classify different hidden states into correct labels. We compare it with word embeddings trained from Word2Vec (Mikolov et al., 2013) and the parameters in the softmax layer of a classical classification task (we refer it as categorical embedding). As shown in Figure 1, the word embeddings learnt from Word2Vec (Figure 1(b)) and the softmax parameters learnt from the classification task (Figure 1(c)) are diversely distributed around the origin using SVD projection; in contrast, the word embeddings in our studied model (Figure 1(a)) degenerated into a narrow cone. Furthermore, we find the embeddings of any two words in our studied models are positively correlated. Such phenomena are very different from those in other tasks and deteriorate model’s capacity. As the role of the softmax layer, those parameters cannot lead to a large margin prediction for good generalization. As the role of word embeddings, the parameters do not have enough capacity to model the diverse semantics in natural languages (Yang et al., 2018; McCann et al., 2017).
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: 2D visualization. (a). Visualization of word embeddings trained from vanilla Transformer (Vaswani et al., 2017) in English German translation task. (b). Visualization of word embeddings trained from Word2Vec (Mikolov et al., 2013). (c). Visualization of hidden states and category embedding of a classification task, where different colors stand for different categories and the blue triangles denote for category embeddings.
|
| 26 |
+
|
| 27 |
+
We call the problem described above the representation degeneration problem. In this paper, we try to understand why the problem happens and propose a practical solution to address it.
|
| 28 |
+
|
| 29 |
+
We provide some intuitive explanation and theoretical justification for the problem. Intuitively speaking, during the training process of a model with likelihood loss, for any given hidden state, the embedding of the corresponding ground-truth word will be pushed towards the direction of the hidden state in order to get a larger likelihood, while the embeddings of all other words will be pushed towards the negative direction of the hidden state to get a smaller likelihood. As in natural language, word frequency is usually very low comparing to the size of a large corpus, the embedding of the word will be pushed towards the negative directions of most hidden states which drastically vary. As a result, the embeddings of most words in the vocabulary will be pushed towards similar directions negatively correlated with most hidden states and thus are clustered together in a local region of the embedding space.
|
| 30 |
+
|
| 31 |
+
From the theoretical perspective, we first analyze the extreme case of non-appeared words. We prove that the representation degeneration problem is related to the structure of hidden states: the degeneration appears when the convex hull of the hidden states does not contain the origin and such condition is likely to happen when training with layer normalization (Ba et al., 2016; Vaswani et al., 2017; Merity et al., 2018). We further extend our study to the optimization of low-frequency words in a more realistic setting. We show that, under mild conditions, the low-frequency words are likely to be trained to be close to each other during optimization, and thus lie in a local region.
|
| 32 |
+
|
| 33 |
+
Inspired by the empirical analysis and theoretical insights, we design a novel way to mitigate the degeneration problem by regularizing the word embedding matrix. As we observe that the word embeddings are restricted into a narrow cone, we try to directly increase the size of the aperture of the cone, which can be simply achieved by decreasing the similarity between individual word embeddings. We test our method on two tasks, language modeling and machine translation. Experimental results show that the representation degeneration problem is mitigated, and our algorithm achieves superior performance over the baseline algorithms, e.g., with 2.0 point perplexity improvement on the WikiText-2 dataset for language modeling and 1.08/0.93 point BLEU improvement on WMT 2014 English-German/German-English tasks for machine translation.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Language modeling and machine translation are important language generation tasks. Language modeling aims at predicting the next token given an (incomplete) sequence of words as context. A popular approach based on neural networks is to map the given context to a real-valued vector as a hidden state, and then pass the hidden state through a softmax layer to generate a distribution over all the candidate words. There are different choices of neural networks used in language modeling. Recurrent neural network-based model and convolutional neural network-based model are widely used (Mikolov et al., 2010; Dauphin et al., 2017).
|
| 38 |
+
|
| 39 |
+
Neural Machine Translation (NMT) is a challenging task that has attracted lots of attention in recent years. Based on the encoder-decoder framework, NMT starts to show promising results in many language pairs. The evolving structures of NMT models in recent years have pushed the accuracy of NMT into a new level. The attention mechanism (Bahdanau et al., 2015) added on top of the encoder-decoder framework is shown to be useful to automatically find alignment structure, and single-layer RNN-based structure has evolved towards deep models (Wu et al., 2016), more efficient CNN models (Gehring et al., 2017), and well-designed self-attention models (Vaswani et al., 2017).
|
| 40 |
+
|
| 41 |
+
In this paper, we mainly study the expressiveness of word embeddings in language generation tasks. A trend for language generation in recent years is to share the parameters between word embeddings and the softmax layer, which is named as the weight tying trick. Many state-of-the-art results in language modeling and machine translation are achieved with this trick (Vaswani et al., 2017; Merity et al., 2018; Yang et al., 2018; Press & Wolf, 2017). Inan et al. (2017) shows that weight tying not only reduces the number of parameters but also has theoretical benefits.
|
| 42 |
+
|
| 43 |
+
# 3 REPRESENTATION DEGENERATION PROBLEM
|
| 44 |
+
|
| 45 |
+
In this section, we empirically study the word embeddings learnt from sequence generation tasks, i.e., machine translation, and introduce the representation degeneration problem in neural sequence generation.
|
| 46 |
+
|
| 47 |
+
# 3.1 EXPERIMENTAL DESIGN
|
| 48 |
+
|
| 49 |
+
Our analysis reported in this section is mainly based on the state-of-the-art machine translation model Transformer (Vaswani et al., 2017). We use the official code (Vaswani et al., 2018) and set all the hyperparameters (the configurations of the base Transformer) as default. We train the model on the WMT 2014 English-German Dataset and achieve 27.3 in terms of BLEU score. Additionally, we also analyze the LSTM-based model (Wu et al., 2016) and find the observations are similar.
|
| 50 |
+
|
| 51 |
+
In neural sequence generation tasks, the weights in word embeddings and softmax layer are tied. Those parameters can be recognized not only as the inputs in the first layer but also as the weights in the last layer. Thus we compare this weight matrix with a word embedding matrix trained from conventional word representation learning task, and also compare it with the parameters in softmax layer of a conventional classification task. For simplicity and representative, we choose to use Word2Vec (Mikolov et al., 2013) to obtain word embeddings and use MNIST as the classification task trained with a two-layer convolutional neural network (Yue et al., 2018; Liu et al., 2016). For the classification task, We simply treat the row of the parameter matrix in the last softmax layer as the embedding for the category, like how the word embedding is used in the softmax layer for neural language generation model with weight tying trick.
|
| 52 |
+
|
| 53 |
+
To get a comprehensive understanding, we use low-rank approximation $( r a n k = 2$ ) for the learned matrices by SVD and plot them in a 2D plane, as shown in Figure 1. We also check the singular values distribution and find that our low-rank approximation is reasonable: other singular values are much smaller than the chosen ones.
|
| 54 |
+
|
| 55 |
+
# 3.2 DISCUSSION
|
| 56 |
+
|
| 57 |
+
In the classification task, the category embeddings (blue triangles in Figure 1(c)) in the softmax layer are diversely distributed around the origin. This shows the directions of category embeddings are different from each other and well separated, which consequently leads to large margin classification results with good generalization. For the word embeddings learnt from Word2Vec (Figure 1(b)), the phenomena are similar, the embeddings are also widely distributed around the origin in the projection space, which shows different words have different semantic meanings. Observations on GLOVE (Pennington et al., 2014) reported in Mu et al. (2018) are also consistent with ours.
|
| 58 |
+
|
| 59 |
+
We observe very different phenomena for machine translation. We can see from Figure 1(a) that the word embeddings are clustered together and only lying in a narrow cone. Furthermore, we find the cosine similarities between word embeddings are positive for almost all cases. That is, the words huddle together and are not well separated in the embedding space.
|
| 60 |
+
|
| 61 |
+
Clearly, as the role of word embeddings, which are the inputs to the neural networks, the word representations should be widely distributed to represent different semantic meanings. As the role of softmax in the output layer, to achieve good prediction of next word in a target sentence, a more diverse distribution of word embeddings in the space is expected to obtain a large margin result. However, such representations of words limit the expressiveness of the learnt model. We call such a problem the representation degeneration problem.
|
| 62 |
+
|
| 63 |
+
# 4 UNDERSTANDING THE PROBLEM
|
| 64 |
+
|
| 65 |
+
We show in the previous section that in training natural language generation models, the learnt word embeddings are clustered into a narrow cone and the model faces the challenge of limited expressiveness. In this section, we try to understand the reason of the problem and show that it is related to the optimization of low-frequency words with diverse contexts.
|
| 66 |
+
|
| 67 |
+
In natural language generation tasks, the vocabulary is usually of large size and the words are of low frequencies according to Zipf’s law. For example, more than $90 \%$ of words’ frequencies are lower than 10e-4 in WMT 2014 English-German dataset. Note that even for a popular word, its frequency is also relatively low. For a concrete example, the frequency of the word “is” is only about $1 \%$ in the dataset, since “is” occurs at most once in most simple sentences. Our analysis is mainly based on the optimization pattern of the low-frequency words which occupy the major proportion of vocabulary.
|
| 68 |
+
|
| 69 |
+
The generation of a sequence of words (or word indexes) $y = \left( y _ { 1 } , \cdot \cdot \cdot , y _ { M } \right)$ is equivalent to generate the words one by one from left to right. The probability of generating $y$ can be factorized as $\overset { \cdot } { P } ( \overset { \cdot } { Y } =$ $y ) = \Pi _ { t } P ( Y _ { t } = y _ { t } | Y _ { < t } = y _ { < t } )$ , where $y _ { < t }$ denotes for the first $t - 1$ words in $y$ . Sometimes, the generative model also depends on other context, e.g., the context from the source sentence for machine translation. To study the optimization of the word embeddings, we simply consider the generation of a word as a multi-class classification problem and formally describe the optimization as follows.
|
| 70 |
+
|
| 71 |
+
Consider a multi-class classification problem with $M$ samples. Let $h _ { i }$ denote the hidden state before the softmax layer which can be also considered as the input features, $i = 1 , \cdots , M$ . Without any loss of generality, we assume $h _ { i }$ is not a zero vector for all $i$ . Let $N$ denote the vocabulary size. The conditional probability of $y _ { i } \in \{ 1 , \cdots , N \}$ is calculated by the softmax function: $P ( Y _ { i } \stackrel { \cdot } { = } y _ { i } | h _ { i } ) =$ $\frac { \exp ( \langle h _ { i } , w _ { y _ { i } } \rangle ) } { \sum _ { l = 1 } ^ { N } \exp ( \langle h _ { i } , w _ { l } \rangle ) }$ , where $w _ { l }$ is the embedding for word/category $l$ , $l = 1 , 2 , \cdots , N$ .
|
| 72 |
+
|
| 73 |
+
# 4.1 EXTREME CASE: NON-APPEARED WORD TOKENS
|
| 74 |
+
|
| 75 |
+
Note that in most NLP tasks, the frequencies of rare words are rather low, while the number of them is relatively large. With stochastic training paradigm, the probabilities to sample a certain infrequent word in a mini-batch are very low, and thus during optimization, the rare words behave similarly to a non-appeared word. We first consider the extreme case of non-appeared word in this section and extend to a more general and realistic scenario in the next section.
|
| 76 |
+
|
| 77 |
+
We assume $y _ { i } \neq N$ for all $i$ . That is, the $N$ -th word with embedding $w _ { N }$ does not appear in the corpus, which is the extreme case of a low-frequency rare word. We focus on the optimization process of $w _ { N }$ and assume all other parameters are fixed and well-optimized. By log-likelihood maximization, we have
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\operatorname* { m a x } _ { w _ { N } } \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \log \frac { \exp ( \langle h _ { i } , w _ { y _ { i } } \rangle ) } { \sum _ { l = 1 } ^ { N } \exp ( \langle h _ { i } , w _ { l } \rangle ) } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
As all other parameters are fixed, this is equivalent to
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\operatorname* { m i n } _ { w _ { N } } \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \log ( \exp ( \langle h _ { i } , w _ { N } \rangle ) + C _ { i } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
$\begin{array} { r } { C _ { i } = \sum _ { l = 1 } ^ { N - 1 } \exp ( \left. h _ { i } , w _ { l } \right. ) } \end{array}$ and can be considered as some constants.
|
| 90 |
+
|
| 91 |
+
Definition 1. We say that vector $v$ is a uniformly negative direction of $\hslash _ { i }$ , $i = 1 , \cdots , M , i f \langle v , h _ { i } \rangle <$ 0 for all $i$ .
|
| 92 |
+
|
| 93 |
+
The following theorem provides a sufficient condition for the embedding $w _ { N }$ approaching unbounded during optimization. We leave the proof of all the theorems in the appendix.
|
| 94 |
+
|
| 95 |
+
Theorem 1. A. If the set of uniformly negative direction is not empty, it is convex. B. If there exists a v that is a uniformly negative direction of $h _ { i }$ , $i = 1 , \cdots , M$ , then the optimal solution of Eqn. 2 satisfies $\parallel { \boldsymbol { w } } _ { N } ^ { * } \parallel = \infty$ and can be achieved by setting $w _ { N } ^ { * } = \operatorname* { l i m } _ { k \to + \infty } k \cdot v$ .
|
| 96 |
+
|
| 97 |
+
From the above theorem, we can see that if there exists a set of uniformly negative direction, the embedding $w _ { N }$ can be optimized along any uniformly negative direction to infinity. As the set of uniformly negative direction is convex, $w _ { N }$ is likely to lie in a convex cone and move to infinity during optimization. Next, we provide a sufficient and necessary condition for the existence of the uniformly negative direction.
|
| 98 |
+
|
| 99 |
+
Theorem 2. There exists a v that is a uniformly negative direction of a set of hidden states, if and only if the convex hull of the hidden states does not contain the origin.
|
| 100 |
+
|
| 101 |
+
Discussion on whether the condition happens in real practice From the theorem, we can see that the existence of the uniformly negative direction is highly related to the structure of the hidden states, and then affects the optimization of word embeddings. Note that a common trick used in sequence generation tasks is layer normalization (Ba et al., 2016; Vaswani et al., 2017; Merity et al., 2018), which first normalizes each hidden state vector into standard vector2, and then rescales/translates the standard vector with scaling/bias term. In the appendix, we show that under very mild conditions, the space of hidden states doesn’t contain the origin almost for sure in practice.
|
| 102 |
+
|
| 103 |
+
# 4.2 EXTENSION TO RARELY APPEARED WORD TOKENS
|
| 104 |
+
|
| 105 |
+
In the previous section, we show that under reasonable assumptions, the embeddings of all nonappeared word tokens will move together along the uniformly negative directions to infinity. However, it is not realistic that there exist non-appeared word tokens and the weights of embedding can be trained to be unbounded with L2 regularization term. In this section, we extend our analysis to a more realistic setting. The key we want to show is that the optimization of a rarely appeared word token is similar to that of non-appeared word tokens. Following the notations in the previous section, we denote the embedding of a rare word as $w _ { N }$ and fix all other parameters. We study the optimization for this particular token with the negative log-likelihood loss function.
|
| 106 |
+
|
| 107 |
+
To clearly characterize the influence of $w _ { N }$ to the loss function, we divide the loss function into two pieces. Piece $A _ { w _ { N } }$ contains the sentences that do not contain $w _ { N }$ , i.e., all hidden states in such sentences are independently of $w _ { N }$ and the ground truth label of each hidden state (denoted as $w _ { h . } ^ { * }$ ) is not $w _ { N }$ . Then $w _ { N }$ can be considered as a “non-appeared token” in this set. Denote the space of the hidden state in piece $A _ { w _ { N } }$ as $\mathcal { H } _ { A _ { w _ { N } } }$ with probability distribution $P _ { A _ { w _ { N } } }$ , where $\mathcal { H } _ { A _ { w _ { N } } }$ and $P _ { A _ { w _ { N } } }$ can be continuous. The loss function on piece $A _ { w _ { N } }$ can be defined as
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
L _ { A _ { w _ { N } } } ( w _ { N } ) = - \int _ { \mathcal { H } _ { A _ { w _ { N } } } } \log \frac { \exp ( \langle h , w _ { h } ^ { * } \rangle ) } { \sum _ { l = 1 } ^ { N } \exp ( \langle h , w _ { l } \rangle ) } d P _ { A _ { w _ { N } } } ( h ) ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
which is a generalized version of Eqn. 1. Piece $B _ { w _ { N } }$ contains the sentences which contain $w _ { N }$ , i.e., $w _ { N }$ appears in every sentence in piece $B _ { w _ { N } }$ . Then in piece $B _ { w _ { N } }$ , in some cases the hidden states are computed based on $w _ { N }$ , e.g., when the hidden state is used to predict the next token after $w _ { N }$ . In some other cases, the hidden states are used to predict $w _ { N }$ . Denote the space of the hidden state in piece $B _ { w _ { N } }$ as $\mathcal { H } _ { B _ { w _ { N } } }$ with probability distribution $P _ { B _ { w _ { N } } }$ . The loss function on piece $B _ { w _ { N } }$ can be defined as
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
L _ { B _ { w _ { N } } } ( w _ { N } ) = - \int _ { \mathcal { H } _ { B _ { w _ { N } } } } \log \frac { \exp ( \langle h , w _ { h } ^ { * } \rangle ) } { \sum _ { l = 1 } ^ { N } \exp ( \langle h , w _ { l } \rangle ) } d P _ { B _ { w _ { N } } } ( h ) ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Based on these notations. the overall loss function is defined as
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
L ( w _ { N } ) = P ( \mathrm { s e n t e n c e } \ s i n \ A _ { w _ { N } } ) L _ { A _ { w _ { N } } } ( w _ { N } ) + P ( \mathrm { s e n t e n c e } \ s i n \ B _ { w _ { N } } ) L _ { B _ { w _ { N } } } ( w _ { N } ) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
The loss on piece $A _ { w _ { N } }$ is convex while the loss on piece $B _ { w _ { N } }$ is complicated and usually nonconvex with respect to $w _ { N }$ . The general idea is that given the fact that $L _ { A _ { w _ { N } } } ( w _ { N } )$ is a convex function with nice theoretical properties, if $P$ (sentence $s$ in $A _ { w _ { N } }$ ) is large enough, e.g., larger than $1 - \epsilon$ , and $L _ { B _ { w _ { N } } } ( w _ { N } )$ is a bounded-smooth function. The optimal solution of $L ( w _ { N } )$ is close to the optimal solution of $L _ { A _ { w _ { N } } } ( w _ { N } )$ which can be unique if $L _ { A _ { w _ { N } } } ( w _ { N } )$ is strongly-convex. A formal description is as below.
|
| 126 |
+
|
| 127 |
+
Theorem 3. Given an $\alpha$ -strongly convex function $f ( x )$ and a function $g ( x )$ that satisfies its Hessian matrix $\mathbf { H } ( g ( x ) ) \succ - \beta I ;$ , where $I$ is the identity matrix, and $| g ( x ) | < B$ . For a given $\epsilon > 0$ , let $x ^ { * }$ and $\ v x _ { \epsilon } ^ { * }$ be the optimum of $f ( x )$ and $( 1 - \epsilon ) f ( x ) + \epsilon g ( \dot { x } )$ , respectively. If $\epsilon < \frac { \alpha } { \alpha + \beta }$ , then $\begin{array} { r } { \parallel x ^ { * } - x _ { \epsilon } ^ { * } \parallel _ { 2 } ^ { 2 } \leq \frac { 4 \epsilon B } { \alpha - \epsilon ( \alpha + \beta ) } . } \end{array}$ .
|
| 128 |
+
|
| 129 |
+
We make some further discussions regarding the theoretical results. In natural language generation, for two low-frequency words $w$ and $w ^ { \prime }$ , piece $A _ { w }$ and $A _ { w ^ { \prime } }$ has large overlaps. Then the loss $L _ { A _ { w } } ( w )$ and $L _ { A _ { w ^ { \prime } } } ( w ^ { \prime } )$ are similar with close optimum. According to the discussion above, the learnt word embedding of $w$ and $w ^ { \prime }$ is likely to be close to each other, which is also observed from the empirical studies.
|
| 130 |
+
|
| 131 |
+
# 5 ADDRESSING THE PROBLEM
|
| 132 |
+
|
| 133 |
+
In this section, we propose an algorithm to address the representation degeneration problem. As shown in the previous study, the learnt word embeddings are distributed in a narrow cone in the Euclid space which restricts the expressiveness of the representation. Then a straightforward approach is to improve the aperture of the cone which is defined as the maximum angle between any two boundaries of the cone. For the ease of optimization, we minimize the cosine similarities between any two word embeddings to increase the expressiveness.
|
| 134 |
+
|
| 135 |
+
For simplicity, we denote the normalized direction of w as wˆ, wˆ = wkwk . Then our goal is to minimize $\begin{array} { r } { \sum _ { i } \sum _ { j \neq i } \hat { w _ { i } } ^ { T } \hat { w _ { j } } } \end{array}$ as well as the original log-likelihood loss function. By introducing hyperparameter $\gamma$ to trade off the log-likelihood loss and regularization term, the overall objective is,
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { c c l } { L } & { = } & { L _ { \mathrm { M L E } } + \gamma \displaystyle \frac { 1 } { N ^ { 2 } } \sum _ { i } ^ { N } \sum _ { j \neq i } ^ { N } { \hat { w _ { i } } } ^ { T } \hat { w _ { j } } . } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
We call this new loss as MLE with Cosine Regularization (MLE-CosReg). In the following, we make some analysis about the regularization term.
|
| 142 |
+
|
| 143 |
+
Denote $\begin{array} { r } { R \ = \ \sum _ { i } ^ { N } \sum _ { j \neq i } ^ { N } \hat { w _ { i } } ^ { T } \hat { w _ { j } } } \end{array}$ , and denote the normalized word embedding matrix as $\hat { W } =$ $[ \hat { w _ { 1 } } , \hat { w _ { 2 } } , . . . , \hat { w _ { N } } ] ^ { T }$ ix form as , where the $R \quad =$ $\begin{array} { r } { \sum _ { i } ^ { N } \sum _ { j \neq i } ^ { N } \hat { w _ { i } } ^ { T } \hat { w _ { j } } = \sum _ { i } ^ { N } \sum _ { j } ^ { N } \hat { w _ { i } } ^ { T } \hat { w _ { j } } - \sum _ { i } ^ { N } \parallel \hat { w } \hat { \parallel } ^ { 2 } = \operatorname { S u m } ( \hat { W } \hat { W } ^ { T } ) - N } \end{array}$ $\mathrm { \ S u m } ( \cdot )$ operator calculates the sum of all elements in the matrix. Since $N$ is a constant, it suffices to consider the first term $\mathsf { S u m } ( \hat { W } \hat { W } ^ { T } )$ only.
|
| 144 |
+
|
| 145 |
+
Since $\hat { W } \hat { W } ^ { T }$ is a positive semi-definite matrix, all its eigenvalues are nonnegative. Since $\hat { w } _ { i }$ is a normalized vector, every diagonal element of $\hat { W } \hat { W } ^ { T }$ is 1. Then the trace of $\bar { W } \hat { W } ^ { T }$ , which is also the sum of the eigenvalues, equals to $N$ .
|
| 146 |
+
|
| 147 |
+
Table 1: Experimental result on language modeling (perplexity). Bold numbers denote for the best result.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>Parameters</td><td>:Validation</td><td>Test</td></tr><tr><td>2-layer skip connection LSTM (Mandt et al., 2017) (tied)</td><td>24M</td><td>69.1</td><td>65.9</td></tr><tr><td>AWD-LSTM (Merity et al.,2018) (w.o. finetune)</td><td>24M</td><td>69.1</td><td>66.0</td></tr><tr><td>AWD-LSTM (Merity et al., 2018) (w.t. finetune)</td><td>24M</td><td>68.6</td><td>65.8</td></tr><tr><td>AWD-LSTM (Merity et al.,2018) + continuous cache pointer</td><td>24M</td><td>53.8</td><td>52.0</td></tr><tr><td>MLE-CosReg (w.o. finetune)</td><td>24M</td><td>68.2</td><td>65.2</td></tr><tr><td>MLE-CosReg (w.t. finetune)</td><td>24M</td><td>67.1</td><td>64.1</td></tr><tr><td>MLE-CosReg + continuous cache pointer</td><td>24M</td><td>51.7</td><td>50.0</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 2: Experimental results on WMT English German and German English translation. Bold numbers denote for our results and $\ddagger$ denotes for our implementation.
|
| 152 |
+
|
| 153 |
+
<table><tr><td colspan="2">English→German</td><td colspan="2">German-→English</td></tr><tr><td>Model</td><td>BLEU</td><td>Model</td><td>BLEU</td></tr><tr><td>ConvS2S (Gehring et al., 2017)</td><td>25.16</td><td>DSL (Xia et al.,2017b)</td><td>20.81</td></tr><tr><td>Base Transformer (Vaswani et al., 2017)</td><td>27.30</td><td>Dual-NMT (Xia et al., 2017a)</td><td>22.14</td></tr><tr><td>Base Transformer + MLE-CosReg</td><td>28.38</td><td>ConvS2S‡ (Gehring et al., 2017)</td><td>29.61</td></tr><tr><td>Big Transformer (Vaswani et al., 2017)</td><td>28.40</td><td>Base Transformer‡ (Vaswani et al., 2017)</td><td>31.00</td></tr><tr><td>Big Transformer + MLE-CosReg</td><td>28.94</td><td>Base Transformer + MLE-CosReg</td><td>31.93</td></tr></table>
|
| 154 |
+
|
| 155 |
+
As the cosine similarities between the word embeddings are all positive. According to Theorem 4, when $\hat { W } \hat { W } ^ { T }$ is a positive matrix, we have the largest absolute eigenvalue of $\hat { W } \hat { W } ^ { T }$ is upper bounded by $\mathsf { S u m } ( \hat { W } \hat { W } ^ { T } )$ . Then minimizing $R$ is equivalent to minimize the upper bound of the largest eigenvalue. As the sum of all eigenvalues is a constant, the side effect is to increase other eigenvalues, consequently improving the expressiveness of the embedding matrix.
|
| 156 |
+
|
| 157 |
+
Theorem 4. (Merikoski, 1984) For any matrix $A$ , which is a real and nonnegative $n \times n$ matrix. The spectral radius, which is the largest absolute value of $A$ ’s eigenvalues, is less than or equals to $S u m ( A )$ .
|
| 158 |
+
|
| 159 |
+
# 6 EXPERIMENTS
|
| 160 |
+
|
| 161 |
+
We conduct experiments on two basic natural language generation tasks: language modeling and machine translation, and report the results in this section.
|
| 162 |
+
|
| 163 |
+
# 6.1 EXPERIMENTAL SETTINGS
|
| 164 |
+
|
| 165 |
+
# 6.1.1 LANGUAGE MODELING
|
| 166 |
+
|
| 167 |
+
Language modeling is one of the fundamental tasks in natural language processing. The goal is to predict the probability of the next word conditioned on previous words. The evaluation metric is perplexity. Smaller the perplexity, better the performance. We used WikiText-2 (WT2) corpus, which is popularly used in many previous works (Merity et al., 2017; Inan et al., 2017; Grave et al., 2017). WikiText-2 is sourced from curated Wikipedia articles and contains approximately a vocabulary of over 30,000 words. All the text has been tokenized and processed with the Moses tokenizer (Koehn et al., 2006). Capitalization, punctuation and numbers are retained in this dataset.
|
| 168 |
+
|
| 169 |
+
AWD-LSTM (Merity et al., 2018) is the state-of-the-art model for language modeling. We directly followed the experimental settings as in Merity et al. (2018) to set up the model architecture and hyperparameter configurations. We used a three-layer LSTM with 1150 units in the hidden layer and set the size of embedding to be 400. The ratio for dropout connection on recurrent weight is kept the same as Merity et al. (2018). We trained the model with Averaged Stochastic Gradient Descent. Our implementation was based on open-sourced code3 by Merity et al. (2018). For our proposed MLE-CosReg loss, we found the hyperparameter $\gamma$ is not very sensitive and we set it to 1 in the experiments. We added neural cache model (Grave et al., 2017) to further reduce perplexity.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 2: (a): Word embeddings trained from MLE-CosReg. (b): Singular values of embedding matrix. We normalize the singular values of each matrix so that the largest one is 1.
|
| 173 |
+
|
| 174 |
+
# 6.1.2 MACHINE TRANSLATION
|
| 175 |
+
|
| 176 |
+
Machine Translation aims at mapping sentences from a source domain to a target domain. We focus on English German and German English in our experiments. We used the dataset from standard WMT 2014, which consists of 4.5 million English-German sentence pairs and has been widely used as the benchmark for neural machine translation (Vaswani et al., 2017; Gehring et al., 2017). Sentences were encoded using byte-pair encoding (Sennrich et al., 2016), after which we got a shared source-target vocabulary with about 37000 subword units. We measured the performance with tokenized case-sensitive BLEU (Papineni et al., 2002).
|
| 177 |
+
|
| 178 |
+
We used state-of-the-art machine translation model Transformer (Vaswani et al., 2017), which utilizes self-attention mechanism for machine translation. We followed the setting in Vaswani et al. (2017) and used the official code (Vaswani et al., 2018) from Transformer. For both English German and German English tasks, we used the base version of Transformer (Vaswani et al., 2017), which has a 6-layer encoder and 6-layer decoder, the size of hidden nodes and embedding are set to 512. For English German task, we additionally run an experiment on the big version of Transformer, which has $3 \mathbf { x }$ parameters compared with the base variant. All the models were trained with Adam optimizer, and all the hyperparameters were set as default as in Vaswani et al. (2017). $\gamma$ is set to 1 as in the experiments of language modeling.
|
| 179 |
+
|
| 180 |
+
# 6.2 EXPERIMENTAL RESULTS
|
| 181 |
+
|
| 182 |
+
We present experimental results for language modeling in Table 1 and machine translation in Table 2.
|
| 183 |
+
|
| 184 |
+
For language modeling, we compare our method with vanilla AWD-LSTM (Merity et al., 2018) in three different settings, without finetune, with finetune and with further continuous cache pointer. Our method outperforms it with $0 . 8 / 1 . 7 / 2 . 0 $ improvements in terms of test perplexity. For machine translation, comparing with original base Transformer (Vaswani et al., 2017), our method improves performance with 1.08/0.93 for the English German and German English tasks, respectively, and achieves 0.54 improvement on the big Transformer.
|
| 185 |
+
|
| 186 |
+
Note that for all tasks, we only add one regularization term to the loss function, while no additional parameters or architecture/hyperparameters modifications are applied. Therefore, the accuracy improvements purely come from our proposed method. This demonstrates that by regularizing the similarity between word embeddings, our proposed MLE-CosReg loss leads to better performance.
|
| 187 |
+
|
| 188 |
+
# 6.3 DISCUSSION
|
| 189 |
+
|
| 190 |
+
The study above demonstrates the effectiveness of our proposed method in terms of final accuracy. However, it is still unclear whether our method has improved the representation power of learnt word embeddings. In this subsection, we provide a comprehensive study on the expressiveness of the model learnt by our algorithm.
|
| 191 |
+
|
| 192 |
+
For a fair comparison with the empirical study in Section 3, we analyze the word embeddings of our model on English German translation task. We project the word embeddings into 2-dimensional space using SVD for visualization. Figure 2(a) shows that the learnt word embeddings are somewhat uniformly distributed around the origin and not strictly in a narrow cone like in Figure 1(a). This shows that our proposed regularization term effectively expands word embedding space. We also compare the singular values for word embedding matrix of our learnt model and the baseline model, as shown in the Figure 2(b). According to the figure, trained with vanilla Transformer, only a few singular values dominate among all singular values, while trained with our proposed method, the singular values distribute more uniformly. Again, this demonstrates the diversity of the word embeddings learnt by our method.
|
| 193 |
+
|
| 194 |
+
# 7 CONCLUSION AND FUTURE WORK
|
| 195 |
+
|
| 196 |
+
In this work, we described and analyzed the representation degeneration problem in training neural network models for natural language generation tasks both empirically and theoretically. We proposed a novel regularization method to increase the representation power of word embeddings explicitly. Experiments on language modeling and machine translation demonstrated the effectiveness of our method.
|
| 197 |
+
|
| 198 |
+
In the future, we will apply our method to more language generation tasks. Our proposed regularization term is based on cosine similarity. There may exist some better regularization terms. Furthermore, it is interesting to combine with other approaches, e.g. (Gong et al., 2018), to enrich the representation of word embeddings.
|
| 199 |
+
|
| 200 |
+
# 8 ACKNOWLEDGEMENTS
|
| 201 |
+
|
| 202 |
+
This work was partially supported by National Basic Research Program of China (973 Program) (grant no. 2015CB352502), NSFC (61573026) and BJNSF (L172037). We would like to thank Zhuohan Li and Chengyue Gong for helpful discussions, and the anonymous reviewers for their valuable comments on our paper.
|
| 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 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of the International Conference on Learning Representations, 2015.
|
| 209 |
+
|
| 210 |
+
Denny Britz, Anna Goldie, Minh-Thang Luong, and Quoc Le. Massive exploration of neural machine translation architectures. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 1442–1451. Association for Computational Linguistics, 2017. doi: 10.18653/v1/D17-1151.
|
| 211 |
+
|
| 212 |
+
Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International Conference on Machine Learning, pp. 933–941, 2017.
|
| 213 |
+
|
| 214 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In International Conference on Machine Learning, pp. 1243– 1252, 2017.
|
| 215 |
+
|
| 216 |
+
Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Frage: frequency-agnostic word representation. In Advances in Neural Information Processing Systems, pp. 1341–1352, 2018.
|
| 217 |
+
|
| 218 |
+
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. In Proceedings of the International Conference on Learning Representations, 2017.
|
| 219 |
+
|
| 220 |
+
Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In Proceedings of the International Conference on Learning Representations, 2017.
|
| 221 |
+
|
| 222 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 223 |
+
|
| 224 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. Character-aware neural language models. In Thirtieth AAAI Conference on Artificial Intelligence, pp. 2741–2749, 2016.
|
| 225 |
+
|
| 226 |
+
Philipp Koehn, Marcello Federico, Wade Shen, Nicola Bertoldi, Ondrej Bojar, Chris Callison-Burch, Brooke Cowan, Chris Dyer, Hieu Hoang, Richard Zens, et al. Open source toolkit for statistical machine translation: Factored translation models and confusion network decoding. In Final Report of the 2006 JHU Summer Workshop, 2006.
|
| 227 |
+
|
| 228 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In International Conference on Machine Learning, pp. 507–516, 2016.
|
| 229 |
+
|
| 230 |
+
Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. The Journal of Machine Learning Research, 18(1):4873–4907, 2017.
|
| 231 |
+
|
| 232 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Advances in Neural Information Processing Systems, pp. 6297– 6308, 2017.
|
| 233 |
+
|
| 234 |
+
Jorma Kaarlo Merikoski. On the trace and the sum of elements of a matrix. Linear algebra and its applications, 60:177–185, 1984.
|
| 235 |
+
|
| 236 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In Proceedings of the International Conference on Learning Representations, 2017.
|
| 237 |
+
|
| 238 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing lstm language models. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 239 |
+
|
| 240 |
+
Toma´s Mikolov, Martin Karafi ˇ at, Luk ´ a´s Burget, Jan ˇ Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
|
| 241 |
+
|
| 242 |
+
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, pp. 3111–3119, 2013.
|
| 243 |
+
|
| 244 |
+
Jiaqi Mu, Suma Bhat, and Pramod Viswanath. All-but-the-top: simple and effective postprocessing for word representations. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 245 |
+
|
| 246 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
|
| 247 |
+
|
| 248 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pp. 1532–1543, 2014.
|
| 249 |
+
|
| 250 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 157–163. Association for Computational Linguistics, 2017. URL http://aclweb.org/anthology/E17-2025.
|
| 251 |
+
|
| 252 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725. Association for Computational Linguistics, 2016.
|
| 253 |
+
|
| 254 |
+
Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. 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), volume 1, pp. 1577–1586, 2015.
|
| 255 |
+
|
| 256 |
+
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. 6000–6010, 2017.
|
| 257 |
+
|
| 258 |
+
Ashish Vaswani, Samy Bengio, Eugene Brevdo, Francois Chollet, Aidan N. Gomez, Stephan Gouws, Llion Jones, Łukasz Kaiser, Nal Kalchbrenner, Niki Parmar, Ryan Sepassi, Noam Shazeer, and Jakob Uszkoreit. Tensor2tensor for neural machine translation. CoRR, abs/1803.07416, 2018. URL http://arxiv.org/abs/1803.07416.
|
| 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 |
+
Yingce Xia, Jiang Bian, Tao Qin, Nenghai Yu, and Tie-Yan Liu. Dual inference for machine learning. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, pp. 3112–3118, 2017a.
|
| 263 |
+
|
| 264 |
+
Yingce Xia, Tao Qin, Wei Chen, Jiang Bian, Nenghai Yu, and Tie-Yan Liu. Dual supervised learning. In International Conference on Machine Learning, pp. 3789–3798, 2017b.
|
| 265 |
+
|
| 266 |
+
Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W Cohen. Breaking the softmax bottleneck: a high-rank rnn language model. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 267 |
+
|
| 268 |
+
Zhao Yue, Zhao Deli, Wan Shaohua, and Zhang Bo. Softmax supervision with isotropic normalization, 2018. URL https://openreview.net/forum?id $=$ SyXNErg0W.
|
| 269 |
+
|
| 270 |
+
# APPENDICES
|
| 271 |
+
|
| 272 |
+
# A PROOFS
|
| 273 |
+
|
| 274 |
+
In this section, we add proofs of all the theorems in the main sections.
|
| 275 |
+
|
| 276 |
+
Theorem 1. A. If the set of uniformly negative direction is not empty, it is convex. B. If there exists a v that is a uniformly negative direction of $h _ { i }$ , $i = 1 , \cdots , M$ , then the optimal solution of Eqn. 2 satisfies $\parallel { \boldsymbol { w } } _ { N } ^ { * } \parallel = \infty$ and can be achieved by setting $w _ { N } ^ { * } = \operatorname* { l i m } _ { k \to + \infty } k \cdot v$ .
|
| 277 |
+
|
| 278 |
+
Proof. The first part is straight forward and we just prove the second part. Denote $\begin{array} { r } { \operatorname* { l i m } _ { k + \infty } \sum _ { i = 1 } ^ { M } \log ( \exp ( \langle h _ { i } , k \cdot v \rangle ) + C _ { i } ) = \sum _ { i = 1 } ^ { M } \log ( C _ { i } ) } \end{array}$ $v$ as any uniformly negative direction, and $k$ as any positive value. We have . As $\dot { \sum } _ { i = 1 } ^ { M } \log ( C _ { i } )$ is the lower bound∗ of the objective function in Eqn. 2 and the objective function is convex, we have is local optimum and also the global optimum. Note that the lower bound can be achieved only if $\langle h _ { i } , w _ { N } \rangle$ approaches negative infinity for all $i$ . Then it is easy to check for any optimal solution $\parallel { \boldsymbol { w } } _ { N } ^ { * } \parallel = \infty$ . □
|
| 279 |
+
|
| 280 |
+
Theorem 2. There exists a v that is a uniformly negative direction of a set of hidden states, if and only if the convex hull of the hidden states does not contain the origin.
|
| 281 |
+
|
| 282 |
+
Proof. We first prove the necessary condition by contradiction. Suppose there are $M$ hidden states in the set. If the convex hull of $h _ { i }$ , $i = 1 , \cdots , M$ , contains the origin and there exists a uniformly negative direction (e.g. $v$ ). Then from the definition of convex hull, there exists $\alpha _ { i }$ , $i = 1 , \cdots , M$ , such that PMi $\begin{array} { r } { \sum _ { i } ^ { M } \alpha _ { i } h _ { i } = \bar { 0 } } \end{array}$ , $\alpha _ { i } \geq 0$ and $\textstyle \sum _ { i } \alpha _ { i } = 1$ . Multiplying $v$ on both sides, we have $\begin{array} { r } { \sum _ { i } \alpha _ { i } \langle h _ { i } , v \rangle = 0 } \end{array}$ , which contradicts with $\langle h _ { i } , v \rangle < 0$ for all $i$ .
|
| 283 |
+
|
| 284 |
+
For the sufficient part, if the convex hull of $h _ { i }$ , $i = 1 , \cdots , M$ , does not contain the origin, there exists at least one hyperplane $H$ that passes through the origin and does not cross the convex hull. Then it is easy to check that a normal direction of the half space derived by the $H$ is a uniformly negative direction. The theorem follows. □
|
| 285 |
+
|
| 286 |
+
Theorem 3. Given an $\alpha$ -strongly convex function $f ( x )$ and a function $g ( x )$ that satisfies its Hessian matrix $\mathbf { H } ( g ( x ) ) \succ - \beta I ;$ , where $I$ is the identity matrix, and $| g ( x ) | < B$ . For a given $\epsilon > 0$ , let $x ^ { * }$ and $\ v x _ { \epsilon } ^ { * }$ be the optimum of $f ( x )$ and $( 1 - \epsilon ) f ( x ) + \epsilon g ( \dot { x } )$ , respectively. If $\epsilon < { \frac { \alpha } { \alpha + \beta } }$ < αα+β , then k x∗ − x∗ k22≤ 4Bα−(α+β) .
|
| 287 |
+
|
| 288 |
+
Proof. We first prove the function $( 1 - \epsilon ) f ( x ) + \epsilon g ( x )$ is $\alpha - \epsilon ( \alpha + \beta )$ -strongly convex.
|
| 289 |
+
|
| 290 |
+
Let’s consider the Hessian matrix of it. As $f ( x )$ is $\alpha$ -strongly convex and $\mathbf { H } ( g ( x ) ) \succ - \beta I$ , using the definition of positive-definite matrix, the following inequality holds:
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { r } { \forall v , v ^ { T } ( \mathbf H ( g ) + \beta I ) v > 0 ; } \\ { v ^ { T } ( \mathbf H ( f ) - \alpha I ) v > 0 . } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
To make it clear, we omit $x$ here. Then for the Hessian matrix of $( 1 - \epsilon ) f ( x ) + \epsilon g ( x )$ , we have:
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { r l } { \forall v , \quad } & { v ^ { T } ( \mathbf { H } ( ( 1 - \epsilon ) f + \epsilon g ) - ( \alpha - \epsilon ( \alpha + \beta ) ) I ) v } \\ { = } & { v ^ { T } ( \mathbf { H } ( ( 1 - \epsilon ) f ) + \mathbf { H } ( \epsilon g ) - ( 1 - \epsilon ) \alpha I + \epsilon \beta I ) v } \\ { = } & { v ^ { T } ( ( 1 - \epsilon ) \mathbf { H } ( f ) + \epsilon \mathbf { H } ( g ) - ( 1 - \epsilon ) \alpha I + \epsilon \beta I ) v } \\ { = } & { v ^ { T } ( ( 1 - \epsilon ) ( \mathbf { H } ( f ) - \alpha I ) + \epsilon ( \mathbf { H } ( g ) + \epsilon \beta I ) ) v } \\ { = } & { v ^ { T } ( ( 1 - \epsilon ) ( \mathbf { H } ( f ) - \alpha I ) ) v + v ^ { T } ( \epsilon ( \mathbf { H } ( g ) + \beta I ) ) v } \\ { = } & { ( 1 - \epsilon ) v ^ { T } ( \mathbf { H } ( f ) - \alpha I ) v + \epsilon v ^ { T } ( \mathbf { H } ( g ) + \beta I ) v } \\ { > } & { ( 1 - \epsilon ) 0 + \epsilon 0 } \\ { = } & { 0 . } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
Thus, ${ \mathbf { H } } ( ( 1 - \epsilon ) f ( x ) + \epsilon g ( x ) ) - ( \alpha - \epsilon ( \alpha + \beta ) ) I$ is positive-definite, which means $( 1 - \epsilon ) f ( x ) + \epsilon g ( x )$ is $\alpha - \epsilon ( \alpha + \beta )$ -strongly convex. Then, with the properties in strong convexity, we have:
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r c l } { \parallel x ^ { * } - x _ { \epsilon } ^ { * } \parallel _ { 2 } ^ { 2 } } & { \leq } & { \displaystyle \frac { 2 } { \alpha - \epsilon ( \alpha + \beta ) } \big ( f ( x ^ { * } ) + \epsilon g ( x ^ { * } ) - f ( x _ { \epsilon } ^ { * } ) - \epsilon g ( x _ { \epsilon } ^ { * } ) \big ) } \\ & { \leq } & { \displaystyle \frac { 2 } { \alpha - \epsilon ( \alpha + \beta ) } \big ( \epsilon g ( x ^ { * } ) - \epsilon g ( x _ { \epsilon } ^ { * } ) \big ) } \\ & { \leq } & { \displaystyle \frac { 4 \epsilon B } { \alpha - \epsilon ( \alpha + \beta ) } . } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
# B COMPUTATION OF THE COSINE REGULARIZATION
|
| 309 |
+
|
| 310 |
+
In this section, we provide analysis of the computational cost of the proposed regularization term.
|
| 311 |
+
|
| 312 |
+
Proposition 1. The cosine regularization in Eqn. 6 can be computed in $\Theta ( N )$ time where $N$ is the size of vocabulary.
|
| 313 |
+
|
| 314 |
+
Proof. The regularization term can be simplified as below:
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\begin{array} { l l l l } { \displaystyle \sum _ { i } ^ { N } \displaystyle \sum _ { j \neq i } ^ { N } \hat { w } _ { i } ^ { T } \hat { w } _ { j } } & { = } & { \displaystyle ( \sum _ { i } ^ { N } \hat { w } _ { i } ) ^ { T } \big ( \displaystyle \sum _ { j } ^ { N } \hat { w } _ { j } ) - \sum _ { i } ^ { N } \hat { w } _ { i } ^ { T } \hat { w } _ { i } } \\ & { = } & { \displaystyle ( \sum _ { i } ^ { N } \hat { w } _ { i } ) ^ { T } \big ( \displaystyle \sum _ { i } ^ { N } \hat { w } _ { i } \big ) - N } \\ & { = } & { \displaystyle | | \sum _ { i } ^ { N } \hat { w } _ { i } | | _ { 2 } ^ { 2 } - N . } \end{array}
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
From the above equations, we can see that we only need to compute the sum of all the normalized word embedding vectors, and thus the computational time is linear with respect to the vocabulary size $N$ . □
|
| 321 |
+
|
| 322 |
+
# C DISCUSSION ON LAYER NORMALIZATION
|
| 323 |
+
|
| 324 |
+
In this section, we show the condition on the existence of the uniformly negative direction holds almost for sure in practice with models where layer normalization is applied before last layer.
|
| 325 |
+
|
| 326 |
+
Let $h _ { 1 } , h _ { 2 } , \cdots , h _ { n }$ be $n$ vectors in $\mathbb { R } ^ { d }$ Euclidean space. Let $\vec { \bf 1 } / \vec { \bf 0 }$ be the d-dimensional vector filled with ones/zeros respectively. By applying layer normalization we have:
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { l l l } { \displaystyle \mu _ { i } } & { = } & { \displaystyle \frac { 1 } { d } \overrightarrow { \mathbf { 1 } } ^ { T } h _ { i } , } \\ { \displaystyle \sigma _ { i } ^ { 2 } } & { = } & { \displaystyle \frac { 1 } { d } \parallel h _ { i } - \overrightarrow { \mathbf { 1 } } ^ { \prime } \mu _ { i } \parallel _ { 2 } ^ { 2 } , } \\ { \displaystyle h _ { i } ^ { \prime } } & { = } & { \mathbf { g } \odot \frac { h _ { i } - \overrightarrow { \mathbf { 1 } } ^ { \prime } \mu _ { i } } { \sigma _ { i } } + \mathbf { b } , } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
where $\mu _ { i }$ and $\sigma _ { i } ^ { 2 }$ are the mean and variance of entries in vector $h _ { i } , \mathbf { g }$ and $\mathbf { b }$ are learnt scale/bias vectors and $\odot$ denotes the element-wise multiplication. Here we simply assume that $\sigma _ { i } ^ { 2 }$ and each entry in $\mathbf { g }$ and $\mathbf { b }$ are not zero (since the exact zero value can be hardly observed using gradient optimization in real vector space). If the convex hull of $h _ { 1 } ^ { \prime } , h _ { 2 } ^ { \prime } , \cdots , h _ { n } ^ { \prime }$ contains the origin, then there exist $\lambda _ { 1 } , \lambda _ { 2 } , \cdots , \lambda _ { n }$ , such that:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\sum _ { i = 1 } ^ { n } \lambda _ { i } h _ { i } ^ { \prime } = { \overrightarrow { \mathbf { 0 } } } ; \sum _ { i = 1 } ^ { n } \lambda _ { i } = 1 ; \lambda _ { i } \geq 0 , \forall i = 1 , 2 , \cdots , n .
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
By combining 25 and 26 we have:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\begin{array} { l l l } { \displaystyle \sum _ { i = 1 } ^ { n } \lambda _ { i } h _ { i } ^ { \prime } } & { = } & { \displaystyle \sum _ { i = 1 } ^ { n } \lambda _ { i } ( \mathbf { g } \odot \frac { h _ { i } - \overrightarrow { \mathbf { 1 } } _ { \mu _ { i } } } { \sigma _ { i } } + \mathbf { b } ) } \\ & { = } & { \displaystyle \mathbf { b } + \sum _ { i = 1 } ^ { n } \lambda _ { i } ( \mathbf { g } \odot \frac { h _ { i } - \overrightarrow { \mathbf { 1 } } _ { \mu _ { i } } } { \sigma _ { i } } ) } \\ & { = } & { \displaystyle \mathbf { b } + \mathbf { g } \odot \sum _ { i = 1 } ^ { n } \lambda _ { i } \frac { h _ { i } - \overrightarrow { \mathbf { 1 } } _ { \mu _ { i } } } { \sigma _ { i } } = \overrightarrow { \mathbf { 0 } } . } \end{array}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Denote $\begin{array} { r } { \frac { \mathbf { b } } { \mathbf { g } } = ( \frac { b _ { 1 } } { g _ { 1 } } , \frac { b _ { 2 } } { g _ { 2 } } , \cdots , \frac { b _ { d } } { g _ { d } } ) } \end{array}$ , thus we have $\begin{array} { r } { \sum _ { i = 1 } ^ { n } \lambda _ { i } \frac { h _ { i } - \overrightarrow { 1 } \mu _ { i } } { \sigma _ { i } } = - \frac { \mathbf { b } } { \mathbf { g } } } \end{array}$ . Since $\vec { \bf \ " } \vec { \bf \ " } \frac { h _ { i } - \vec { \bf \ " } \mu _ { i } } { \sigma _ { i } } = 0$ for all $i$ , there exist $\lambda _ { 1 } , \lambda _ { 2 } , \cdots , \lambda _ { n }$ that satisfy Eqn. 26 only if $\begin{array} { r } { \vec { 1 } ^ { T } \frac { \mathbf { b } } { \mathbf { g } } = - \vec { 1 } ^ { T } \sum _ { i = 1 } ^ { n } \lambda _ { i } \frac { h _ { i } - \vec { 1 } ^ { \prime } \mu _ { i } } { \sigma _ { i } } = } \end{array}$ $\begin{array} { r } { - \sum _ { i = 1 } ^ { n } \lambda _ { i } \overrightarrow { 1 } ^ { \top } \frac { h _ { i } - \overrightarrow { 1 } \mu _ { i } } { \sigma _ { i } } = 0 } \end{array}$ , which can hardly be guaranteed using current unconstrained optimization. We also empirically verify this.
|
| 345 |
+
|
| 346 |
+
# D (SUB)WORD FREQUENCY DISTRIBUTION ON WMT2014 ENGLISH-GERMAN AND WIKITEXT 2 DATASETS
|
| 347 |
+
|
| 348 |
+
In this section, we show the (sub)word frequency distribution on the datasets we use in experiments in the Figure 3.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 3: (a): WMT 2014 English-German Dataset preprocessed with BPE. (b): word-level WikiText-2. In the two figures, the $\mathbf { X }$ -axis is the token ranked with respect to its frequency in descending order. The y-axis is the logarithmic value of the token frequency.
|
md/train/Ske6wiAcKQ/Ske6wiAcKQ.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REAL-TIME NEURAL-BASED INPUT METHOD
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The input method is an essential service on every mobile and desktop devices that provides text suggestions. It converts sequential keyboard inputs to the characters in its target language, which is indispensable for Japanese and Chinese users. Due to critical resource constraints and limited network bandwidth of the target devices, applying neural models to input method is not well explored. In this work, we apply a LSTM-based language model to input method and evaluate its performance for both prediction and conversion tasks with Japanese BCCWJ corpus. We articulate the bottleneck to be the slow softmax computation during conversion. To solve the issue, we propose incremental softmax approximation approach, which computes softmax with a selected subset vocabulary and fix the stale probabilities when the vocabulary is updated in future steps. We refer to this method as incremental selective softmax. The results show a two order speedup for the softmax computation when converting Japanese input sequences with a large vocabulary, reaching real-time speed on commodity CPU. We also exploit the model compressing potential to achieve a $92 \%$ model size reduction without losing accuracy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Typing is one of the core activities users interact with devices. The input method is an intelligent service in operating systems that provides text suggestions to boost typing efficiency. With a large user base, commercial input products have helped users save trillions of key presses. Being able to provide an input method service in high quality makes a huge business impact.
|
| 12 |
+
|
| 13 |
+
Among various features an input method provides, we consider two essential text suggestion tasks in this work: next word prediction task and conversion task. Next word prediction task relies on a language model, which gives the probability of the next word $p \big ( w _ { t } | w _ { 1 : t - 1 } \big )$ . Usually, top 3 or 5 candidates are shown to users. Conversion task, however, is not a common scenario for Latin users. Latin users can type directly with a keyboard, but there are thousands of characters in the Chinese and Japanese language. Conversion task takes a key sequence and converts it to target word sequence that best matches users’ original intentions. It is a sequence decoding task similar to machine translation.
|
| 14 |
+
|
| 15 |
+
Conventionally, an n-gram language model is used to solve these two tasks (Stolcke, 2002). However, due to the exponential increase in model size , the $\mathbf { n }$ -gram model can only support up to tri-gram. The decoding results often fail to have global consistency as the tri-gram language model is not capable of considering distant context. Also, n-gram models are often pruned to meet model size requirement with a loss in accuracy. In contrast, neural-based language models are proven to solve such issues more efficiently(Bengio et al., 2003; Mikolov et al., 2010; Jozefowicz et al., 2016).
|
| 16 |
+
|
| 17 |
+
Although neural-based language model has achieved enormous success, conventionally, it is not considered feasible for input method task. One major reason is that the input method has to run interactively at user devices with critical constraints of resources and run-time speed. This is different from speech recognition or machine translation services that are normally served from online servers. Input applications have to sacrifice accuracy for execution speed and model size.
|
| 18 |
+
|
| 19 |
+
In this work, we enhance a neural language model tailored for input method task to meet both runtime speed and model size requirement. Our baseline model is composed of a LSTM-based language model (Hochreiter & Schmidhuber, 1997) with a Viterbi decoder (Forney, 1973) as Figure 1 shows.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Illustration of the proposed neural-based input method. (a) Input context. (b) Conversion with LSTM LM and Viterbi decoder. (c) Word prediction.
|
| 23 |
+
|
| 24 |
+
It improves the performance for both conversion and next word prediction task and is capable of capturing distant context.
|
| 25 |
+
|
| 26 |
+
For languages like Japanese and Chinese, a large vocabulary is required in the conversion task. we articulate the bottleneck of run-time speed as the vocabulary size matrix operation before softmax. We propose an incremental selective softmax approach that builds a subset vocabulary $V _ { t }$ at each decoding step $t$ . By only computing softmax over $V _ { t }$ , the cost of softmax significantly drops since $| V _ { t } |$ is usually a small number that is less than $1 \%$ of the original vocabulary size. We evaluate the speedup comparing to other softmax optimization. To further handle the model disk size and memory size, we apply $\mathbf { k }$ -means based quantization algorithm and analyze its performance with various compression ratio.
|
| 27 |
+
|
| 28 |
+
We summarize the main contributions of this paper as follows:
|
| 29 |
+
|
| 30 |
+
1) We empirically evaluate using a LSTM-based language model to address input method challenges and demonstrate its performance for a complex language with large vocabulary size.
|
| 31 |
+
|
| 32 |
+
2) We propose an effective approach to accelerate the inference time with incremental selective softmax. By avoiding computing the full softmax, our approach achieves two orders inference speed boost without negatively impact the accuracy of conversion.
|
| 33 |
+
|
| 34 |
+
3) To let the neural language model with a large vocabulary fit into the execution environment on consumer devices, we compress the model with quantization techniques, achieving a $92 \%$ reduction on model size.
|
| 35 |
+
|
| 36 |
+
# 2 NEURAL-BASED INPUT METHOD
|
| 37 |
+
|
| 38 |
+
The neural-based approach we propose for input method is illustrated in Figure 1. We use LSTM language model for both the conversion and prediction tasks. A noticeable difference from the ngram approach is the use of a latent vector to capture input context. It is the hidden vector from the last recurrent unit of the previous sequence. In a real scenario, users don’t type the full sentence in one effort. Instead, they type and convert in fragments, where each fragment contains a few words. It is important to carry the context of the previously determined results to current conversion task.
|
| 39 |
+
|
| 40 |
+
Conversion task is described in Figure 1(b). As the user starts to type in an editor control, the input method first converts the alphabet user typed into syllables. Take Japanese as an example, Japanese Kana, also called “fifty sounds”, can be converted from the alphabet with fixed rules. In lexicon, Japanese words are indexed by Kana characters with an efficient structure such as Trie. A word lattice is then built with all possible words from a Kana sequence by lexicon lookup. To find the best combination of words aligned with the Kana sequence, we use a Viterbi decoder to decode with a beam size $S$ . LSTM language model is used here to evaluate path probabilities. The best path is then shown to the user as the conversion candidate.
|
| 41 |
+
|
| 42 |
+
Once the user selects the conversion candidate, last hidden vector of the best path becomes the new context vector. We compute the softmax based on the context vector and provides a probability distribution of the next words as shown in Figure 1(c).
|
| 43 |
+
|
| 44 |
+
Although several commercial input products have already tried to apply neural models1, they mainly aim to solve the prediction task for Latin languages. Conversion task has a different scale of computational cost and is not yet tackled.
|
| 45 |
+
|
| 46 |
+
# 3 MODEL ACCELERATION
|
| 47 |
+
|
| 48 |
+
# 3.1 BACKGROUND
|
| 49 |
+
|
| 50 |
+
Comparing to a prediction task, the conversion task is even more costly to compute. We further articulate three issues that make the conversion task difficult to solve: 1) For Japanese or Chinese input method, a much larger vocabulary size is required, which is usually several times larger than English. 2) During decoding, we have to evaluate probabilities for all paths with a beam size $S$ . 3) Most importantly, there are no natural word boundaries in Chinese or Japanese, such as a space character. The path evaluation has to run each time a new key input arrives, instead of when space is inserted. With all above constraints, the conversion task has to compute $S \times | V | \times | X |$ steps of LSTM computation for one input sequence, where $| V |$ is the vocabulary size, $| X |$ is the sequence length.
|
| 51 |
+
|
| 52 |
+
Heavy computation cost of LSTM model comes from two operations: the matrix operations inside LSTM cell and the matrix projection at softmax. In the case of a LSTM model with a vocabulary size of 100K, a hidden size of 512, and an embedding size of 256, estimated by simple matrix multiplication, the number of multiplication operations for LSTM cell is about $1 . 5 \mathbf { M }$ , while the softmax has 50M operations. In practice, the softmax occupies $9 7 \%$ of the total computation cost, which is the bottleneck for the conversion task with a large vocabulary size.
|
| 53 |
+
|
| 54 |
+
# 3.2 INCREMENTAL SELECTIVE SOFTMAX
|
| 55 |
+
|
| 56 |
+
To solve the challenges, we propose an incremental selective softmax approach to obtain correct probabilities for paths in the lattice. Given a partial observed character input sequence $( x _ { 1 } , . . . , x _ { t } )$ , we search for a set of words in the dictionary that match any suffix of the observation:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
D _ { t } = \bigcup _ { i = 1 } ^ { t } { \mathrm { m a t c h } } ( x _ { i } , . . . , x _ { t } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where the function $\mathrm { { m a t c h } ( \cdot ) }$ returns all lexicon items matching the partial sequence. For example, given the observation “ha ru ka”, the lexicon set $D _ { t }$ contains all words matching “ha ru $\mathbf { k } \mathbf { a } ^ { \prime \prime }$ or “ru ka” or “ka”. With the lexicon set in each step, we can construct a subset vocabulary $V _ { t }$ that covers all possible output words until step $t$ as:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
V _ { t } = \bigcup _ { i = 1 } ^ { t } D _ { i } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
In this work, we refer to $V _ { t }$ as the lattice vocabulary. In contrast to the beam search in machine translation, we have to rank paths that contain different number of words. If we directly compute path probabilities on $V _ { t }$ with a language model, as the denominator of the softmax becomes smaller, all words will have higher probabilities. Therefore, the paths containing more words will have advantage due to the incorrect probabilities. As a result, the paths can be ranked wrongly.
|
| 69 |
+
|
| 70 |
+
To circumvent the probability issue, we also sample a subset vocabulary from the full vocabulary, denoted by $\tilde { V }$ . We use $V _ { t }$ jointly with $\tilde { V }$ to make the word probabilities closer to their original probabilities, thus minimizing the impact of exposure bias.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Illustration of incremental selective softmax: (a) Vocabulary sampling strategies (b) Incrementally correct path probabilities with new lattice vocabulary.
|
| 74 |
+
|
| 75 |
+
As shown in Figure 2(a), we experiment two sampling methods. The first one samples mostly frequent words from the vocabulary, whereas the second one uniformly samples from the full vocabulary. We found the first sampling method (top sampling) delivers the best performance. In practice, both $V _ { t }$ and $\tilde { V }$ have less than $1 \%$ of the words in the original vocabulary.
|
| 76 |
+
|
| 77 |
+
Our proposed softmax approximation technique has two passes. When a new input character $x _ { t + 1 }$ arrives, we merge the current vocabulary $V _ { t }$ with new words from the lexicon set $D _ { t + 1 }$ , forming a new vocabulary $V _ { t + 1 }$ . Then for each path in the lattice, we compute the language model probability at step $t + 1$ with the joint vocabulary $V _ { t + 1 } \cup \tilde { V }$ as:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
P ( y _ { t } = i | h _ { t } ) = \frac { \exp ( h _ { t } ^ { \top } W _ { i } ) } { \sum _ { j \in V _ { t + 1 } \cup \tilde { V } } \exp ( h _ { t } ^ { \top } W _ { j } ) } ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $h _ { t }$ is the LSTM hidden state in step $t$ . In this pass, we only compute the word probabilities for top paths in batch with a beam size $S$ .
|
| 84 |
+
|
| 85 |
+
Now we computed the latest word probabilities using the lattice vocabulary $V _ { t + 1 }$ . Unfortunately, as previous word probabilities are computed on old vocabularies, they are not comparable with the new ones. Therefore, in the second pass, we correct the stale word probabilities to let them have the same denominator as the ones computed on the latest lattice vocabulary.
|
| 86 |
+
|
| 87 |
+
In principle, we can correct an old probability in step $k$ by adding the logits of missing vocabulary to the denominator as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
P ( y _ { k } = i | h _ { k } ) = \frac { \exp ( h _ { k } ^ { \top } W _ { i } ) } { \displaystyle \sum _ { j \in V _ { k + 1 } \cup { \tilde { V } } } \exp ( h _ { k } ^ { \top } W _ { j } ) + \sum _ { j \in V _ { t + 1 } , j \notin V _ { k + 1 } \cup { \tilde { V } } } \exp ( h _ { k } ^ { \top } W _ { j } ) } .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
However, in practice, as each path has different missing vocabularies, we compute a union of all missing vocabularies, and then recompute the logits of them in batch. Experiments show that our proposed incremental selective softmax strategy achieves a 76x speedup comparing to the baseline.
|
| 94 |
+
|
| 95 |
+
# 4 EXPERIMENTS
|
| 96 |
+
|
| 97 |
+
In this section, we compare the performance of the neural-based approach with conventional approaches. Then, we report the results of applying model acceleration and compression techniques.
|
| 98 |
+
|
| 99 |
+
# 4.1 DATASET
|
| 100 |
+
|
| 101 |
+
We use BCCWJ (Balanced Corpus of Contemporary Written Japanese) corpus (Maekawa et al., 2014) for evaluating our model. The corpus is well balanced with various sources of text representing contemporary written Japanese. This corpus contains 5.8M sentences, which are segmented into 127M tokens. In our experiments, all words are further segmented into short unit words. Each word has a format of ”display/reading/POS”. The reading and POS attributes are attached to tell different usages of the same word. Among the 611K unique words, we choose top 50K frequent ones that cover $9 7 . 3 \%$ of token appearances as an appropriate vocabulary size for the input method task. The words in the vocabulary are ranked with frequency. Most frequent words are at the top.
|
| 102 |
+
|
| 103 |
+
# 4.2 EXPERIMENT SETTINGS
|
| 104 |
+
|
| 105 |
+
The BCCWJ dataset is split into training, valid, and test set. The ratio is $70 \%$ , $20 \%$ , and $10 \%$ respectively. We randomly sample 2000 sentences from the test set for evaluating conversion accuracy. For input method task, we evaluate the conversion accuracy using a Viterbi decoder with a beam size of 10. In Japanese, there are often more than one correct conversion results. For instance, a verb may have two acceptable styles, one in original Japanese Kana, the other in Chinese characters. To better evaluate the model performance, we also report the top-10 accuracy in addition to top-1 accuracy.
|
| 106 |
+
|
| 107 |
+
We implement the model using TensorFlow2. We use a batch size of 384, and dropout with a drop rate of 0.9. Adam optimizer is used with a fixed learning rate of 0.001. The hyper-parameters are shared for all experiments.
|
| 108 |
+
|
| 109 |
+
A replica of the same model is written in numpy to work with a Viterbi decoder in python. It uses the weights learned with TensorFlow model. The inference performance is measure with numpy on a single Intel E5 CPU. We also apply the underline BLAS library to accelerate matrix operation.
|
| 110 |
+
|
| 111 |
+
# 4.3 EVALUATION OF NEURAL-BASED INPUT METHOD
|
| 112 |
+
|
| 113 |
+
We first compared the neural model performance with a conventional n-gram model. We calculate the perplexity of the n-gram model with SRILM package (Stolcke, 2002). We choose modified Kneser Ney (Kneser & Ney, 1995; James, 2000) as the smoothing algorithm when learning the ngram model. The learned language model is plugged into our input method pipeline for evaluating the sentence conversation accuracy. The prediction accuracy is not provided as it is directly reflected by model perplexity.
|
| 114 |
+
|
| 115 |
+
The LSTM baseline model has a standard architecture. The embedding size is 256, and the hidden size is 256. The size of LSTM cells is selected empirically on a validation dataset. In practice, using a network size bigger than 256 cannot gain significant improvement on perplexity. In all following experiments, we bind the input embedding and output embedding according to Press & Wolf (2017). The idea is proven to save space and almost loss-less. We treat it as the baseline model in following experiments.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Models</td><td>pp</td><td>top1 hit %</td><td>top10 hit %</td></tr><tr><td>uni-gram</td><td>833.55</td><td>26.95</td><td>45.85</td></tr><tr><td>bi-gram KN</td><td>99.30</td><td>51.15</td><td>78.10</td></tr><tr><td>tri-gram KN</td><td>68.11</td><td>55.60</td><td>79.65</td></tr><tr><td>LSTMbaseline</td><td>41.39</td><td>61.20</td><td>88.30</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 1: Performance comparison of baseline LSTM model with conventional n-gram model.
|
| 120 |
+
|
| 121 |
+
As shown in Table 1, the LSTM baseline achieved a significant improvement on perplexity, comparing to conventional n-gram based models. The top-1 and top-10 path conversion accuracy were increased by $5 . 6 \%$ and $8 . 6 5 \%$ respectively comparing to tri-gram KN. In real products, bi-gram is often used for decoding while tri-gram is only used for re-ranking the best paths. Please note that in this evaluation, we didn’t apply any pruning for n-gram. The n-gram model takes over 1GB storage size.
|
| 122 |
+
|
| 123 |
+
# 4.4 EVALUATION OF RUN-TIME SPEED
|
| 124 |
+
|
| 125 |
+
In this section, we compare the inference speed of various softmax acceleration approaches. We measure the execution speed only for the component that computes the language model probabilities. For neural-based methods, the component includes the LSTM and softmax layer. For the n-gram model, the computation of probability is only a lookup in the hash tables. Other components such as lattice construction are not included as they heavily depend on implementation.
|
| 126 |
+
|
| 127 |
+
Here, we report the decoding time in each step receiving a key input, because the per-step latency is critical for the real-time requirement. The computation cost for decoding the whole sequence is linear to the number of steps. For comparison, we also report the computation time of the softmax alone.
|
| 128 |
+
|
| 129 |
+
Table 2: Model acceleration among different methods with accuracy.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Models</td><td>Total Time (ms)</td><td>Softmax Time (ms)</td><td>Top-1 Hit (%)</td><td>Top-10 Hit (%)</td></tr><tr><td>tri-gram Kneser-Ney</td><td>0.0025</td><td>1</td><td>55.6</td><td>79.6</td></tr><tr><td>LSTMbaselinew/obatch</td><td>526</td><td>513</td><td>61.2</td><td>88.3</td></tr><tr><td>LSTMbaselinew/batch</td><td>87</td><td>84</td><td>61.2</td><td>88.3</td></tr><tr><td>Char LSTM</td><td>63</td><td>21</td><td>53.2</td><td>79.8</td></tr><tr><td>Char LSTM w/ large beam3</td><td>152</td><td>55</td><td>54.4</td><td>85.2</td></tr><tr><td>D-Softmax</td><td>38</td><td>35</td><td>60.8</td><td>86.8</td></tr><tr><td>D-Softmax*</td><td>37</td><td>35</td><td>60.9</td><td>87.5</td></tr><tr><td>IS-Softmax</td><td>3</td><td>1</td><td>58.8</td><td>86.9</td></tr><tr><td>w/ top sampling</td><td>4</td><td>2</td><td>60.1</td><td>88.2</td></tr><tr><td>w/uniform sampling</td><td>4</td><td>2</td><td>58.9</td><td>87.2</td></tr><tr><td>non-incremental S-Softmax</td><td>11</td><td>2</td><td>58.8</td><td>86.9</td></tr></table>
|
| 132 |
+
|
| 133 |
+
As Table 2 shows, our proposed incremental selective softmax (IS-Softmax) achieves a 76x speedup comparing to the LSTM baseline. The lattice vocabulary in our experiments contains only a few hundred words, while the full vocabulary has 50k words. IS-Softmax only takes $3 ~ \mathrm { m s }$ to handle a new coming key. Such a high processing speed meets the real-time latency requirement.
|
| 134 |
+
|
| 135 |
+
As a comparison, the non-incremental selective softmax is less efficient since it recalculates from the beginning in each step. Therefore, the majority of its cost comes from computing LSTM cells. We also evaluate various sampling methods with IS-Softmax. We find top sampling help close the accuracy gap between the baseline and softmax approximations. In our experiments, the number of samples used in top sampling and uniform sampling methods are both 400.
|
| 136 |
+
|
| 137 |
+
Differentiated softmax (D-Softmax) (Chen et al., 2016) and its variation (D-softmax∗) (Joulin et al., 2017) can also reduce the amount of softmax computation by over a half depends on the segmentation strategy. However, since the vocabulary size is still large, the room for speedup is limited. For character-based LSTM models, we use a hidden size of 1024 and embedding size of 512. Since there is no direct mapping between a single Kana and a single Chinese character, we use the word lattice and evaluate the path probability by character-based LSTM. It reduces the vocabulary size from 50K to 3717 in this experiment. However, the amount of vocabulary is still non-trivial. Furthermore, the integration of character-based models is not as efficient as word-based models in this task. Consequently, we have to use a large beam size to improve accuracy.
|
| 138 |
+
|
| 139 |
+
We also confirmed that batching is critical for acceleration matrix operations even on CPU. The LSTM computation without batching is almost $7 \mathbf { x }$ slower with a beam size 10. Therefore, we batch all the softmax computations when fixing the vocabulary in the second pass of IS-Softmax to achieve the best speed.
|
| 140 |
+
|
| 141 |
+
# 4.5 EVALUATION OF MODEL COMPRESSION
|
| 142 |
+
|
| 143 |
+
Due to the limited resource on user devices, the model for the input method has to be extremely compact for both storage and memory footprint. For the mobile platforms, the distribution package that contains the neural model shall have a size small than $1 0 \mathrm { { M B } }$ in order to handle various network environments. For commercial products, a large model size directly hinders the adoption of neural models even a higher accuracy is achieved.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 3: Model compression with k-means clusters from $2 ^ { 1 }$ to $2 ^ { 8 }$ .
|
| 147 |
+
|
| 148 |
+
In our experiments, we implement a $\mathbf { k }$ -means clustering algorithm (Han et al., 2016) to compress our neural language model. Instead of applying clustering method to all the weights of the LSTM model, we generate code and codebook for each trained matrix. As Figure 3 shows, the quantization method using codes of 8 bits works well without degrading the conversion accuracy. Even with very low bits such as 3 and 4, the conversion accuracy is still higher than the n-gram baseline. The model size for n-gram has over than 1GB storage footprint. In practice, pruning the n-gram model inevitably causes a loss in accuracy. The neural language model shows a big advantage over n-gram in terms of model compression. By applying 5-bit quantization, together with the tie embedding approach, we reduce $92 \%$ of model size without noticeable accuracy loss.
|
| 149 |
+
|
| 150 |
+
# 5 QUALITATIVE ANALYSIS
|
| 151 |
+
|
| 152 |
+
Among the sentences that n-gram cannot simply decode, we select a few examples to perform a qualitative study from the user experience point of view. Figure 4 shows the decoded results from the n-gram and LSTM-based language models. The text in red shows the wrong conversion results, and the text in blue is the correct results. According to human judgment, the most important hint words for a correct conversion are set to bold font. To better align with the Japanese text, the English translation is not in its original order.
|
| 153 |
+
|
| 154 |
+
We observe that the LSTM-based language model is capable of capturing distant context and producing correct results that are difficult for a statistical language model to predict. In case 1, the writer uses parallel structure to describe the core difference between two famous universities in Japan. Such long tail sentence is very creative and doesn’t appear twice in the corpus. Also, the middle word is separated by parenthesis, which causes trouble for the n-gram model. As word embedding can easily identify the antonyms, the LSTM-based model successfully predicts the correct output in such cases. Case 2 and 3 show that distant trigger can be captured by the neural model. Even when the trigger word is in a distant context, the LSTM-based model still understands the topic and selects the correct candidate as case 4 and 5 demonstrate.
|
| 155 |
+
|
| 156 |
+
We also found that when two correct candidates exist, n-gram models tend to keep only one of them in the lattice. In contrast, the LSTM-based model keeps the variety in the lattice and thus resulting in a better top 10 hit rate. We argue that the word embeddings for such interchangeable words are very close in the vector space after training. As a result, they retain similar probabilities during the decoding process.
|
| 157 |
+
|
| 158 |
+
Figure 4: Case study between conversion results of LSTM-based language model and n-gram model.
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan="2"></td><td>n-gram</td><td>論理(具体)の東大、凳送(中小)の兄弟 Logical (concrete) University of Tokyo,delivery (medium small) brother</td></tr><tr><td>LSTM baseline</td><td>論理(具体)の東大、凳想(抽象)の京大 Logical (concrete) University of Tokyo, creative (abstract) University of Kyoto</td></tr><tr><td rowspan="3">2</td><td>n-gram</td><td>昔は駐車た抗生物質</td></tr><tr><td>LSTM baseline</td><td>In the past parking antibiotics 昔は注射だた抗生物質</td></tr><tr><td></td><td>In the past injected antibiotics 自民党だけとな���と非常に偏体</td></tr><tr><td rowspan="2">3</td><td>n-gram LSTMbaseline</td><td>Liberal Democratic Party only about very biased experience 自民党けとなまと非常に偏た意見</td></tr><tr><td></td><td>Liberal Democratic Party only about very biased opinion 子供二人を幼くして亡くし、百二十二歳で妻も高い</td></tr><tr><td rowspan="2">4</td><td>n-gram</td><td>Children as child lost life,at the age of 122 wife also tall 子供2人を幼<して亡<し、百二十二歳妻も他界</td></tr><tr><td>LSTM baseline</td><td>Children as child lost life,at the age of 122 wife also died 飛行場行てみると、予約をれてあーたのに、何かの都合での日はに飛</td></tr><tr><td rowspan="2">5</td><td>n-gram</td><td>はずのものがー気しか飛ばなかたのである Airport went to,reservation had made,for some reason at the day Ki didn't flew only one stroke flew. 飛行場行てみると、予約をれてあーたのに、何かの都合でその日は二機飛</td></tr><tr><td>LSTMbaseline</td><td>はのものがー機しか飛ばなかたのである Airport went to,reservation had made,for some reason at the day two aircraft didn't flew only one aircraft flew.</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 6 RELATED WORKS
|
| 163 |
+
|
| 164 |
+
Applying a neural-based model for input method is studied in a few previous works. Chen et al. (2015) proposed a MLP architecture for Chinese Pinyin input method. Due to the huge computation cost of matrix operations, the neural model is only applied to rank the best paths decoded with n-gram language model. Though not in literature, we have found implementation of RNN-based input method4. The decoding results on BCCWJ corpus show promising accuracy improvement comparing to the n-gram model. Huang et al. (2018) treat the Chinese input conversion as machine translation and apply seq2seq with attention model. The conversion model and a few other features are served as cloud services. Our work focus on enabling neural-based models on devices especially with limited computation resources.
|
| 165 |
+
|
| 166 |
+
While there are various choices for the neural-based model, we choose a single layer LSTM model (Hochreiter & Schmidhuber, 1997) primarily due to the run-time speed consideration. For other DNN models, we argue that seq2seq like models (Cho et al., 2014) are not feasible to input method task because in each step the decoder needs to compute from start with a new latent vector. Bi-directional architectures such as Bi-LSTM (Huang et al., 2015) normally requires full input sequence beforehand, it cannot compute incrementally. Character-based RNN (Mikolov et al., 2010) is a good alternative for word-based models. It has a smaller vocabulary size. However, for Chinese and Japanese, there are still thousands of characters. Also, it doesn’t predict the next word directly.
|
| 167 |
+
|
| 168 |
+
To reduce the cost of softmax computation, Chen et al. (2016) proposed a differentiated softmax (D-Softmax), which computes the logits with weight matrices differ in size depending on word frequency. It argues that less frequent words require fewer softmax parameters compared to frequently used words. Joulin et al. (2017) is a variation of the D-softmax with more efficient weight segmentation. Together with the tie embedding approach (Press & Wolf, 2017), the cost of the differentiated softmax becomes $\scriptstyle \sum _ { i = 0 } ^ { n } | V _ { i } | \times E _ { i }$ , where each $E _ { i }$ is smaller value than its original size. Although the embedding optimization approach can reduce softmax cost, the amount of reduction is limited. It is still proportional to the reduced embedding size.
|
| 169 |
+
|
| 170 |
+
Another direction of reducing softmax cost comes from vocabulary manipulation. In machine translation, given a source sentence, the vocabulary of target words can be limited before translation. It is possible to calculate the softmax on a subset of the full vocabulary (Jean et al., 2015; Mi et al., 2016). However, for the input method, the conversion task takes user input incrementally. Our proposed incremental selective softmax can work without knowing full vocabulary beforehand. It is generally applicable for incremental sequence decoding task with a large vocabulary.
|
| 171 |
+
|
| 172 |
+
# 7 CONCLUSION
|
| 173 |
+
|
| 174 |
+
Input method plays an important role in improving typing efficiency and user experiences. It has to work on various devices with minimized latency. We study the key challenges to apply neural-based input method to real commodity devices. The proposed incremental selective softmax significantly reduces cost in the softmax computation without losing accuracy. We also demonstrate that the neural-based models can be highly compressed comparing to the conventional n-gram language models. Our proposed method sets a strong baseline in real-time input method. More importantly, as the computation has a low latency, the model is production-ready to be used on real devices.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic ´ language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 179 |
+
|
| 180 |
+
Shenyuan Chen, Hai Zhao, and Rui Wang. Neural network language model for chinese pinyin input method engine. In Proceedings of the 29th Pacific Asia Conference on Language, Information and Computation, pp. 455–461, 2015.
|
| 181 |
+
|
| 182 |
+
Wenlin Chen, David Grangier, and Michael Auli. Strategies for training large vocabulary neural language models. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, pp. 1975–1985, 2016.
|
| 183 |
+
|
| 184 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, 2014.
|
| 185 |
+
|
| 186 |
+
G David Forney. The viterbi algorithm. Proceedings of the IEEE, 61(3):268–278, 1973.
|
| 187 |
+
|
| 188 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016.
|
| 189 |
+
|
| 190 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 191 |
+
|
| 192 |
+
Yafang Huang, Zuchao Li, Zhuosheng Zhang, and Hai Zhao. Moon ime: Neural-based chinese pinyin aided input method with customizable association. In Proceedings of ACL 2018, System Demonstrations, pp. 140–145. Association for Computational Linguistics, 2018.
|
| 193 |
+
|
| 194 |
+
Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. arXiv preprint arXiv:1508.01991, 2015.
|
| 195 |
+
|
| 196 |
+
Frankie James. Modified kneser-ney smoothing of n-gram models. Technical report, 2000.
|
| 197 |
+
|
| 198 |
+
Sebastien Jean, Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large target vocabulary for neural machine translation. In 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL-IJCNLP 2015, pp. 1–10. Association for Computational Linguistics (ACL), 2015.
|
| 199 |
+
|
| 200 |
+
Armand Joulin, Moustapha Cisse, David Grangier, Herv ´ e J ´ egou, et al. Efficient softmax approxi-´ mation for gpus. In International Conference on Machine Learning, pp. 1302–1310, 2017.
|
| 201 |
+
|
| 202 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 203 |
+
|
| 204 |
+
Reinhard Kneser and Hermann Ney. Improved backing-off for m-gram language modeling. In icassp, volume 1, pp. 181e4, 1995.
|
| 205 |
+
|
| 206 |
+
Kikuo Maekawa, Makoto Yamazaki, Toshinobu Ogiso, Takehiko Maruyama, Hideki Ogura, Wakako Kashino, Hanae Koiso, Masaya Yamaguchi, Makiro Tanaka, and Yasuharu Den. Balanced corpus of contemporary written japanese. Language resources and evaluation, 48(2):345–371, 2014.
|
| 207 |
+
|
| 208 |
+
Haitao Mi, Zhiguo Wang, and Abe Ittycheriah. Vocabulary manipulation for neural machine translation. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), volume 2, pp. 124–129, 2016.
|
| 209 |
+
|
| 210 |
+
Toma´s Mikolov, Martin Karafi ˇ at, Luk ´ a´s Burget, Jan ˇ Cernock ˇ y, and Sanjeev Khudanpur. Recurrent \` neural network based language model. In Eleventh Annual Conference of the International Speech Communication Association, 2010.
|
| 211 |
+
|
| 212 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, volume 2, pp. 157–163, 2017.
|
| 213 |
+
|
| 214 |
+
Andreas Stolcke. Srilm-an extensible language modeling toolkit. In Seventh international conference on spoken language processing, 2002.
|
md/train/SkxSv6VFvS/SkxSv6VFvS.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEFORMABLE KERNELS: ADAPTING EFFECTIVE RECEPTIVE FIELDS FOR OBJECT DEFORMATION
|
| 2 |
+
|
| 3 |
+
Hang $\mathbf { G a o ^ { 1 , 3 * } } ,$ Xizhou $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 2 , 3 * }$ , Steve $\mathbf { L i n ^ { 3 } }$ , Jifeng Dai3
|
| 4 |
+
1UC Berkeley 2University of Science and Technology of China 3Microsoft Research Asia
|
| 5 |
+
hangg@eecs.berkeley.edu, ezra0408@mail.ustc.edu.cn
|
| 6 |
+
{stevelin,jifdai}@microsoft.com
|
| 7 |
+
http://people.eecs.berkeley.edu/˜hangg/deformable-kernels/
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Convolutional networks are not aware of an object’s geometric variations, which leads to inefficient utilization of model and data capacity. To overcome this issue, recent works on deformation modeling seek to spatially reconfigure the data towards a common arrangement such that semantic recognition suffers less from deformation. This is typically done by augmenting static operators with learned free-form sampling grids in the image space, dynamically tuned to the data and task for adapting the receptive field. Yet adapting the receptive field does not quite reach the actual goal – what really matters to the network is the effective receptive field (ERF), which reflects how much each pixel contributes. It is thus natural to design other approaches to adapt the ERF directly during runtime.
|
| 12 |
+
|
| 13 |
+
In this work, we instantiate one possible solution as Deformable Kernels (DKs), a family of novel and generic convolutional operators for handling object deformations by directly adapting the ERF while leaving the receptive field untouched. At the heart of our method is the ability to resample the original kernel space towards recovering the deformation of objects. This approach is justified with theoretical insights that the ERF is strictly determined by data sampling locations and kernel values. We implement DKs as generic drop-in replacements of rigid kernels and conduct a series of empirical studies whose results conform with our theories. Over several tasks and standard base models, our approach compares favorably against prior works that adapt during runtime. In addition, further experiments suggest a working mechanism orthogonal and complementary to previous works.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
The rich diversity of object appearance in images arises from variations in object semantics and deformation. Semantics describe the high-level abstraction of what we perceive, and deformation defines the geometric transformation tied to specific data (Gibson, 1950). Humans are remarkably adept at making abstractions of the world (Hudson & Manning, 2019); we see in raw visual signals, abstract semantics away from deformation, and form concepts.
|
| 18 |
+
|
| 19 |
+
Interestingly, modern convolutional networks follow an analogous process by making abstractions through local connectivity and weight sharing (Zhang, 2019). However, such a mechanism is an inefficient one, as the emergent representations encode semantics and deformation together, instead of as disjoint notions. Though a convolution responds accordingly to each input, how it responds is primarily programmed by its rigid kernels, as in Figure 1(a, b). In effect, this consumes large model capacity and data modes (Shelhamer et al., 2019).
|
| 20 |
+
|
| 21 |
+
We argue that the awareness of deformations emerges from adaptivity – the ability to adapt at runtime (Kanazawa et al., 2016; Jia et al., 2016; Li et al., 2019). Modeling of geometric transformations has been a constant pursuit for vision researchers over decades (Lowe et al., 1999; Lazebnik et al., 2006; Jaderberg et al., 2015; Dai et al., 2017). A basic idea is to spatially recompose data towards a common mode such that semantic recognition suffers less from deformation. A recent work that is representative of this direction is Deformable Convolution (Dai et al., 2017; Zhu et al., 2019). As shown in Figure 1(c), it augments the convolutions with free-form sampling grids in the data space. It is previously justified as adapting receptive field, or what we phrase as the “theoretical receptive field”, that defines which input pixels can contribute to the final output. However, theoretical receptive field does not measure how much impact an input pixel actually has. On the other hand, Luo et al. (2016) propose to measure the effective receptive field (ERF), i.e. the partial derivative of the output with respect to the input data, to quantify the exact contribution of each raw pixel to the convolution. Since adapting the theoretical receptive field is not the goal but a means to adapt the ERF, why not directly tune the ERF to specific data and tasks at runtime?
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Adaptation for deformation. We show how different $3 \times 3$ convolutions interact with deformations of two images. Kernel spaces are visualized as flat 2D Gaussians. Each “ $\cdot + \overrightarrow { \mathbf { \Gamma } }$ indicates a computation between a pixel and a kernel value sampled from the data and kernel space. Their colors represent corresponding kernel values. (a, b) Rigid kernels cannot adapt to specific deformations, thus consuming large model and data capacity. (c) Deformable Convolutions (Dai et al., 2017) reconfigure data towards common arrangement to counter the effects of geometric deformation. (d) Our Deformable Kernels (DKs) instead resample kernels and, in effect, adapt kernel spaces while leaving the data untouched. Note that (b) and (c) share kernel values but sample different data locations, while (b) and (d) share data locations but sample different kernel values.
|
| 25 |
+
|
| 26 |
+
Toward this end, we introduce Deformable Kernels (DKs), a family of novel and generic convolutional operators for deformation modeling. We aim to augment rigid kernels with the expressiveness to directly interact with the ERF of the computation during inference. Illustrated in Figure 1(d), DKs learn free-form offsets on kernel coordinates to deform the original kernel space towards specific data modality, rather than recomposing data. This can directly adapt ERF while leaving receptive field untouched. The design of DKs that is agnostic to data coordinates naturally leads to two variants – the global DK and the local DK, which behave differently in practice as we later investigate. We justify our approach with theoretical results which show that ERF is strictly determined by data sampling locations and kernel values. Used as a generic drop-in replacement of rigid kernels, DKs achieve empirical results coherent with our developed theory. Concretely, we evaluate our operator with standard base models on image classification and object detection. DKs perform favorably against prior works that adapt during runtime. With both quantitative and qualitative analysis, we further show that DKs can work orthogonally and complementarily with previous techniques.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORKS
|
| 29 |
+
|
| 30 |
+
We distinguish our work within the context of deformation modeling as our goal, and dynamic inference as our means.
|
| 31 |
+
|
| 32 |
+
Deformation Modeling: We refer to deformation modeling as learning geometric transformations in 2D image space without regard to 3D. One angle to attack deformation modeling is to craft certain geometric invariances into networks. However, this usually requires designs specific to certain kinds of deformation, such as shift, rotation, reflection and scaling (Sifre & Mallat, 2013; Bruna & Mallat, 2013; Kanazawa et al., 2016; Cohen & Welling, 2016; Worrall et al., 2017; Esteves et al., 2018). Another line of work on this topic learns to recompose data by either semi-parameterized or completely free-form sampling in image space: Spatial Transformers (Jaderberg et al., 2015) learns 2D affine transformations, Deep Geometric Matchers (Rocco et al., 2017) learns thin-plate spline transformations, Deformable Convolutions (Dai et al., 2017; Zhu et al., 2019) learns free-form transformations.
|
| 33 |
+
|
| 34 |
+
We interpret sampling data space as an effective approach to adapt effective receptive fields (ERF) by directly changing receptive field. At a high-level, our Deformable Kernels (DKs) share intuitions with this line of works for learning geometric transformations, yet are instantiated by learning to sample in kernel space which directly adapt ERF while leaving theoretical receptive fields untouched. While kernel space sampling is also studied in Deformable Filter (Xiong et al., 2019) and KPConv (Thomas et al., 2019), but in their contexts, sampling grids are computed from input point clouds rather than learned from data corpora.
|
| 35 |
+
|
| 36 |
+
Dynamic Inference: Dynamic inference adapts the model or individual operators to the observed data. The computation of our approach differs from self-attention (Vaswani et al., 2017; Wang et al., 2018) in which linear or convolution modules are augmented with subsequent queries that extract from the same input. We consider our closest related works in terms of implementation as those approaches that adapt convolutional kernels at run time. It includes but is not limited to Dynamic Filters (Jia et al., 2016), Selective Kernels (Li et al., 2019) and Conditional Convolutions (Yang et al., 2019). All of these approaches can learn and infer customized kernel spaces with respect to the data, but are either less inefficient or are loosely formulated. Dynamic Filters generate new filters from scratch, while Conditional Convolutions extend this idea to linear combinations of a set of synthesized filters. Selective Kernels are, on the other hand, comparably lightweight, but aggregating activations from kernels of different size is not as compact as directly sampling the original kernel space. Another line of works contemporary to ours (Shelhamer et al., 2019; Wang et al., 2019) is to compose free-form filters with structured Gaussian filters, which essentially transforms kernel spaces by data. Our DKs also differ from these works with the emphasize of direct adaptation the ERF rather than the theoretical receptive field. As mentioned previously, the true goal should be to adapt the ERF, and to our knowledge, our work is the first to study dynamic inference of ERFs.
|
| 37 |
+
|
| 38 |
+
# 3 APPROACH
|
| 39 |
+
|
| 40 |
+
We start by covering preliminaries on convolutions, including the definition of effective receptive field (ERF). We then formulate a theoretical framework for analyzing ERFs, and thus motivate our Deformable Kernels (DKs). We finally elaborate different DK variants within such a framework. Our analysis suggests compatibility between DKs and the prior work.
|
| 41 |
+
|
| 42 |
+
# 3.1 A DIVE INTO CONVOLUTIONS
|
| 43 |
+
|
| 44 |
+
2D Convolution: Let us first consider an input image $\pmb { I } \in \mathbb { R } ^ { D \times D }$ . By convolving it with a kernel $\pmb { W } \in \mathbb { R } ^ { K \times K }$ of stride 1, we have an output image $o$ whose pixel values at each coordinate $j \in \mathbb R ^ { 2 }$ can be expressed as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
O _ { j } = \sum _ { k \in \mathcal { K } } I _ { j + k } W _ { k } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
by enumerating discrete kernel positions $\boldsymbol { k }$ within the support $\mathcal { K } = [ - K / 2 , K / 2 ] ^ { 2 } \cap \mathbb { Z }$ . This defines a rigid grid for sampling data and kernels.
|
| 51 |
+
|
| 52 |
+
Theoretical Receptive Field: The same kernel $W$ can be stacked repeatedly to form a linear convolutional network with $n$ layers. The theoretical receptive field can then be imagined as the “accumulative coverage” of kernels at each given output unit on the input image by deconvolving back through the network. This property characterizes a set of input fields that could fire percepts onto corresponding output pixels. The size of a theoretical receptive field scales linearly with respect to the network depth $n$ and kernel size $K$ (He et al., 2016).
|
| 53 |
+
|
| 54 |
+
Effective Receptive Field: Intuitively, not all pixels within a theoretical receptive field contribute equally. The influence of different fields varies from region to region thanks to the central emphasis of stacked convolutions and also to the non-linearity induced by activations. The notion of effective receptive field (ERF) (Luo et al., 2016) is thus introduced to measure the impact of each input pixel on the output at given locations. It is defined as a partial derivative field of the output with respect to the input data. With the numerical approximations in linear convolution networks, the ERF was previously identified as a Gaussian-like soft attention map over input images whose size grows fractionally with respect to the network depth $n$ and linearly to the kernel size $K$ . Empirical results validate this idea under more complex and realistic cases when networks exploit non-linearities, striding, padding, skip connections, and subsampling.
|
| 55 |
+
|
| 56 |
+
# 3.2 ANALYSIS ON EFFECTIVE RECEPTIVE FIELDS
|
| 57 |
+
|
| 58 |
+
We aim to revisit and complement the previous analysis on ERFs by Luo et al. (2016). While the previous analysis concentrates on studying the expectation of an ERF, i.e., when network depth $n$ approaches infinity or all kernels are randomly distributed without learning in general, our analysis focuses on how we can perturb the computation such that the change in ERF is predictable, given an input and a set of kernel spaces.
|
| 59 |
+
|
| 60 |
+
We start our analysis by considering a linear convolutional network, without any unit activations, as defined in Section 3.1. For consistency, superscripts are introduced to image $\pmb { I }$ , kernel $W$ , and subscripts to kernel positions $\boldsymbol { k }$ to denote the index $s \in [ 1 , n ]$ of each layer. Formally, given an input image $\pmb { I } ^ { ( 0 ) }$ and a set of $K \times K$ kernels $\{ W ^ { ( s ) } \} _ { s = 1 } ^ { n }$ of stride 1, we can roll out the final output ${ \cal O } \equiv { \cal I } ^ { ( n ) }$ by unfolding Equation 1 as
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { l } { { { \cal I } _ { j } ^ { ( n ) } = \displaystyle \sum _ { k _ { n } \in { \cal K } } { \cal I } _ { j + k _ { n } } ^ { ( n - 1 ) } { \cal W } _ { k _ { n } } ^ { ( n ) } = \displaystyle \sum _ { ( k _ { n - 1 } , k _ { n } ) \in { \cal K } ^ { 2 } \atop { } } { \cal I } _ { j + k _ { n } + k _ { n - 1 } } ^ { ( n - 2 ) } { \cal W } _ { k _ { n } } ^ { ( n ) } { \cal W } _ { k _ { n - 1 } } ^ { ( n - 1 ) } = \cdots } } \\ { { = \displaystyle \sum _ { ( k _ { 1 } , k _ { 2 } , \ldots , k _ { n } ) \in { \cal K } ^ { n } } \left( { \cal I } _ { j + \sum _ { s = 1 } ^ { n } k _ { s } } ^ { ( 0 ) } \cdot \prod _ { s = 1 } ^ { n } { \cal W } _ { k _ { s } } ^ { ( s ) } \right) . } } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
By definition1, the effective receptive field value $\mathcal { R } ^ { ( n ) } ( i ; j ) \equiv \partial I _ { j } ^ { ( n ) } / \partial I _ { i } ^ { ( 0 ) }$ of output coordinate $j$ that takes input coordinate $_ i$ can be computed by
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathcal { R } ^ { ( n ) } ( i ; j ) = \sum _ { ( k _ { 1 } , k _ { 2 } , \ldots , k _ { n } ) \in K ^ { n } } \left( \mathbb { 1 } \left[ j + \sum _ { s = 1 } ^ { n } k _ { s } = i \right] \cdot \prod _ { s = 1 } ^ { n } W _ { k _ { s } } ^ { ( s ) } \right) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\mathbb { 1 } [ \cdot ]$ denotes the indicator function. This result indicates that ERF is related only to the data sampling location $j$ , kernel sampling location $\boldsymbol { k }$ , and kernel matrices $\{ W ^ { ( s ) } \}$ .
|
| 73 |
+
|
| 74 |
+
If we replace the $m ^ { \mathrm { t h } }$ kernel $W ^ { ( m ) }$ with a $1 \times 1$ kernel of a single parameter $W _ { \tilde { \boldsymbol { k } } _ { m } } ^ { ( m ) }$ sampled from it, the value of ERF becomes to
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathcal { R } ^ { ( n ) } ( i ; j , \tilde { k } _ { m } ) = \sum _ { ( k _ { 1 } , \dots , k _ { m - 1 } , k _ { m + 1 } , \dots , k _ { n } ) \in K ^ { n - 1 } } \left( \mathbb { 1 } \left[ j + \sum _ { s \in \mathbb { S } } k _ { s } = i \right] \cdot \prod _ { s \in \mathbb { S } } W _ { k _ { s } } ^ { ( s ) } \cdot W _ { \tilde { k } _ { m } } ^ { ( m ) } \right) ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathbb { S } = [ 1 , n ] \backslash \{ m \}$ . Since a $K \times K$ kernel can be deemed as a composition of $K ^ { 2 } 1 \times 1$ kernels distributed on a square grid, Equation 3 can thus be reformulated as
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathcal { R } ^ { ( n ) } ( i ; j ) = \sum _ { k _ { m } \in \mathcal { K } } \mathcal { R } ^ { ( n ) } ( i ; j + k _ { m } , k _ { m } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
For the case of complex non-linearities, where we here consider post $\mathrm { R e L U } ^ { 2 }$ activations in Equation 1,
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
O _ { j } = \operatorname* { m a x } ( \sum _ { k \in \mathcal { K } } I _ { j + k } W _ { k } , 0 ) .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
We can follow a similar analysis and derive corresponding ERF as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r l } & { \mathcal { R } ^ { ' ( n ) } ( i ; j , \tilde { k } _ { m } ) = \displaystyle \sum _ { ( k _ { 1 } , \cdots , k _ { m - 1 } , k _ { m + 1 } , \cdots , k _ { n } ) \in K ^ { n - 1 } } \left( \mathcal { C } ^ { ( n ) } ( i ; j , k _ { 1 } , \cdots , k _ { n } , \tilde { k } _ { m } ) \cdot \prod _ { s \in \mathbb { S } } W _ { \tilde { k } _ { s } } ^ { ( s ) } \cdot W _ { \tilde { k } _ { m } } ^ { m } \right) } \\ & { \mathcal { C } ^ { ( n ) } ( i ; j , k _ { 1 } , \cdots , k _ { n } , \tilde { k } _ { m } ) = \mathbb { 1 } \big [ j + \displaystyle \sum _ { s \in \mathbb { S } } k _ { s } = i \big ] \prod _ { s \in \mathbb { S } } \mathbb { 1 } \big [ \displaystyle I _ { j } ^ { ( s - 1 ) } W _ { \tilde { k } _ { s } } ^ { ( s ) } > 0 \big ] \mathbb { 1 } \big [ I _ { j } ^ { ( m - 1 ) } W _ { \tilde { k } _ { m } } ^ { ( m ) } > 0 \big ] . } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Here we can see that the ERF becomes data-dependent due to the coefficient $\mathcal { C }$ , which is tied to input coordinates, kernel sampling locations, and input data $\pmb { I } ^ { ( 0 ) }$ . The more detailed analysis of this coefficient is beyond the scope of this paper. However, it should be noted that this coefficient only “gates” the contribution of the input pixels to the output. So in practice, ERF is “porous” – there are inactive (or gated) pixel units irregularly distributed around the ones that fire. This phenomenon also appeared in previous studies (such as in Luo et al. (2016), Figure 1). The maximal size of an ERF is still controlled by the data sampling location and kernel values as in the linear cases in Equation 5.
|
| 99 |
+
|
| 100 |
+
A nice property of Equation 4 and Equation 5 is that all computations are linear, making it compatible with any linear sampling operators for querying kernel values of fractional coordinates. In other words, sampling kernels in effect samples the ERF on the data in the linear case, but also roughly generalizes to non-linear cases as well. This finding motivates our design of Deformable Kernels (DKs) in Section 3.3.
|
| 101 |
+
|
| 102 |
+
# 3.3 DEFORMABLE KERNELS
|
| 103 |
+
|
| 104 |
+
In the context of Equation 1, we resample the kernel $W$ with a group of learned kernel offsets denoted as $\{ \Delta k \}$ that correspond to each discrete kernel position $\boldsymbol { k }$ . This defines our DK as
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
O _ { j } = \sum _ { k \in \mathcal K } I _ { j + k } W _ { k + \Delta k } ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
and the value of ERF as
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathcal { R } _ { \mathrm { D K } } ^ { ( n ) } ( i ; j ) = \sum _ { k _ { m } \in { \mathcal { K } } } \mathcal { R } ^ { ( n ) } ( i ; j + k _ { m } , k _ { m } + \Delta k _ { m } ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Note that this operation leads to sub-pixel sampling in the kernel space. In practice, we use bilinear sampling to interpolate within the discrete kernel grid.
|
| 117 |
+
|
| 118 |
+
Intuitively, the size (resolution) of the original kernel space can affect sampling performance. Concretely, suppose we want to sample a $3 \times 3$ kernel. DKs do not have any constraint on the size of the original kernel space, which we call the “scope size” of DKs. That said, we can use a $W$ of any size $K ^ { \prime }$ even though the number of sampling locations is fixed as $K ^ { 2 }$ . We can thus exploit large kernels – the largest ones can reach $9 \times 9$ in our experiments with nearly no overhead in computation since bilinear interpolations are extremely lightweight compared to the cost of convolutions. This can also increase the number of learning parameters, which in practice might become intractable if not handled properly. In our implementation, we will exploit depthwise convolutions (Howard et al., 2017) such that increasing scope size induces a negligible amount of extra parameters.
|
| 119 |
+
|
| 120 |
+
As previously discussed, sampling the kernel space in effect transforms into sampling the ERF. On the design of locality and spatial granularity of our learned offsets, DK naturally delivers two variants ��� the global DK and the local DKs, as illustrated in Figure 2. In both operators, we learn a kernel offset generator $\mathcal { G }$ that maps an input patch into a set of kernel offsets that are later applied to rigid kernels.
|
| 121 |
+
|
| 122 |
+
In practice, we implement $\mathcal { G } _ { \mathrm { g l o b a l } }$ as a stack of one global average pooling layer, which reduces feature maps into a vector, and another fully-connected layer without non-linearities, which projects the reduced vector into an offset vector of $2 K ^ { 2 }$ dimensions. Then, we apply these offsets to all convolutions for the input image following Equation 7. For local DKs, we implement $\mathcal { G } _ { \mathrm { l o c a l } }$ as an extra convolution that has the same configuration as the target kernel, except that it only has $2 K ^ { 2 }$ output channels. This produces kernel sampling offsets $\{ \Delta k \}$ that are additionally indexed by output locations $j$ . It should be noted that similar designs were also discussed in Jia et al. (2016), in which filters are generated given either an image or individual patches from scratch rather than by resampling.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 2: Instantiations. We show how DK variants works with an example image that contains a large and a small object. (a) The global DK learns one set of kernel sampling grid given an input image and apply it to all data positions. (b) The local DK adapts kernels for each input patches, and induces better locality for deformation modeling.
|
| 126 |
+
|
| 127 |
+
Intuitively, we expect the global DK to adapt kernel space between different images but not within a single input. The local DK can further adpat to specific image patches: for smaller objects, it is better to have shaper kernels and thus denser ERF; for larger objects, flatter kernels can be more beneficial for accumulating a wider ERF. On a high level, local DKs can preserve better locality and have larger freedom to adapt kernel spaces comparing to its global counterpart. We later compare these operators in our experiments.
|
| 128 |
+
|
| 129 |
+
# 3.4 LINK WITH DEFORMABLE CONVOLUTIONS
|
| 130 |
+
|
| 131 |
+
The core idea of DKs is to learn adaptive offsets to sample the kernel space for modeling deformation, which makes them similar to Deformable Convolutions (Dai et al., 2017; Zhu et al., 2019), at both the conceptual and implementation levels. Here, we distinguish DKs from Deformable Convolutions and show how they can be unified.
|
| 132 |
+
|
| 133 |
+
Deformable Convolutions can be reformulated in a general form as
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
O _ { j } = \sum _ { k \in \mathcal { K } } I _ { j + k + \Delta j } W _ { k } ,
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
where they aim to learn a group of data offsets $\{ \Delta j \}$ with respect to discrete data positions $j$ . For consistency for analysis, the value of effective receptive field becomes
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\mathcal { R } _ { \mathrm { D C } } ^ { ( n ) } ( i ; j ) = \sum _ { k _ { m } \in \mathcal { K } } \mathcal { R } ^ { ( n ) } ( i ; j + k _ { m } + \Delta j _ { m } , k _ { m } ) .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
This approach essentially recomposes the input image towards common modes such that semantic recognition suffers less from deformation. Moreover, according to our previous analysis in Equation 5, sampling data is another way of sampling the ERF. This, to a certain extent, also explains why Deformable Convolutions are well suited for learning deformation-agnostic representations.
|
| 146 |
+
|
| 147 |
+
Moreover, we can learn both data and kernel offsets in one convolutional operator. Conceptually, this can be done by merging Equation 7 with Equation 9, which leads to
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { c } { { \displaystyle { \cal O } _ { j } = \displaystyle \sum _ { k \in { \cal K } } { \cal I } _ { j + k + \Delta j } W _ { k + \Delta k } , } } \\ { { \displaystyle \mathcal { R } _ { \mathrm { D C + D K } } ^ { ( n ) } ( i ; j ) = \displaystyle \sum _ { k _ { m } \in { \cal K } } { \cal R } ^ { ( n ) } ( i ; j + k _ { m } + \Delta j _ { m } , k _ { m } + \Delta k _ { m } ) . } } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
We also investigate this operator in our experiments. Although the two techniques may be viewed as serving a similar purpose, we find the collaboration between Deformable Kernels and Deformable Convolutions to be powerful in practice, suggesting strong compatibility.
|
| 154 |
+
|
| 155 |
+
# 4 EXPERIMENTS
|
| 156 |
+
|
| 157 |
+
We evaluate our Deformable Kernels (DKs) on image classification using ILSVRC and object detection using the COCO benchmark. Necessary details are provided to reproduce our results, together with descriptions on base models and strong baselines for all experiments and ablations. For taskspecific considerations, we refer to each corresponding section.
|
| 158 |
+
|
| 159 |
+
Implementation Details: We implement our operators in PyTorch and CUDA. We exploit depthwise convolutions when designing our operator for better computational efficiency3. We initialize kernel grids to be uniformly distributed within the scope size. For the kernel offset generator, we set its learning rate to be a fraction of that of the main network, which we cross-validate for each base model. We also find it important to clip sampling locations inside the original kernel space, such that $\pmb { k } + \Delta \pmb { k } \in \mathcal { K }$ in Equation 7.
|
| 160 |
+
|
| 161 |
+
Base Models: We choose our base models to be ResNet-50 (He et al., 2016) and MobileNetV2 (Sandler et al., 2018), following the standard practice for most vision applications. As mentioned, we exploit depthwise convolution and thus make changes to the ResNet model. Concretely, we define our ResNet-50-DW base model by replacing all $3 \times 3$ convolutions by its depthwise counterpart while doubling the dimension of intermediate channels in all residual blocks. We find it to be a reasonable base model compared to the original ResNet-50, with comparable performance on both tasks. During training, we set the weight decay to be $4 \times 1 0 ^ { - 5 }$ rather than the common $1 0 ^ { - 4 }$ for both models since depthwise models usually underfit rather than overfit (Xie et al., 2017; Howard et al., 2017; Hu et al., 2018). We set the learning rate multiplier of DK operators as $1 0 ^ { - 2 }$ fo r ResNet-50-DW and $1 0 ^ { - 1 }$ for MobileNet-V2 in all of our experiments.
|
| 162 |
+
|
| 163 |
+
Strong Baselines: We develop our comparison with two previous works: Conditional Convolutions (Yang et al., 2019) for dynamics inference, and Deformable Convolutions (Dai et al., 2017; Zhu et al., 2019) for deformation modeling. We choose Conditional Convolutions due to similar computation forms – sampling can be deemed as an elementewise “expert voting” mechanism. For fair comparisons, We reimplement and reproduce their results. We also combine our operator with these previous approach to show both quantitative evidence and qualitative insight that our working mechanisms are compatible.
|
| 164 |
+
|
| 165 |
+
# 4.1 IMAGE CLASSIFICATION
|
| 166 |
+
|
| 167 |
+
We first train our networks on the ImageNet 2012 training set (Deng et al., 2009). We adopt a common experiment protocol for fair comparisons as in Goyal et al. (2017); Loshchilov & Hutter (2017). For more details, please refer to our supplement.
|
| 168 |
+
|
| 169 |
+
We first ablate the scope size of kernels for our DKs and study how it can affect model performance using ResNet-50-DW. As shown in Table 1, our DKs are sensitive to the choice of the scope size. We shown that when only applied to $3 \times 3$ convolutions inside residual bottlenecks, local DKs induce a $+ 0 . 7$ performance gain within the original scope. By further enlarging the scope size, performance increases yet quickly plateaus at scope $4 \times 4$ , yielding largest $+ 1 . 4$ gain for top-1 accuracy. Our speculation is that, although increasing scope size theoretically means better interpolation, it also makes the optimization space exponentially larger for each convolutional layer. And since number of entries for updating is fixed, this also leads to relatively sparse gradient flows. In principle, we set default scope size at $4 \times 4$ for our DKs.
|
| 170 |
+
|
| 171 |
+
We next move on and ablate our designs by comparing the global DK with the local DK, shown in the table. Both operators helps while the local variants consistently performs better than their global counterparts, bringing a $+ 0 . 5$ gap on both base models. We also study the effect of using more DKs in the models – the $1 \times 1$ convolutions are replaced by global $\mathrm { D K } \dot { \mathrm { s } } ^ { 4 }$ with scope $2 \times 2$ . Note that all $1 \times 1$ convolutions are not depthwise, and therefore this operation induces nearly 4 times of parameters. We refer their results only for ablation and show that adding more DKs still helps – especially for MobileNet-V2 since it is under-parameterized. This finding also holds for previous models (Yang et al., 2019) as well.
|
| 172 |
+
|
| 173 |
+
Table 1: Ablations of scope size and different instantiations of DK for image classification. Using proper scope size, and more DK layers boosts performance. Modeling individual offset kernel grid for each data entries is also beneficial.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Backbone</td><td>1×1Deformable Kernels</td><td>3×3Deformable Kernels</td><td>top1 (%)</td><td>#P (M)</td><td>GFLOPs</td></tr><tr><td>ResNet-50</td><td>w/o</td><td>w/o</td><td>76.7</td><td>25.6</td><td>3.86</td></tr><tr><td>ResNet-50-DW</td><td>w/o</td><td>w/o</td><td>76.3</td><td>23.7</td><td>3.82</td></tr><tr><td rowspan="4">ResNet-50-DW</td><td rowspan="4">w/o</td><td>local, scope size 3×3</td><td>77.4</td><td>24.9</td><td>4.32</td></tr><tr><td>local, scope size 4×4</td><td>78.1</td><td>25.0</td><td>4.32</td></tr><tr><td>local, scope size 5×5</td><td>77.8</td><td>25.0</td><td>4.32</td></tr><tr><td>local, scope size 9×9</td><td>77.4</td><td>25.4</td><td>4.32</td></tr><tr><td rowspan="4">ResNet-50-DW</td><td>w/o</td><td>global, scope size 4×4</td><td>77.6</td><td>23.9</td><td>3.82</td></tr><tr><td>global,scope size 2×2</td><td>global, scope size 4×4</td><td>77.9</td><td>80.1</td><td>4.09</td></tr><tr><td>w/o</td><td>local, scope size 4×4</td><td>78.1</td><td>25.0</td><td>4.32</td></tr><tr><td>global, scope size 2×2</td><td>local, scope size 4×4</td><td>78.5</td><td>81.2</td><td>4.60</td></tr><tr><td>MobileNet-V2</td><td>w/o</td><td>w/o</td><td>71.9</td><td>3.5</td><td>0.31</td></tr><tr><td rowspan="4">MobileNet-V2</td><td>w/o</td><td>global, scope size 4×4</td><td>73.6</td><td>3.7</td><td>0.31</td></tr><tr><td>global, scope size 2×2</td><td>global, scope size 4×4</td><td>74.5</td><td>10.1</td><td>0.34</td></tr><tr><td>w/o</td><td>local, scope size 4×4</td><td>74.1</td><td>4.7</td><td>0.73</td></tr><tr><td>global, scope size 2×2</td><td>local, scope size 4×4</td><td>74.8</td><td>11.1</td><td>0.76</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Table 2: Comparisons to strong baselines for image classification DKs perform comparably or superiorly to previous methods. Further combinations yield consistent gain, suggesting orthogonal and compatible working mechanisms.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Backbone</td><td>1×1Deformable Kernels</td><td>3×3DeformableKernels</td><td>top1 (%)</td><td>#P (M)</td><td>GFLOPs</td></tr><tr><td>ResNet-50-DW</td><td>w/o</td><td>local, scope size 4×4</td><td>78.1</td><td>25.0</td><td>4.32</td></tr><tr><td>ResNet-50-DW</td><td>w/o</td><td>w/o</td><td>77.6</td><td>42.5</td><td>7.13</td></tr><tr><td rowspan="2">with SCC ResNet-50-DW</td><td rowspan="2">w/0</td><td>local, scope size 4×4</td><td>78.9</td><td>43.7</td><td>7.61</td></tr><tr><td>w/o</td><td>78.0</td><td>24.8</td><td>4.10</td></tr><tr><td>with DCN</td><td></td><td>local, scope size 4×4</td><td>79.0</td><td>26.1</td><td>4.60</td></tr><tr><td>MobileNet-V2 MobileNet-V2</td><td>w/o</td><td>local, scope size 4×4</td><td>74.1</td><td>4.7</td><td>0.73</td></tr><tr><td rowspan="2">with SCC</td><td rowspan="2">w/o</td><td>w/o</td><td>74.3</td><td>19.0</td><td>2.19</td></tr><tr><td>local, scope size 4×4</td><td>75.5</td><td>19.7</td><td>2.48</td></tr><tr><td rowspan="2">MobileNet-V2 with DCN</td><td rowspan="2">w/0</td><td>w/o</td><td>73.2</td><td>4.6</td><td>0.52</td></tr><tr><td>local, scope size 4×4</td><td>74.4</td><td>5.8</td><td>0.93</td></tr></table>
|
| 180 |
+
|
| 181 |
+
We further compare and combine DKs with Conditional Convolutions and Deformable Convolutions. Results are recorded in Table 2. We can see that DKs perform comparably on ResNet-V2 and compare favorably on MobileNet-V2 – improve $+ 0 . 9$ from Deformable Convolutions and achieve comparable results with less than a quarter number of parameters compared to Conditional Convolutions. Remarkably, we also show that if combined together, even larger performance gains are in reach. We see consistent boost in top-1 accuracy compared to strong baselines: $+ 1 . 3 / + 1 . 0$ on ResNet-50-DW, and $+ 1 . 2 / + 1 . 2$ on MobileNet-V2. These gaps are bigger than those from our own ablation, suggesting the working mechanisms across the operators to be orthogonal and compatible.
|
| 182 |
+
|
| 183 |
+
# 4.2 OBJECT DETECTION
|
| 184 |
+
|
| 185 |
+
We examine DKs on the COCO benchmark (Lin et al., 2014). For all experiments, we use Faster R-CNN (Ren et al., 2015) with FPN (Lin et al., 2017) as the base detector, plugging in the backbones we previously trained on ImageNet. For MobileNet-V2, we last feature maps of the each resolution for FPN post aggregation. Following the standard protocol, training and evaluation are performed on the $1 2 0 \mathrm { k }$ images in the train-val split and the 20k images in the test-dev split, respectively. For evaluation, we measure the standard mean average precision (mAP) and shattered scores for small, medium and large objects.
|
| 186 |
+
|
| 187 |
+
Table 3 and Table 4 follow the same style of analysis as in image classification. While the baseline methods of ResNet achieve $3 6 . 6 \ \mathrm { m A P } ,$ indicating a strong baseline detector, applying local DKs brings a $+ 1 . 2 \mathrm { m A P }$ improvement when replacing 3x3 rigid kernels alone and a $+ 1 . 8$ mAP improvement when replacing both 1x1 and 3x3 rigid kernels. This trend magnifies on MobileNet-v2 models, where we see an improvement of $+ 1 . 6$ mAP and $+ 2 . 4 \ \mathrm { m A P } ,$ , respectively. Results also confirm the effectiveness of local DKs against global DKs, which is again in line with our expectation that local DKs can model locality better.
|
| 188 |
+
|
| 189 |
+
Table 3: Ablations for object detection. Consistent results with image classification.
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Backbone</td><td>1×1Deformable Kernels</td><td>3×3Deformable Kernels</td><td>mAP</td><td>mAPs</td><td>mAPM</td><td>mAPL</td></tr><tr><td>ResNet-50-DW</td><td>w/o</td><td>w/o</td><td>36.6</td><td>22.1</td><td>39.9</td><td>46.6</td></tr><tr><td rowspan="4">ResNet-50-DW</td><td>w/o</td><td>global, scope size 4×4</td><td>36.7</td><td>22.6</td><td>40.2</td><td>46.9</td></tr><tr><td>global,scope size 2×2</td><td>global, scope size 4×4</td><td>37.1</td><td>23.1</td><td>40.6</td><td>46.6</td></tr><tr><td>w/o</td><td>local, scope size 4×4</td><td>37.8</td><td>23.4</td><td>41.6</td><td>48.2</td></tr><tr><td>global, scope size 2×2</td><td>local, scope size 4×4</td><td>38.4</td><td>23.4</td><td>42.0</td><td>49.4</td></tr><tr><td>MobileNet-V2</td><td>w/o</td><td>w/o</td><td>31.3</td><td>18.6</td><td>33.7</td><td>40.4</td></tr><tr><td rowspan="4">MobileNet-V2</td><td>w/o</td><td>global, scope size 4×4</td><td>32.5</td><td>19.6</td><td>35.8</td><td>41.9</td></tr><tr><td>global,scope size 2×2</td><td>global, scope size 4×4</td><td>32.9</td><td>19.4</td><td>35.5</td><td>42.8</td></tr><tr><td>w/0</td><td>local, scope size 4×4</td><td>32.9</td><td>19.5</td><td>36.0</td><td>42.5</td></tr><tr><td>global, scope size 2×2</td><td>local, scope size 4×4</td><td>33.7</td><td>20.2</td><td>36.7</td><td>44.0</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Table 4: Comparisons to strong baselines for object detection DKs perform fall short to Deformable Convolution, but combination still improves performance.
|
| 194 |
+
|
| 195 |
+
<table><tr><td>Backbone</td><td>1×1Deformable Kernels</td><td>3×3DeformableKernels</td><td>mAP</td><td>mAPs</td><td>mAPM</td><td>mAPL</td></tr><tr><td>ResNet-50-DW</td><td>global, scope size 2×2</td><td>local, scope size 4×4</td><td>38.4</td><td>23.4</td><td>42.0</td><td>49.4</td></tr><tr><td>ResNet-50-DW</td><td>w/o</td><td>w/o</td><td>36.3</td><td>22.1</td><td>39.3</td><td>47.0</td></tr><tr><td rowspan="2">with SCC ResNet-50-DW</td><td rowspan="2">w/o</td><td>local, scope size 4×4</td><td>38.0</td><td>23.4</td><td>41.9</td><td>48.4</td></tr><tr><td>w/o</td><td>39.9</td><td>24.0</td><td>43.4</td><td>52.6</td></tr><tr><td>with DCN</td><td></td><td>local,scope size 4×4</td><td>40.6</td><td>24.6</td><td>43.9</td><td>53.3</td></tr><tr><td>MobileNet-V2 MobileNet-V2</td><td>global, scope size 2×2</td><td>local, scope size 4×4 w/o</td><td>33.7</td><td>20.2</td><td>36.7</td><td>44.0</td></tr><tr><td rowspan="2">with SCC</td><td rowspan="2">w/o</td><td>local, scope size 4×4</td><td>33.2</td><td>20.5</td><td>35.6</td><td>43.3</td></tr><tr><td></td><td>34.3</td><td>20.2</td><td>37.3</td><td>44.7</td></tr><tr><td>MobileNet-V2 with DCN</td><td>w/o</td><td>w/o local, scope size 4×4</td><td>34.4 35.6</td><td>20.5 20.6</td><td>37.0 38.5</td><td>44.7 47.3</td></tr></table>
|
| 196 |
+
|
| 197 |
+
For the comparisons with strong baselines, an interesting phenomenon worth noting is that though DKs perform better than Deformable Convolutions on image classification, they fall noticeably short for object detection measured by mAP. We speculate that even though both techniques can adapt ERF in theory (as justified in Section 3.2), directly shifting sampling locations on data is easier to optimize. Yet after combining DKs with previous approaches, we can consistently boost performance for all the methods – $+ 0 . 7 / + 1 . 2$ for Deformable Convolutions on each base models, and $+ 1 . 7 / + 1 . 1$ for Conditional Convolutions. These findings align with the results from image classification. We next investigate what DKs learn and why they are compatible with previous methods in general.
|
| 198 |
+
|
| 199 |
+
# 4.3 WHAT DO DEFORMABLE KERNELS LEARN?
|
| 200 |
+
|
| 201 |
+
Awareness of Object Scale: Since deformation is hard to quantify, we use object scale as a rough proxy to understand what DKs learn. In Figure 3, we show the t-SNE (Maaten & Hinton, 2008) of learned model dynamics by the last convolutional layers in MobileNet-V2 using Conditional Convolution and our DKs. We validate the finding as claimed by Yang et al. (2019) that the experts of Conditional Convolutions have better correlation with object semantics than their scales (in reference to Figure 6 from their paper). Instead, our DKs learn kernel sampling offsets that strongly correlate to scales rather than semantics. This sheds light on why the two operators are complementary in our previous experiments.
|
| 202 |
+
|
| 203 |
+
Adaptation of Effective Receptive Fields: To verify our claim that DK indeed adapts ERFs in practice, we show ERF visualizations on a set of images in which they display different degrees of deformations. We compare the results of rigid kernels, Deformable Convolutions, our DKs, and the combination of the two operators. For all examples, note that the theoretical receptive field covers every pixel in the image but ERFs contain only a central portion of it. Deformable Convolutions and DKs perform similarly in terms of adapting ERFs, but Deformable Convolutions tend to spread out and have sparse responses while DKs tend to concentrate and densely activate within an object region. Combining both operators yields more consistent ERFs that exploit both of their merits.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 3: Semantics vs. Scales. We show t-SNE results of learned model dynamics using 10 random classes of objects from the COCO test-dev split. Each point represents an object extracted by ground-truth bounding box, whose color either denotes its class label or bounding box scale. The color of an object scale is its normalized area rank discretized by every 10th percentile among all data. Numbers inside parentheses indicate the dimension of learned dynamics before t-SNE. (a) The dynamics of Conditional Convolutions are closer to semantics than to object scales. (b) On the contrary, our DKs learn dynamics that are significantly related to scales rather than semantics.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 4: Learned Effective Receptive Fields. We show learned ERFs on three images with large, medium, and small objects from the COCO test-dev split. Given each ground-truth bounding box, we visualize the non-zero ERF values of its central point. Theoretical RFs cover the whole image for all three examples and we thus ignore them in our plots. (a) Rigid kernels have strong central effects and a Gaussian-like ERF that cannot deal with object deformation alone. (b) Deformable Convolutions and (c) Deformable Kernels both tune ERFs to data. (d) Combining both operators together enables better modeling of 2D geometric transformation of objects.
|
| 210 |
+
|
| 211 |
+
# 5 CONCLUSION
|
| 212 |
+
|
| 213 |
+
In this paper, we introduced Deformable Kernels (DKs) to adapt effective receptive fields (ERFs) of convolutional networks for object deformation. We proposed to sample kernel values from the original kernel space. This in effect samples the ERF in linear networks and also roughly generalizes to non-linear cases. We instantiated two variants of DKs and validate our designs, showing connections to previous works. Consistent improvements over them and compatibility with them were found, as illustrated in visualizations.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Joan Bruna and Stephane Mallat. Invariant scattering convolution networks. ´ TPAMI, 2013.
|
| 218 |
+
|
| 219 |
+
Taco Cohen and Max Welling. Group equivariant convolutional networks. In ICML, 2016.
|
| 220 |
+
|
| 221 |
+
Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In CVPR, 2017.
|
| 222 |
+
|
| 223 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 224 |
+
|
| 225 |
+
Carlos Esteves, Christine Allen-Blanchette, Xiaowei Zhou, and Kostas Daniilidis. Polar transformer networks. In ICLR, 2018.
|
| 226 |
+
|
| 227 |
+
James J Gibson. The perception of the visual world. Houghton Mifflin, 1950.
|
| 228 |
+
|
| 229 |
+
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.
|
| 230 |
+
|
| 231 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 232 |
+
|
| 233 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. In CVPR, 2017.
|
| 234 |
+
|
| 235 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. In CVPR, 2018.
|
| 236 |
+
|
| 237 |
+
Drew A Hudson and Christopher D Manning. Learning by abstraction: The neural state machine. arXiv preprint arXiv:1907.03950, 2019.
|
| 238 |
+
|
| 239 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In NeurIPS, 2015.
|
| 240 |
+
|
| 241 |
+
Xu Jia, Bert De Brabandere, Tinne Tuytelaars, and Luc V Gool. Dynamic filter networks. In NeurIPS, 2016.
|
| 242 |
+
|
| 243 |
+
Angjoo Kanazawa, Abhishek Sharma, and David W. Jacobs. Locally scale-invariant convolutional neural networks. In NeurIPS Workshop, 2016.
|
| 244 |
+
|
| 245 |
+
Svetlana Lazebnik, Cordelia Schmid, and Jean Ponce. Beyond bags of features: Spatial pyramid matching for recognizing natural scene categories. In CVPR, 2006.
|
| 246 |
+
|
| 247 |
+
Xiang Li, Wenhai Wang, Xiaolin Hu, and Jian Yang. Selective kernel networks. In CVPR, 2019.
|
| 248 |
+
|
| 249 |
+
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. In ´ ECCV, 2014.
|
| 250 |
+
|
| 251 |
+
Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. ´ Feature pyramid networks for object detection. In CVPR, 2017.
|
| 252 |
+
|
| 253 |
+
Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. In ICLR, 2017.
|
| 254 |
+
|
| 255 |
+
David G Lowe et al. Object recognition from local scale-invariant features. In ICCV, 1999.
|
| 256 |
+
|
| 257 |
+
Wenjie Luo, Yujia Li, Raquel Urtasun, and Richard Zemel. Understanding the effective receptive field in deep convolutional neural networks. In NeurIPS, 2016.
|
| 258 |
+
|
| 259 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 2008.
|
| 260 |
+
|
| 261 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NeurIPS, 2015.
|
| 262 |
+
|
| 263 |
+
Ignacio Rocco, Relja Arandjelovic, and Josef Sivic. Convolutional neural network architecture for geometric matching. In CVPR, 2017.
|
| 264 |
+
|
| 265 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, 2018.
|
| 266 |
+
|
| 267 |
+
Evan Shelhamer, Dequan Wang, and Trevor Darrell. Blurring the line between structure and learning to optimize and adapt receptive fields. arXiv preprint arXiv:1904.11487, 2019.
|
| 268 |
+
|
| 269 |
+
Laurent Sifre and Stephane Mallat. Rotation, scaling and deformation invariant scattering for texture ´ discrimination. In CVPR, 2013.
|
| 270 |
+
|
| 271 |
+
Hugues Thomas, Charles R Qi, Jean-Emmanuel Deschaud, Beatriz Marcotegui, Franc¸ois Goulette, and Leonidas J Guibas. Kpconv: Flexible and deformable convolution for point clouds. In ICCV, 2019.
|
| 272 |
+
|
| 273 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 274 |
+
|
| 275 |
+
Dequan Wang, Evan Shelhamer, Bruno Olshausen, and Trevor Darrell. Dynamic scale inference by entropy optimization. arXiv preprint arXiv:1908.03182, 2019.
|
| 276 |
+
|
| 277 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks. In CVPR, 2018.
|
| 278 |
+
|
| 279 |
+
Daniel E Worrall, Stephan J Garbin, Daniyar Turmukhambetov, and Gabriel J Brostow. Harmonic networks: Deep translation and rotation equivariance. In CVPR, 2017.
|
| 280 |
+
|
| 281 |
+
Saining Xie, Ross Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual trans-´ formations for deep neural networks. In CVPR, 2017.
|
| 282 |
+
|
| 283 |
+
Yuwen Xiong, Mengye Ren, Renjie Liao, Kelvin Wong, and Raquel Urtasun. Deformable filter convolution for point cloud reasoning. arXiv preprint arXiv:1907.13079, 2019.
|
| 284 |
+
|
| 285 |
+
Brandon Yang, Gabriel Bender, Quoc V Le, and Jiquan Ngiam. Soft conditional computation. arXiv preprint arXiv:1904.04971, 2019.
|
| 286 |
+
|
| 287 |
+
Richard Zhang. Making convolutional networks shift-invariant again. In ICML, 2019.
|
| 288 |
+
|
| 289 |
+
Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In CVPR, 2019.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 5: Illustration of feed-forwarding through a $\mathbf { 3 \times 3 }$ local Deformable Kernel from a $4 \times 4$ scope. For each input patch, local DK first generates a group of kernel offsets $\{ \Delta k \}$ from input feature patch using the light-weight generator $\mathcal { G }$ (a $3 \times 3$ convolution of rigid kernel). Given the original kernel weights $W$ and the offset group $\{ \Delta k \}$ , DK samples a new set of kernel $W ^ { \prime }$ using a bilinear sampler $\boldsymbol { B }$ . Finally, DK convolves the input feature map and the sampled kernels to complete the whole computation.
|
| 293 |
+
|
| 294 |
+
# A COMPUTATION FLOW OF DEFORMABLE KERNELS
|
| 295 |
+
|
| 296 |
+
We now cover more details on implementing DKs by elaborating the computation flow of their forward and backward passes. We will focus on the local DK given its superior performance in practice. The extension to global DK implementation is straight-forward.
|
| 297 |
+
|
| 298 |
+
# A.1 FORWARD PASS
|
| 299 |
+
|
| 300 |
+
In Section 3.3, we introduce a kernel offset generator $\mathcal { G }$ and a bilinear sampler $\boldsymbol { B }$ . Figure 5 illustrates an example of the forward pass.
|
| 301 |
+
|
| 302 |
+
Concretely, given a kernel $W$ and a learned group of kernel offsets $\{ \Delta k \}$ on top of a regular 2D grid $\{ k \}$ , we can resample a new kernel $W ^ { \prime }$ by a bilinear operator $\boldsymbol { B }$ as
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { c } { W ^ { \prime } \equiv W _ { k + \Delta k } = \displaystyle \sum _ { k ^ { \prime } \in K } | \beta ( k + \Delta k , k ^ { \prime } ) W _ { k ^ { \prime } } , } \\ { \displaystyle \mathcal { B } ( k + \Delta k , k ^ { \prime } ) = \operatorname* { m a x } ( 0 , 1 - | k _ { x } + \Delta k _ { x } - k _ { x } ^ { \prime } | ) \cdot \operatorname* { m a x } ( 0 , 1 - | k _ { y } + \Delta k _ { y } - k _ { y } ^ { \prime } | ) . } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
Given this resampled kernel, DK convolves it with the input image just as in normal convolutions using rigid kernels, characterized by Equation 1.
|
| 309 |
+
|
| 310 |
+
# A.2 BACKWARD PASS
|
| 311 |
+
|
| 312 |
+
The backward pass of local DK consists of three types of gradients: (1) the gradient to the data of the previous layer, (2) the gradient to the full scope kernel of the current layer and (3) the additional gradient to the kernel offset generator of the current layer. The first two types of gradients share same forms of the computation comparing to the normal convolutions. We now cover the computation for the third flow of gradient that directs where to sample kernel values.
|
| 313 |
+
|
| 314 |
+
In the context of Equation 7, the partial derivative of a output item $O _ { j }$ w.r.t. $x$ component of a given kernel offset $\Delta k _ { x }$ (similar for its $y$ component $\Delta k _ { y }$ ) can be computed as
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\frac { \partial O _ { j } } { \partial \Delta k _ { x } } = \sum _ { k } I _ { j + k } \bigg ( \sum _ { k ^ { \prime } } W _ { k ^ { \prime } } \frac { \partial \mathcal { B } ( k + \Delta k , k ^ { \prime } ) } { \partial \Delta k _ { x } } \bigg ) ,
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
\frac { \partial \mathcal { B } ( k + \Delta k , k ^ { \prime } ) } { \partial \Delta k _ { x } } = \operatorname* { m a x } ( 0 , 1 - | k _ { y } + \Delta k _ { y } - k _ { y } ^ { \prime } | ) \cdot \left\{ \begin{array} { l l } { 0 } & { | k _ { x } + \Delta k _ { x } - k _ { x } ^ { \prime } | \ge 1 } \\ { 1 } & { k _ { x } + \Delta k _ { x } < k _ { x } ^ { \prime } } \\ { - 1 } & { k _ { x } + \Delta k _ { x } \ge k _ { x } ^ { \prime } } \end{array} \right. .
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Table 5: Network architecture of our ResNet-50-DW comparing to the original ResNet-50 Inside the brackets are the general shape of a residual block, including filter sizes and feature dimensionalities. The number of stacked blocks on each stage is presented outside the brackets. $G = 1 2 8 ^ { \prime \prime }$ suggests the depthwise convolution with 128 input channels. Two models have similar numbers of parameters and FLOPs. At the same time, depthwise convolutions facilitate the computation efficiency of our Deformable Kernels.
|
| 325 |
+
|
| 326 |
+
<table><tr><td rowspan=1 colspan=1>Output</td><td rowspan=1 colspan=3>ResNet-50</td><td rowspan=1 colspan=4>ResNet-50-DW</td></tr><tr><td rowspan=1 colspan=1>112 × 112</td><td rowspan=1 colspan=7>7 × 7,64,stride 2</td></tr><tr><td rowspan=1 colspan=1>56×56</td><td rowspan=1 colspan=7>3 × 3 max pool, stride 2</td></tr><tr><td rowspan=1 colspan=1>56×56</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1×1,643 ×3,641 × 1,256</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1 ×1,1283 × 3,128,G = 1281 × 1,256</td><td rowspan=1 colspan=1>×3</td></tr><tr><td rowspan=1 colspan=1>28×28</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1×1,1283 ×3,1281 × 1,512</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1 ×1,2563 × 3,256,G = 2561 ×1,512</td><td rowspan=1 colspan=1>×4</td></tr><tr><td rowspan=1 colspan=1>14 ×14</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1 ×1,2563 ×3,2561 × 1,1024</td><td rowspan=1 colspan=1>×6</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>1 ×1,5123 × 3,512,G = 5121 × 1,1024</td><td rowspan=1 colspan=1>×6</td></tr><tr><td rowspan=1 colspan=1>7×7</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1 ×1,5123 ×3,5121 × 1,2048</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>1 ×1,10243 × 3,1024,G =10241 × 1,2048</td><td rowspan=1 colspan=1>×3</td></tr><tr><td rowspan=1 colspan=1>1×1</td><td rowspan=1 colspan=7>7 × 7 global average pool,1000-d fc, softmax</td></tr><tr><td rowspan=1 colspan=1>#P (M)</td><td rowspan=1 colspan=3>25.6</td><td rowspan=1 colspan=4>23.7</td></tr><tr><td rowspan=1 colspan=1>GFLOPs</td><td rowspan=1 colspan=3>3.86</td><td rowspan=1 colspan=4>3.82</td></tr></table>
|
| 327 |
+
|
| 328 |
+
# B NETWORK ARCHITECTURES
|
| 329 |
+
|
| 330 |
+
Table 5 shows the comparison between the original ResNet-50 (He et al., 2016) and our modified ResNet-50-DW. The motivation of introducing depthwise convolutions to ResNet is to accelerate the computation of local DKs based on our current implementations. The ResNet-50-DW model has similar model capacity/complexity and performance (see Table 1) compared to its non-depthwise counterpart, making it an ideal base architecture for our experiments.
|
| 331 |
+
|
| 332 |
+
On the other hand, in all of our experiments, MobileNet-V2 (Sandler et al., 2018) base model is left untouched.
|
| 333 |
+
|
| 334 |
+
# C ADDITIONAL COMPARISON OF EFFECTIVE RECEPTIVE FIELDS
|
| 335 |
+
|
| 336 |
+
We here show additional comparison of ERFs when objects have different kinds of deformations in Figure 6. Comparing to baseline, our method can adapt ERFs to be more persistent to object’s semantic rather than its geometric configuration.
|
| 337 |
+
|
| 338 |
+
# D ADDITIONAL EXPERIMENT DETAILS
|
| 339 |
+
|
| 340 |
+
Image Classification: Similar to Goyal et al. (2017); Loshchilov & Hutter (2017), training is performed by SGD for 90 epochs with momentum 0.9 and batch size 256. We set our learning rate of $1 0 ^ { - 1 }$ so that it linearly warms up from zero within first 5 epochs. A cosine training schedule is applied over the training epochs. We use scale and aspect ratio augmentation with color perturbation as standard data augmentations. We evaluate the performance of trained models on the ImageNet 2012 validation set. The images are resized so that the shorter side is of 256 pixels. We then centrally crop $2 2 4 \times 2 2 4$ windows from the images as input to measure recognition accuracy.
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 6: Effective Receptive Field Comparison between rigid kernels and DKs under different kinds of Object Deformation. At each row and from left to right, we show the original image $( 1 3 0 0 \times 8 0 0 )$ , the image rotated by -90 degrees and the image scaled by 1.5 times. Images are cropped and resized for the typesetting purpose.
|
md/train/ZBfUo_dr4H/ZBfUo_dr4H.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DROID-SLAM: Deep Visual SLAM for Monocular, Stereo, and RGB-D Cameras
|
| 2 |
+
|
| 3 |
+
Zachary Teed Jia Deng Princeton University {zteed,jiadeng}@princeton.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We introduce DROID-SLAM, a new deep learning based SLAM system. DROIDSLAM consists of recurrent iterative updates of camera pose and pixelwise depth through a Dense Bundle Adjustment layer. DROID-SLAM is accurate, achieving large improvements over prior work, and robust, suffering from substantially fewer catastrophic failures. Despite training on monocular video, it can leverage stereo or RGB-D video to achieve improved performance at test time. The URL to our open source code is https://github.com/princeton-vl/DROID-SLAM.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Simultaneous Localization and Mapping (SLAM) aims to (1) build a map of the environment and (2) localize the agent within the environment. It is a special form of Structure-from-Motion (SfM) focused on accurate tracking of long-term trajectories. It is a critical capability for robotics, especially autonomous vehicles. In this work, we address visual SLAM, where sensor recordings come in the form of images captured from a monocular, stereo, or RGB-D camera.
|
| 12 |
+
|
| 13 |
+
The SLAM problem has been approached from a number of different angles. Early work was built using probabilistic and filtering based approaches [12, 30], and alternating optimization of the map and camera poses [34, 16]. More recently, modern SLAM systems have leveraged least-squares optimization. A key element for accuracy has been full Bundle Adjustment (BA), which jointly optimizes the camera poses and the 3D map in a single optimization problem. One advantage of the optimization-based formulation is that a SLAM system can be easily modified to leverage different sensors. For example, ORB-SLAM3 [5] supports monocular, stereo, RGB-D, and IMU sensors, and modern systems can support a variety of camera models [5, 27, 42, 6]. Despite significant progress, current SLAM systems lack the robustness demanded for many real-world applications. Failures come in many forms, such as lost feature tracks, divergence in the optimization algorithm, and accumulation of drift.
|
| 14 |
+
|
| 15 |
+
Deep learning has been proposed as a solution to many of these failure cases. Previous work has investigated replacing hand-crafted with learned features[13, 7, 29, 26, 35], using neural 3D representations[46, 1, 9, 45, 44, 25, 22], and combining learned energy terms with classical optimization backends[58, 57]. Other work has tried to learn SLAM or VO systems end-to-end [59, 47, 53, 52, 46]. While these systems are sometimes more robust, they fall far short of the accuracy of their classical counterparts on common benchmarks.
|
| 16 |
+
|
| 17 |
+
In this work we introduce DROID-SLAM, a new SLAM system based on deep learning. It has state-of-the-art performance, outperforming existing SLAM systems, classical or learning-based, on challenging benchmarks with very large margins. In particular, it has the following advantages:
|
| 18 |
+
|
| 19 |
+
• High Accuracy: We achieve large improvements over prior work across multiple datasets and modalities. On the TartanAir SLAM competition [54], we reduce error by $62 \%$ over the best prior result on the monocular track and $60 \%$ on the stereo track. We rank 1st on the
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: DROID-SLAM can operate on monocular, stereo, and RGB-D video. It builds a dense 3D map of the environment while simultaneously localizing the camera within the map.
|
| 23 |
+
|
| 24 |
+
ETH-3D RGB-D SLAM leaderboard [41], outperforming the second place by $3 5 \%$ under the AUC metric which considers both error and rate of catastrophic failure. On EuRoC [2], with monocular input, we reduce error by $82 \%$ among methods with zero failures, and by $43 \%$ over ORB-SLAM3 considering only the 10 out of 11 sequences it succeeds on. With stereo input, we reduce error by $71 \%$ over ORB-SLAM3. On TUM-RGBD [43], we reduce error by $83 \%$ among the methods with zero failures.
|
| 25 |
+
|
| 26 |
+
• High Robustness: We have substantially fewer catastrophic failures than prior systems. On ETH-3D, we successfully track 30 of the 32 RGB-D datasets, while the next best successfully tracks only 19/32. On TartanAir, EuRoC, and TUM-RGBD, we have zero failures.
|
| 27 |
+
|
| 28 |
+
• Strong Generalization: Our system, trained only with monocular input, can directly use stereo or RGB-D input to get improved accuracy without any retraining. All of our results across 4 datasets and 3 modalities are achieved by a single model, trained once with only monocular input entirely on the synthetic TartanAir dataset.
|
| 29 |
+
|
| 30 |
+
The strong performance and generalization of DROID-SLAM is made possible by its “Differentiable Recurrent Optimization-Inspired Design” (DROID), which is an end-to-end differentiable architecture that combines the strengths of both classical approaches and deep networks. Specifically, it consists of recurrent iterative updates, building upon RAFT [48] for optical flow but introducing two key innovations.
|
| 31 |
+
|
| 32 |
+
First, unlike RAFT, which iteratively updates optical flow, we iteratively update camera poses and depth. Whereas RAFT operates on two frames, our updates are applied to an arbitrary number of frames, enabling joint global refinement of all camera poses and depth maps, essential for minimizing drift for long trajectories and loop closures.
|
| 33 |
+
|
| 34 |
+
Second, each update of camera poses and depth maps in DROID-SLAM is produced by a differentiable Dense Bundle Adjustment (DBA) layer, which computes a Gauss-Newton update to camera poses and dense per-pixel depth so as to maximize their compatibility with the current estimate of optical flow. This DBA layer leverages geometric constraints, improves accuracy and robustness, and enables a monocular system to handle stereo or RGB-D input without retraining.
|
| 35 |
+
|
| 36 |
+
The design of DROID-SLAM is novel. The closest prior deep architectures are DeepV2D [47] and BA-Net [46], both of which were focused on depth estimation and reported limited SLAM results. DeepV2D alternates between updating depth and updating camera poses, instead of bundle adjustment. BA-Net has a bundle adjustment layer, but their layer is substantially different: it is not “dense” in that it optimizes over a small number of coefficients used to linearly combine a depth basis (a set of pre-predicted depth maps), whereas we optimize over per-pixel depth directly, without being handicapped by a depth basis. In addition, BA-Net optimizes photometric reprojection error (in feature space), whereas we optimize geometric error, leveraging state-of-the-art flow estimation.
|
| 37 |
+
|
| 38 |
+
We perform extensive evaluation across four different datasets and three different sensor modalities, demonstrating state-of-the-art performance in all cases. We also include ablation studies that shed light on important design decisions and hyperparameters.
|
| 39 |
+
|
| 40 |
+
# 2 Related Work
|
| 41 |
+
|
| 42 |
+
Modern SLAM systems treat localization and mapping as a joint optimization problem [4].
|
| 43 |
+
|
| 44 |
+
Visual SLAM focuses on observations in the form of monocular, stereo, or RGB-D images. These approaches are commonly categorized as either being direct or indirect [15]. Indirect approaches [31, 32, 5, 37] first process the image into an intermediate representation by detecting points of interest and attaching feature descriptors. Features are then matched between images. Indirect approaches optimize camera pose and a 3D point cloud by minimizing reprojection error–the distance between a projected 3D point and its location in the image.
|
| 45 |
+
|
| 46 |
+
Direct approaches model the image formation process and define an objective function over photometric error [16, 15, 60]. One advantage of direct approaches is that they can model more information about the image, such as lines and intensity variations[15] which are not used by indirect approaches. However, photometric errors typically lead to more difficult optimization problems, and direct approaches are less robust to geometric distortion such as rolling shutter artifacts. This approach requires more sophisticated optimization techniques, such as coarse-to-fine image pyramids to avoid local minimum.
|
| 47 |
+
|
| 48 |
+
Our method does not clearly fit into either of the categories. Like the direct approach, we do not require preprocessing steps to detect and match features between the images. We instead use the full image, allowing us to leverage a wider range of information than indirect methods with typically only use corners and edges. However, we minimize reprojection error similar to indirect methods. This is an easier optimization problem and avoids the need for more complicated representations such as image pyramids. In this sense, our approach borrows the best of both approaches: the smoother objective function of indirect approaches with the greater modeling capacity of indirect approaches.
|
| 49 |
+
|
| 50 |
+
Deep Learning has more recently been applied to the SLAM problem. Many works have focused on training systems for particular subproblems, such as feature detection [13, 7, 29, 26, 35], feature matching and outlier rejection [38, 36], and localization [51, 39]. SuperGlue [38] was designed to perform feature matching and verification and make 2-view pose estimate much more robust. Our network also draws inspiration from Dusmanu et al[14], which builds a neural network into the SfM pipeline to improve keypoint localization accuracy.
|
| 51 |
+
|
| 52 |
+
Other works have focused on training SLAM systems end-to-end [59, 46, 8, 50, 24, 47, 53]. These methods are not full SLAM systems, but instead focus on small scale reconstruction on the order of two [8, 50, 53] up to a dozen frames [59, 46, 47]. They lack many of the core capabilities of modern SLAM systems such as loop closure and global bundle adjustment which inhibit their ability to perform large scale reconstruction as demonstrated in our experiments. ∇SLAM[23] implements several existing SLAM algorithms as differentiable computation graphs, allowing for errors in the reconstruction to be backpropagated back to sensor measurements. While this approach is differentiable, it has no trainable parameters, meaning the performance of the system is limited by the accuracy of the classical algorithm they emulate.
|
| 53 |
+
|
| 54 |
+
DeepFactors[9] is the most complete deep SLAM system, building on the earlier CodeSLAM[1]. It performs joint optimization of the pose and depth variables, and is capable of short and long-range loop closure. Similar to BA-Net[46], DeepFactors optimizes the parameters of a learned depth basis during inference. In contrast, we do not rely on a learned basis, but instead optimize pixelwise depth. This allows our network to better generalize to new datasets since our depth representation is not tied to the training dataset.
|
| 55 |
+
|
| 56 |
+
# 3 Approach
|
| 57 |
+
|
| 58 |
+
We take a video as input with two objectives: estimate the trajectory of the camera and build a 3D map of the environment. We first describe the monocular setting; in Sec. 3.4 we describe how to generalize the system to stereo and RGB-D video.
|
| 59 |
+
|
| 60 |
+
Representation: Our network operates on an ordered collection of images, $\{ \mathbf { I } _ { t } \} _ { t = 0 } ^ { N }$ . For each image $t$ , we maintain two state variables: camera pose $\mathbf { G } _ { t } \in S E ( 3 )$ and inverse depth $\check { \mathbf { d } } _ { t } \in \mathbb { R } _ { + } ^ { H \times W }$ . The set of poses, $\{ \mathbf { G } _ { t } \} _ { t = 0 } ^ { N }$ , and set of inverse depths $\{ \mathbf { d } _ { t } \} _ { t = 0 } ^ { N }$ are unknown state variables, which get iteratively updated during inference as new frames are processed. For the reminder of the paper, when we refer to depths, note that we are using the inverse depth parameterization.
|
| 61 |
+
|
| 62 |
+
We adopt a frame-graph $( \nu , \mathcal { E } )$ to represent co-visibility between frames. An edge $( i , j ) \in \mathcal { E }$ means image $\mathbf { I } _ { i }$ and $\mathbf { I } _ { j }$ have overlapping fields of view which shared points. The frame graph is built dynamically during training and inference. After each pose or depth update, we can recompute visibility to update the frame graph. If the camera returns to a previously mapped region, we add long range connections in the graph to perform loop closure.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Illustration of the update operator. The operator acts on edges in the frame graph, predicting flow revisions which are mapped to depth and pose update through the (DBA) layer.
|
| 66 |
+
|
| 67 |
+
# 3.1 Feature Extraction and Correlation
|
| 68 |
+
|
| 69 |
+
Features are extracted from each new image added to they system. Key components of this stage are borrowed from RAFT[48].
|
| 70 |
+
|
| 71 |
+
Feature Extraction Each of the input images are processed by a feature extraction network. The network consists of 6 residual blocks and 3 downsampling layers, producing dense feature maps at 1/8 the input image resolution. Like RAFT[48], we use two separate networks: a feature network and a context network. The feature network is used to build the set of correlation volumes, while the context features are injected into the network during each application of the update operator.
|
| 72 |
+
|
| 73 |
+
Correlation Pyramid For each edge in the frame graph, $( i , j ) \in \mathcal { E }$ , we compute a 4D correlation volume by taking the dot product between all-pairs of feature vectors in $g _ { \boldsymbol { \theta } } ( I _ { i } )$ and $g _ { \boldsymbol { \theta } } ( I _ { j } )$
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
C _ { u _ { 1 } v _ { 1 } u _ { 2 } v _ { 2 } } ^ { i j } = \langle g _ { \theta } ( I _ { i } ) _ { u _ { 1 } v _ { 1 } } , g _ { \theta } ( I _ { j } ) _ { u _ { 2 } v _ { 2 } } \rangle
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
We then perform average pooling of the last two dimension of the correlation volume following RAFT[48] to form a 4-level correlation pyramid.
|
| 80 |
+
|
| 81 |
+
Correlation Lookup We define a lookup operator which indexes the correlation volume using a grid with radius $r$ , $\mathbf { , } \ L _ { r } : \mathbb { R } ^ { H \times W \times H \times W } \times \mathbb { R } ^ { H \times W \times 2 } \mapsto \mathbb { R } ^ { H \times W \times ( r + 1 ) ^ { 2 } }$ .
|
| 82 |
+
|
| 83 |
+
The lookup operator takes an $H \times W$ grid of coordinates as input and values are retrieved from the correlation volume using bilinear interpolation. The operator is applied to each correlation volume in the pyramid and the final feature vector is computed by concatenating the results at each level.
|
| 84 |
+
|
| 85 |
+
# 3.2 Update Operator
|
| 86 |
+
|
| 87 |
+
The core component of our SLAM system is a learned update operator show in Fig. 2. The update operator is a $3 \times 3$ convolutional GRU with hidden state $\mathbf { h }$ . Each application of the operator updates the hidden state, and additionally produces a pose update, $\Delta \xi ^ { ( k ) }$ , and depth update, $\Delta \mathbf { d } ^ { ( k ) }$ . The pose and depth updates are applied to the current depth and pose estimates through retraction on the SE3 manifold and vector addition respectively
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathbf { G } ^ { ( k + 1 ) } = \mathrm { E x p } ( \Delta \pmb { \xi } ^ { ( k ) } ) \circ \mathbf { G } ^ { ( k ) } , \qquad \mathbf { d } ^ { ( k + 1 ) } = \Delta \mathbf { d } ^ { ( k ) } + \mathbf { d } ^ { ( k ) } .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Iterative applications of the update operator produce a sequence of poses and depths, with the expectation of converging to a fixed point $\{ \mathbf { G } ^ { ( k ) } \} \to \mathbf { G } ^ { * }$ , $\{ \mathbf { d } ^ { ( k ) } \} \mathbf { d } ^ { * }$ , reflecting the true reconstruction.
|
| 94 |
+
|
| 95 |
+
Correspondence At the start of each iteration we use the current estimates of poses and depths to estimate correspondence. Given a grid of pixel coordinates, $\mathbf { p } _ { i } \in \mathbb { R } ^ { H \times W \times 2 }$ in frame $i$ , we compute the dense correspondence field $\mathbf { p } _ { i j }$
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\mathbf { p } _ { i j } = \Pi _ { c } \big ( \mathbf { G } _ { i j } \circ \Pi _ { c } ^ { - 1 } \big ( \mathbf { p } _ { i } , \mathbf { d } _ { i } \big ) \big ) , \qquad \mathbf { p } _ { i j } \in \mathbb { R } ^ { H \times W \times 2 } \qquad \mathbf { G } _ { i j } = \mathbf { G } _ { j } \circ \mathbf { G } _ { i } ^ { - 1 } .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
for each edge $( i , j ) \in \mathcal { E }$ in the frame graph. Here $\Pi _ { c }$ is the camera model mapping a set of 3D points onto the image and $\Pi _ { c } ^ { - 1 }$ is the inverse projection function mapping inverse depth map d and coordinate grid $\mathbf { p } _ { i }$ to a 3D point cloud (we provide formulas and Jacobians in the appendix). $\mathbf { p } _ { i j }$ represents the coordinates of pixels $\mathbf { p } _ { i }$ mapped into frame $j$ using the estimated pose and depth.
|
| 102 |
+
|
| 103 |
+
Inputs We use the correspondence field to index the correlation volumes. For each edge $( i , j ) \in \mathcal { E }$ we use $\mathbf { p } _ { i j }$ to perform lookup from the correlation volume $\mathbf { C } _ { i j }$ to retrieve correlation features. Additionally, we use the correspondence field to derive optical flow induced by camera motion as the difference $\mathbf { p } _ { i j } - \mathbf { p } _ { j }$ . Furthermore, the residual from the previous BA solution is concatenated with the flow field allowing the network to use feedback from the previous iteration.
|
| 104 |
+
|
| 105 |
+
The correlation features provide information about visual similarity in the neighbourhood of $\mathbf { p } _ { i j }$ allowing the network to learn to align visually similar image regions. However, correspondence is sometimes ambiguous. The flow provides an complementary source of information allowing the network to exploit smoothness in the motion fields to gain robustness.
|
| 106 |
+
|
| 107 |
+
Update The correlation features and flow features are each mapped through two convolutional layers before being injected into the GRU. Additionally, we inject context features, as extracted by the context network, into the GRU through element-wise addition.
|
| 108 |
+
|
| 109 |
+
The ConvGRU is a local operation with a small receptive field. We extract global context by averaging the hidden state across the spatial dimensions of the image and use this feature vector as additional input to the GRU. Global context is important in SLAM because incorrect correspondences, caused by large moving objects for example, can degrade the accuracy of the system. It is important for the network to recognize and reject erroneous correspondence.
|
| 110 |
+
|
| 111 |
+
The GRU produces an updated hidden state $\mathbf { h } ^ { ( k + 1 ) }$ . Instead of predicting updates to the depth or pose directly, we instead predict updates in the space of dense flow fields. We map the hidden state through two additional convoluation layers to produce two outputs: (1) a revision flow field $\mathbf { r } _ { i j } \in \mathbb { R } ^ { H \times W \times 2 }$ and (2) associated confidence map $\mathbf { w } _ { i j } \in \mathbb { R } _ { + } ^ { H \times W \times 2 }$ . The revision $\mathbf { r } _ { i j }$ is a correction term predicted by the network to correct errors in the dense correspondence field. We denote the corrected correspondence as $\mathbf { p } _ { i j } ^ { * } = \mathbf { r } _ { i j } + \mathbf { p } _ { i j }$
|
| 112 |
+
|
| 113 |
+
We then pool the hidden state over all features which share the same source view $i$ and predict a pixel-wise damping factor $\lambda$ . We use the softplus operator to ensure that the damping term is positive. Additionally, we use the pooled features to predict a $8 \mathrm { x } 8$ mask which can be used to upsample the inverse depth estimate.
|
| 114 |
+
|
| 115 |
+
Dense Bundle Adjustment Layer (DBA) The Dense Bundle Adjustment Layer (DBA) maps the set of flow revisions into a set of pose and pixelwise depth updates. We define the cost function over the entire frame graph
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\mathbf { E } ( \mathbf { G } ^ { \prime } , \mathbf { d } ^ { \prime } ) = \sum _ { ( i , j ) \in \mathcal { E } } \big \| \mathbf { p } _ { i j } ^ { * } - \Pi _ { c } \big ( \mathbf { G } _ { i j } ^ { \prime } \circ \Pi _ { c } ^ { - 1 } \big ( \mathbf { p } _ { i } , \mathbf { d } _ { i } ^ { \prime } \big ) \big ) \big \| _ { \Sigma _ { i j } } ^ { 2 } \qquad \Sigma _ { i j } = \mathrm { d i a g } \mathbf { w } _ { i j } .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\lVert \cdot \rVert _ { \Sigma }$ is the Mahalanobis distance which weights the error terms based on the confidence weights $\mathbf { w } _ { i j }$ . Eqn. 4 states that we want an updated pose $\mathbf { G } ^ { \prime }$ and depth $\mathbf { d } ^ { \prime }$ such that reprojected points match the revised correspondence $\mathbf { p } _ { i j } ^ { * }$ as predicted by the update operator.
|
| 122 |
+
|
| 123 |
+
We use local parameterization to linearize Eqn. 4 and use the Gauss-Newton algorithm solve for updates $( \Delta \xi , \Delta \mathbf { d } )$ . Since each term in Eqn. 4 only includes a single depth variable, the Hessian matrix has block diagonal structure. Separating pose and depth variables, the system can be solved efficiently using the Schur complement with the pixelwise damping factor $\lambda$ added to the depth block
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r } \left[ \begin{array} { l l } { \mathbf { B } } & { \mathbf { E } } \\ { \mathbf { E } ^ { T } } & { \mathbf { C } } \end{array} \right] \left[ \boldsymbol { \Delta } \pmb { \xi } \right] = \left[ \mathbf { v } \right] \qquad \begin{array} { r l } & { \boldsymbol { \Delta } \pmb { \xi } = [ \mathbf { B } - \mathbf { E } \mathbf { C } ^ { - 1 } \mathbf { E } ^ { T } ] ^ { - 1 } ( \mathbf { v } - \mathbf { E } \mathbf { C } ^ { - 1 } \mathbf { w } ) } \\ & { \boldsymbol { \Delta } \mathbf { d } = \mathbf { C } ^ { - 1 } ( \mathbf { w } - \mathbf { E } ^ { T } \boldsymbol { \Delta } \pmb { \xi } ) } \end{array} \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\mathbf { C }$ is diagonal and can be cheaply inverted ${ \bf C } ^ { - 1 } = 1 / { \bf C }$ . The DBA layer is implemented as part of the computation graph and backpropogation is performed through the layer during training.
|
| 130 |
+
|
| 131 |
+
# 3.3 Training
|
| 132 |
+
|
| 133 |
+
Our SLAM system is implemented in PyTorch and we use the LieTorch extension [49] to perform backprogation in the tangent space of all group elements.
|
| 134 |
+
|
| 135 |
+
Removing gauge freedom In the monocular setting, the network is only able to recover the trajectory of the camera up to a similarity transform. One solution is to define a loss which is invariant to similarity transforms. However, the gauge-freedom still exists during training which poorly impacts the conditioning of the linear system and the stability of the gradients. We solve this problem by fixing the first two poses to the ground-truth poses of each training sequence. Fixing the first pose removes the 6-dof gauge freedom. Fixing the second pose resolves the scale freedom.
|
| 136 |
+
|
| 137 |
+
Constructing training video Each training example consists of a 7-frame video sequence. In order to ensure stable training and good downstream performance, we want to sample videos which are not too easy nor too difficult.
|
| 138 |
+
|
| 139 |
+
The training set is composed of a collection of videos. For each video $i$ of length $N _ { i }$ , we precompute an $N _ { i } \times N _ { i }$ distance matrix storing the average optical flow magnitude between each pair of frames. However, not all frames are covisible; and frames pairs with less than $50 \%$ overlap are assigned a distance of infinity. During training, we dynamically generate videos by sampling paths in the distance matrix, such that the average flow between adjacent video frames is between 8px and 96px.
|
| 140 |
+
|
| 141 |
+
Supervision We supervise our network using a combination of pose loss and flow loss. The flow loss is applied to pairs of adjacent frames. We compute the optical flow induced by the predicted depth and poses and the flow induced by the ground truth depth and poses. The loss is taken to be the average l2 distance between the two flow fields.
|
| 142 |
+
|
| 143 |
+
Given a set of ground truth poses $\{ \mathbf { T } \} _ { i } ^ { N }$ and predicted poses $\{ \mathbf { G } \} _ { i } ^ { N }$ , the pose loss is taken to be the distance between the ground truth and predicted poses, $\begin{array} { r } { \mathcal { L } _ { p o s e } = \sum _ { i } | | \operatorname { L o g } _ { S E 3 } ( \mathbf { T } _ { i } ^ { - 1 } \cdot \mathbf { G } _ { i } ) | | _ { 2 } } \end{array}$ . We apply the losses to the output of every iteration with exponentially increasing weight using $\gamma = 0 . 9$ .
|
| 144 |
+
|
| 145 |
+
# 3.4 SLAM System
|
| 146 |
+
|
| 147 |
+
During inference, we compose the network into a full SLAM system. The SLAM system takes a video stream as input, and performs reconstruction and localization in real-time. Our system contains two threads which run asynchronously. The frontend thread takes in new frames, extracts features, selects keyframes, and performs local bundle adjustment. The backend thread simultaneously performs global bundle adjustment over the entire history of keyframes. We provide an overview of the system here, and provide more information in the appendix.
|
| 148 |
+
|
| 149 |
+
Initialization Initialization is simple with DROID-SLAM. We simply collect frames until we have a set of 12. As we accumulate frames, we only keep the previous frame if optical flow is greater than 16px (estimated by applying one update iteration). Once 12 frames have been accumulated, we initialize a frame graph by creating an edges between keyframes which are within 3 timesteps apart, then run 10 iterations of the update operator.
|
| 150 |
+
|
| 151 |
+
Frontend The frontend operates directly on the incoming video stream. It maintains a collection of keyframes and a frame graph storing edges between covisible kefyrames. Keyframe poses and depths are actively being optimized. Features are first extracted from the incoming frames. The new frame is then added to the frame graph adding edges with its 3 closest neighbors as measured by mean optical flow. The pose is initialized using a linear motion model. We then apply several iterations of the update operator to update keyframe poses and depths. We fix the first two poses to remove gauge freedom but treat all depths as free variables.
|
| 152 |
+
|
| 153 |
+
After the new frame is tracked, we select a keyframe for removal. We compute distance between pairs of frames by computing the average optical flow magnitude and remove redundant frames. If no frame is a good candidate for removal, we remove the oldest keyframe.
|
| 154 |
+
|
| 155 |
+
Backend The backend performs global bundle adjustment over the entire history of keyframes. During each iteration, we rebuild the frame graph using the flow between all pairs of keyframes, represented as an $N \times N$ distance matrix. We first add edges between temporally adjacent keyframes. We then sample new edges from the distance matrix in order of increasing flow. With each selected edge, we suppress neighboring edges within a distance of 2, where distance is defined as the Chebyshev distance between index pairs $| | ( i , j ) - ( k , l ) | | _ { \infty } = \operatorname* { m a x } ( | i - k | , | j - l | )$ .
|
| 156 |
+
|
| 157 |
+
We then apply the update operator to the entire frame graph, often consisting of thousands of frames and edges. Storing the full set of correlation volumes would quickly exceed video memory. Instead, we use the memory efficient implementation proposed in RAFT [48].
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: DROID-SLAM can generalize to new datasets. In order, we show results from Tanks & Temples [21], ScanNet [10], Sintel [3], and ETH-3D [41]; all using monocular video.
|
| 161 |
+
|
| 162 |
+
During training, we implement dense bundle adjustment in PyTorch to leverage the automatic differentiation engine. At inference time, we use a custom CUDA kernel which takes advantage of the block-sparse structure of the problem, then perform sparse Cholesky decomposition on the reduced camera block.
|
| 163 |
+
|
| 164 |
+
We only perform full bundle adjustment on keyframe images. In order to recover the poses of non-keyframes, we perform motion-only bundle adjustment by iteratively estimating flow between each keyframe and its neighboring non-keyframes. During testing, we evaluate on the full camera trajectory, not just keyframes.
|
| 165 |
+
|
| 166 |
+
Stereo and RGB-D Our system can be easily modified for stereo and RGB-D video. In the case of RGB-D, we still treat depth as a variable, since sensor depth can be noisy and have missing observations, and simply add a term to the optimization objective (Eqn. 4) which penalizes the squared distance between the measured and predicted depth. For stereo, we use the exact same system described above, with just double the frames, and fix the relative pose between the left and right frames in the DBA layer. Cross camera edges in the graph allow us to leverage stereo information.
|
| 167 |
+
|
| 168 |
+
# 4 Experiments
|
| 169 |
+
|
| 170 |
+
We experiment on a diverse set of datasets and sensor modalities. We compare to both deep learning and established classical SLAM algorithms and put specific emphasis on cross-dataset generalization. Following prior work, we evaluate the accuracy of the camera trajectory [31, 15, 41], primarily using Absolute Trajectory Error (ATE) [43]. While some datasets have ground truth point clouds [21], there is no standard protocol to compare 3D reconstructions directly given by SLAM systems because a SLAM systems can choose which 3D points to reconstruct. Evaluating dense 3D reconstruction is typically considered in the domain of Multiview Stereo [19] and outside the scope of this work.
|
| 171 |
+
|
| 172 |
+
Our network is trained entirely on monocular video from the synthetic TartanAir dataset [54]. We train our network for 250k steps with a batch size of 4, resolution $3 8 4 \times 5 1 2$ , and 7 frame clips, and unroll 15 update iterations. Training takes 1 week on 4 RTX-3090 GPUs.
|
| 173 |
+
|
| 174 |
+
Table 1: Results on the TartanAir monocular benchmark.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Monocular</td><td>MH000</td><td>MH001</td><td>MH002</td><td>MH003</td><td>MH004</td><td>MH005</td><td>MH006</td><td>MH007</td><td>Avg</td></tr><tr><td>ORB-SLAM[31]</td><td>1.30</td><td>0.04</td><td>2.37</td><td>2.45</td><td>X</td><td>X</td><td>21.47</td><td>2.73</td><td>-</td></tr><tr><td>DeepV2D[47]</td><td>6.15</td><td>2.12</td><td>4.54</td><td>3.89</td><td>2.71</td><td>11.55</td><td>5.53</td><td>3.76</td><td>5.03</td></tr><tr><td>TartanVO [53]</td><td>4.88</td><td>0.26</td><td>2.00</td><td>0.94</td><td>1.07</td><td>3.19</td><td>1.00</td><td>2.04</td><td>1.92</td></tr><tr><td>Ours</td><td>0.08</td><td>0.05</td><td>0.04</td><td>0.02</td><td>0.01</td><td>1.31</td><td>0.30</td><td>0.07</td><td>0.24</td></tr></table>
|
| 177 |
+
|
| 178 |
+
TartanAir [54] (Monocular & Stereo) The TartanAir dataset is a challenging synthetic benchmark for evaluating SLAM algorithms and was used as part of the ECCV 2020 SLAM competition. We use the official test split [54], and provide ATE across all “Hard” sequences in Tab. 1.
|
| 179 |
+
|
| 180 |
+
Tab. 1 demonstrates both the robustness of our method (no catastrophic failures) and accuracy (very low drift). We retrain DeepV2D [47] on TartanAir as a baseline. On most sequences, we outperform existing methods by an order-of-magnitude and achieve ${ } ^ { 8 \mathrm { { X } } }$ lower average error than TartanVO [53] and $2 0 \mathrm { x }$ lower than DeepV2D [47]. We also use the TartanAir dataset to compare with the top submissions to the ECCV 2020 SLAM competition in Tab. 2. The top two submissions use systems
|
| 181 |
+
|
| 182 |
+
<table><tr><td></td><td>Mono.</td><td>Stereo</td></tr><tr><td>OV²SLAM[17]</td><td>0.510</td><td>0.182</td></tr><tr><td>VOLDOR [28] + COLMAP [40]</td><td>0.440</td><td>0.177</td></tr><tr><td>SuperGlue [38] + SuperPoint [13] + COLMAP [40]</td><td>0.340</td><td>0.119</td></tr><tr><td>Ours</td><td>0.129</td><td>0.047</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Table 2: Results on the TartanAir test set, compared with the top 3 submission to the ECCV 2020 SLAM competition. The score is computed using normalized relative pose error for all possible sequences of length $\{ 5 , 1 0 , 1 5 , . . . , 4 0 \}$ meters, see competition page for details.
|
| 185 |
+
|
| 186 |
+
built on top of COLMAP [40] and run $4 0 \mathbf { x }$ slower than real-time. Our method, on the other hand, runs 16x faster and achieves an error $62 \%$ lower on the monocular benchmark and $60 \%$ lower on the stereo benchmark.
|
| 187 |
+
|
| 188 |
+
EuRoC [2] (Monocular & Stereo) In the remaining experiments, we are interested in the ability of our network to generalize to new cameras and environments. The EuRoC dataset consists of video captured from sensor on-board a micro aerial vehicle (MAV) and is a widely used benchmark to evaluate SLAM systems. We use the EuRoC dataset to evaluate both monocular and stereo performance and report results on Tab. 3.
|
| 189 |
+
|
| 190 |
+
Table 3: Monocular SLAM on the EuRoC datasets, ATE[m]. † denotes visual odometry methods.
|
| 191 |
+
|
| 192 |
+
<table><tr><td colspan="2"></td><td>MH01</td><td>MH02</td><td>MH03</td><td>MH04</td><td>MH05</td><td>V101</td><td>V102</td><td>V103</td><td>V201</td><td>V202</td><td>V203</td><td>Avg</td></tr><tr><td rowspan="5">qH/deea</td><td>DeepFactors [9]</td><td>1.587</td><td>1.479</td><td>3.139</td><td>5.331</td><td>4.002</td><td>1.520</td><td>0.679</td><td>0.900</td><td>0.876</td><td>1.905</td><td>1.021</td><td>2.040</td></tr><tr><td>DeepV2D [47]t</td><td>0.739</td><td>1.144</td><td>0.752</td><td>1.492</td><td>1.567</td><td>0.981</td><td>0.801</td><td>1.570</td><td>0.290</td><td>2.202</td><td>2.743</td><td>1.298</td></tr><tr><td>DeepV2D (Tartan Air)†</td><td>1.614</td><td>1.492</td><td>1.635</td><td>1.775</td><td>1.013</td><td>0.717</td><td>0.695</td><td>1.483</td><td>0.839</td><td>1.052</td><td>0.591</td><td>1.173</td></tr><tr><td>TartanVO1 [53]†</td><td>0.639</td><td>0.325</td><td>0.550</td><td>1.153</td><td>1.021</td><td>0.447</td><td>0.389</td><td>0.622</td><td>0.433</td><td>0.749</td><td>1.152</td><td>0.680</td></tr><tr><td>D3VO + DSO [57]t</td><td>-</td><td>-</td><td>0.08</td><td>-</td><td>0.09</td><td>-</td><td>-</td><td>0.11</td><td>-</td><td>0.05</td><td>0.19</td><td>-</td></tr><tr><td rowspan="4">Cesssssr</td><td>ORB-SLAM [31]</td><td>0.071</td><td>0.067</td><td>0.071</td><td>0.082</td><td>0.060</td><td>0.015</td><td>0.020</td><td>X</td><td>0.021</td><td>0.018</td><td>X</td><td>-</td></tr><tr><td>DSO [15]t</td><td>0.046</td><td>0.046</td><td>0.172</td><td>3.810</td><td>0.110</td><td>0.089</td><td>0.107</td><td>0.903</td><td>0.044</td><td>0.132</td><td>1.152</td><td>0.601</td></tr><tr><td>SVO[18]t</td><td>0.100</td><td>0.120</td><td>0.410</td><td>0.430</td><td>0.300</td><td>0.070</td><td>0.210</td><td>X</td><td>0.110</td><td>0.110</td><td>1.080</td><td>·</td></tr><tr><td>DSM[60] ORB-SLAM3 [5]</td><td>0.039</td><td>0.036</td><td>0.055</td><td>0.057</td><td>0.067</td><td>0.095</td><td>0.059</td><td>0.076</td><td>0.056</td><td>0.057</td><td>0.784</td><td>0.126</td></tr><tr><td colspan="2">Ours (odometry only)†</td><td>0.016</td><td>0.027</td><td>0.028</td><td>0.138</td><td>0.072</td><td>0.033</td><td>0.015</td><td>0.033</td><td>0.023</td><td>0.029</td><td>X</td><td>-</td></tr><tr><td colspan="2">Ours</td><td>0.163 0.013</td><td>0.121 0.014</td><td>0.242 0.022</td><td>0.399 0.043</td><td>0.270 0.043</td><td>0.103 0.037</td><td>0.165 0.012</td><td>0.158</td><td>0.020</td><td>0.102 0.115 0.017 0.013</td><td>0.204 0.014</td><td>0.186 0.022</td></tr></table>
|
| 193 |
+
|
| 194 |
+
In the monocular setting, we achieve an average ATE of $2 . 2 \mathrm { c m }$ , reducing error by $82 \%$ among methods with zero failures, and by $43 \%$ over ORB-SLAM3 when only comparing sequences where ORB-SLAM3 is successful.
|
| 195 |
+
|
| 196 |
+
We compare to several deep learning approaches. We compare to DeepV2D trained on the TartanAir dataset and the publicly available version trained on NYUv2 [33] and ScanNet[10]. DeepFactors [9] was trained on ScanNet. We find that recent deep learning approaches [9, 47, 53] perform poorly on the EuRoC dataset compared to classical SLAM systems. This is due to poor generalization and dataset biases which lead to large amounts of drift; our method does not suffer from these issues. D3VO [57] is able to achieve both good robustness and accuracy by combining a neural network frontend with DSO as a backend, using 6 of the 11 sequences for evaluation and performing unsupervised training on the remaining ones, which contain the same scenes used for evaluation.
|
| 197 |
+
|
| 198 |
+
TUM-RGBD [43] The RGBD dataset consists of indoor scenes captured with handheld camera. This is a notoriously difficult dataset for monocular methods due to rolling shutter artifacts, motion blur, and heavy rotation. We benchmark prior work on the entirety of the freiburg1 set in Tab. 4.
|
| 199 |
+
|
| 200 |
+
Classical SLAM algorithms such as ORB-SLAM tend to fail on most of the sequences. While deep learning methods are more robust, they obtain low accuracy on most of the evaluated sequences. Our
|
| 201 |
+
|
| 202 |
+
<table><tr><td></td><td>360</td><td>desk</td><td>desk2</td><td>floor</td><td>plant</td><td>room</td><td>rpy</td><td>teddy</td><td>xyz</td><td>avg</td></tr><tr><td>ORB-SLAM2 [32] ORB-SLAM3[5]</td><td>X X</td><td>0.071 0.017</td><td>X 0.210</td><td>0.023 X</td><td>X 0.034</td><td>X X</td><td>X X</td><td>X X</td><td>0.010 0.009</td><td>: -</td></tr><tr><td>DeepTAM1 [59]</td><td>0.111</td><td>0.053</td><td>0.103</td><td>0.206</td><td>0.064</td><td>0.239</td><td>0.093</td><td>0.144</td><td>0.036</td><td>0.116</td></tr><tr><td>TartanVO² [53]</td><td>0.178</td><td>0.125</td><td>0.122</td><td>0.349</td><td>0.297</td><td>0.333</td><td>0.049</td><td>0.339</td><td>0.062</td><td>0.206</td></tr><tr><td>DeepV2D [47]</td><td>0.243</td><td>0.166</td><td>0.379</td><td>1.653</td><td>0.203</td><td>0.246</td><td>0.105</td><td>0.316</td><td>0.064</td><td>0.375</td></tr><tr><td>DeepV2D (TartanAir)</td><td>0.182</td><td>0.652</td><td>0.633</td><td>0.579</td><td>0.582</td><td>0.776</td><td>0.053</td><td>0.602</td><td>0.150</td><td>0.468</td></tr><tr><td>DeepFactors [9]</td><td>0.159</td><td>0.170</td><td>0.253</td><td>0.169</td><td>0.305</td><td>0.364</td><td>0.043</td><td>0.601</td><td>0.035</td><td>0.233</td></tr><tr><td>Ours</td><td>0.111</td><td>0.018</td><td>0.042</td><td>0.021</td><td>0.016</td><td>0.049</td><td>0.026</td><td>0.048</td><td>0.012</td><td>0.038</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Table 4: ATE on the TUM-RGBD benchmark. All methods are provided mono. video, 1except DeepTAM which uses RGB-D and 2TartanVO which uses ground truth to scale relative pose.
|
| 205 |
+
|
| 206 |
+
method is both robust and accurate. It successfully tracks all 9 sequences while achieving $83 \%$ lower ATE than DeepFactors [9] and which succeeds on all videos and $90 \%$ lower ATE than DeepV2D [47].
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 4: Generalization results on the RGB-D ETH3D-SLAM benchmark. (Left) Our method, which is trained only on the synthetic TartanAir dataset, ranks 1st on both the train and test splits. (Right) Plot of the number successful trajectories as a function of ATE. Our method successfully tracks 30/32 of the datasets where image data is available.
|
| 210 |
+
|
| 211 |
+
ETH3D-SLAM [41] (RGB-D) Finally, we evaluate the RGB-D performance on the ETH3D-SLAM benchmark. In this setup, the network is also provided measurements from an RGB-D camera. We take our network trained on TartanAir and add an addition term in the optimization objective penalizing the distance between the predicted inv. depth and inv. depth measured by the sensor. Without any finetuning, our method ranks 1st on both the train and test splits. Several of the datasets are "dark" meaning no image data is available; on these datasets we do not submit any predictions. On the test set, we successfully track 30/32 RGB-D, improving over the next best of 19/32.
|
| 212 |
+
|
| 213 |
+
Timing and Memory Our system can run in real-time with 2 3090 GPUs. Tracking and local BA is run on the first GPU, while global BA and loop closure is run on the second. On EuRoC, we average 20fps (camera hz) by downsampling to $3 2 0 \times 5 1 2$ resolution and skipping every other frame. Results in Tab. 3 were obtained in this setting. On TUM-RGBD, we average 30fps by downsampling to $2 4 0 \times 3 2 0$ and skipping every other frame, again the reported results where obtained in this setting. On TartanAir, due to much faster camera motion, we are unable to run in real-time, averaging 8fps. However, this is still a 16x speedup over the top 2 submissions to the TartanAir SLAM challenge, which rely on COLMAP [40].
|
| 214 |
+
|
| 215 |
+
The SLAM frontend can be run on GPUs with 8GB of memory. The backend, which requires storing feature maps from the full set of images, is more memory intensive. All results on TUM-RGBD can be produced on a single 1080Ti graphics card. Results on EuRoC, TartanAir and ETH-3D (where video can be up to 5000 frames) requires a GPU with 24GB memory. While memory and resource requirements are currently the biggest limitation of our system, we believe these can be drastically reduced by culling redundant computation and more efficient representations.
|
| 216 |
+
|
| 217 |
+
# 5 Conclusion
|
| 218 |
+
|
| 219 |
+
We introduce DROID-SLAM, an end-to-end neural architecture for visual SLAM. DROID-SLAM is accurate, robust, and versatile and can be used on monocular, stereo, and RGB-D video. It outperforms prior work by large margins on challenging benchmarks.
|
| 220 |
+
|
| 221 |
+
Acknowledgements This work is partially supported by the National Science Foundation under Award IIS-1942981.
|
| 222 |
+
|
| 223 |
+
# References
|
| 224 |
+
|
| 225 |
+
optimisable representation for dense visual slam. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2560–2568, 2018.
|
| 226 |
+
[2] M. Burri, J. Nikolic, P. Gohl, T. Schneider, J. Rehder, S. Omari, M. W. Achtelik, and R. Siegwart. The euroc micro aerial vehicle datasets. The International Journal of Robotics Research, 35(10):1157–1163, 2016.
|
| 227 |
+
[3] D. J. Butler, J. Wulff, G. B. Stanley, and M. J. Black. A naturalistic open source movie for optical flow evaluation. In A. Fitzgibbon et al. (Eds.), editor, European Conf. on Computer Vision (ECCV), Part IV, LNCS 7577, pages 611–625. Springer-Verlag, Oct. 2012.
|
| 228 |
+
[4] C. Cadena, L. Carlone, H. Carrillo, Y. Latif, D. Scaramuzza, J. Neira, I. Reid, and J. J. Leonard. Past, present, and future of simultaneous localization and mapping: Toward the robust-perception age. IEEE Transactions on robotics, 32(6):1309–1332, 2016.
|
| 229 |
+
[5] C. Campos, R. Elvira, J. J. G. Rodríguez, J. M. Montiel, and J. D. Tardós. Orb-slam3: An accurate open-source library for visual, visual-inertial and multi-map slam. arXiv preprint arXiv:2007.11898, 2020.
|
| 230 |
+
[6] D. Caruso, J. Engel, and D. Cremers. Large-scale direct slam for omnidirectional cameras. In 2015 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 141–148. IEEE, 2015.
|
| 231 |
+
[7] C. B. Choy, J. Gwak, S. Savarese, and M. Chandraker. Universal correspondence network. arXiv preprint arXiv:1606.03558, 2016.
|
| 232 |
+
[8] R. Clark, M. Bloesch, J. Czarnowski, S. Leutenegger, and A. J. Davison. Ls-net: Learning to solve nonlinear least squares for monocular stereo. arXiv preprint arXiv:1809.02966, 2018. [9] J. Czarnowski, T. Laidlow, R. Clark, and A. J. Davison. Deepfactors: Real-time probabilistic dense monocular slam. IEEE Robotics and Automation Letters, 5(2):721–728, 2020.
|
| 233 |
+
[10] A. Dai, A. X. Chang, M. Savva, M. Halber, T. Funkhouser, and M. Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5828–5839, 2017.
|
| 234 |
+
[11] A. Dai, M. Nießner, M. Zollhöfer, S. Izadi, and C. Theobalt. Bundlefusion: Real-time globally consistent 3d reconstruction using on-the-fly surface reintegration. ACM Transactions on Graphics (ToG), 36(4):1, 2017.
|
| 235 |
+
[12] A. J. Davison, I. D. Reid, N. D. Molton, and O. Stasse. Monoslam: Real-time single camera slam. IEEE transactions on pattern analysis and machine intelligence, 29(6):1052–1067, 2007.
|
| 236 |
+
[13] D. DeTone, T. Malisiewicz, and A. Rabinovich. Superpoint: Self-supervised interest point detection and description. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pages 224–236, 2018.
|
| 237 |
+
[14] M. Dusmanu, J. L. Schonberger, and M. Pollefeys. Multi-view optimization of local feature geometry. In Proceedings of the 2020 European Conference on Computer Vision, 2020.
|
| 238 |
+
[15] J. Engel, V. Koltun, and D. Cremers. Direct sparse odometry. IEEE transactions on pattern analysis and machine intelligence, 40(3):611–625, 2017.
|
| 239 |
+
[16] J. Engel, T. Schöps, and D. Cremers. Lsd-slam: Large-scale direct monocular slam. In European conference on computer vision, pages 834–849. Springer, 2014.
|
| 240 |
+
[17] M. Ferrera, A. Eudes, J. Moras, M. Sanfourche, and G. Le Besnerais. Ov2 slam: A fully online and versatile visual slam for real-time applications. IEEE Robotics and Automation Letters, 6(2):1399–1406, 2021.
|
| 241 |
+
[18] C. Forster, Z. Zhang, M. Gassner, M. Werlberger, and D. Scaramuzza. Svo: Semidirect visual odometry for monocular and multicamera systems. IEEE Transactions on Robotics, 33(2):249–265, 2016.
|
| 242 |
+
[19] Y. Furukawa and C. Hernández. Multi-view stereo: A tutorial. Foundations and Trends® in Computer Graphics and Vision, 9(1-2):1–148, 2015.
|
| 243 |
+
[20] C. Kerl, J. Sturm, and D. Cremers. Dense visual slam for rgb-d cameras. In 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 2100–2106. IEEE, 2013.
|
| 244 |
+
[21] A. Knapitsch, J. Park, Q.-Y. Zhou, and V. Koltun. Tanks and temples: Benchmarking large-scale scene reconstruction. ACM Transactions on Graphics (ToG), 36(4):1–13, 2017.
|
| 245 |
+
[22] J. Kopf, X. Rong, and J.-B. Huang. Robust consistent video depth estimation. arXiv preprint arXiv:2012.05901, 2020.
|
| 246 |
+
[23] J. Krishna Murthy, S. Saryazdi, G. Iyer, and L. Paull. gradslam: Dense slam meets automatic differentiation. arXiv, 2020.
|
| 247 |
+
[24] C. Liu, J. Gu, K. Kim, S. G. Narasimhan, and J. Kautz. Neural rgb (r) d sensing: Depth and uncertainty from a video camera. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10986–10995, 2019.
|
| 248 |
+
[25] X. Luo, J.-B. Huang, R. Szeliski, K. Matzen, and J. Kopf. Consistent video depth estimation. ACM Transactions on Graphics (TOG), 39(4):71–1, 2020.
|
| 249 |
+
[26] Zhu, R. Zhang, Yao, Quan. Learning local descriptors by integrating geometry constraints. In Proceedings of the European conference on computer vision (ECCV), pages 168–183, 2018.
|
| 250 |
+
[27] H. Matsuki, L. von Stumberg, V. Usenko, J. Stückler, and D. Cremers. Omnidirectional dso: Direct sparse odometry with fisheye cameras. IEEE Robotics and Automation Letters, 3(4):3693–3700, 2018.
|
| 251 |
+
[28] Z. Min, Y. Yang, and E. Dunn. Voldor: Visual odometry from log-logistic dense optical flow residuals. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4898–4909, 2020.
|
| 252 |
+
[29] A. Mishchuk, D. Mishkin, F. Radenovic, and J. Matas. Working hard to know your neighbor’s margins: Local descriptor learning loss. arXiv preprint arXiv:1705.10872, 2017.
|
| 253 |
+
[30] A. I. Mourikis and S. I. Roumeliotis. A multi-state constraint kalman filter for vision-aided inertial navigation. In Proceedings 2007 IEEE International Conference on Robotics and Automation, pages 3565–3572. IEEE, 2007.
|
| 254 |
+
[31] R. Mur-Artal, J. M. M. Montiel, and J. D. Tardos. Orb-slam: a versatile and accurate monocular slam system. IEEE transactions on robotics, 31(5):1147–1163, 2015.
|
| 255 |
+
[32] R. Mur-Artal and J. D. Tardós. Orb-slam2: An open-source slam system for monocular, stereo, and rgb-d cameras. IEEE Transactions on Robotics, 33(5):1255–1262, 2017.
|
| 256 |
+
[33] P. K. Nathan Silberman, Derek Hoiem and R. Fergus. Indoor segmentation and support inference from rgbd images. In ECCV, 2012.
|
| 257 |
+
[34] R. A. Newcombe, S. J. Lovegrove, and A. J. Davison. Dtam: Dense tracking and mapping in real-time. In 2011 international conference on computer vision, pages 2320–2327. IEEE, 2011.
|
| 258 |
+
[35] Y. Ono, E. Trulls, P. Fua, and K. M. Yi. Lf-net: Learning local features from images. arXiv preprint arXiv:1805.09662, 2018.
|
| 259 |
+
[36] R. Ranftl and V. Koltun. Deep fundamental matrix estimation. In Proceedings of the European conference on computer vision (ECCV), pages 284–299, 2018.
|
| 260 |
+
[37] A. Rosinol, M. Abate, Y. Chang, and L. Carlone. Kimera: an open-source library for real-time metricsemantic localization and mapping. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 1689–1696. IEEE, 2020.
|
| 261 |
+
[38] P.-E. Sarlin, D. DeTone, T. Malisiewicz, and A. Rabinovich. Superglue: Learning feature matching with graph neural networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4938–4947, 2020.
|
| 262 |
+
[39] P.-E. Sarlin, A. Unagar, M. Larsson, H. Germain, C. Toft, V. Larsson, M. Pollefeys, V. Lepetit, L. Hammarstrand, F. Kahl, et al. Back to the feature: Learning robust camera localization from pixels to pose. arXiv preprint arXiv:2103.09213, 2021.
|
| 263 |
+
[40] J. L. Schonberger and J.-M. Frahm. Structure-from-motion revisited. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4104–4113, 2016.
|
| 264 |
+
[41] T. Schops, T. Sattler, and M. Pollefeys. Bad slam: Bundle adjusted direct rgb-d slam. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 134–144, 2019.
|
| 265 |
+
[42] D. Schubert, N. Demmel, V. Usenko, J. Stuckler, and D. Cremers. Direct sparse odometry with rolling shutter. In Proceedings of the European Conference on Computer Vision (ECCV), pages 682–697, 2018.
|
| 266 |
+
[43] J. Sturm, N. Engelhard, F. Endres, W. Burgard, and D. Cremers. A benchmark for the evaluation of rgb-d slam systems. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 573–580. IEEE, 2012.
|
| 267 |
+
[44] E. Sucar, S. Liu, J. Ortiz, and A. J. Davison. imap: Implicit mapping and positioning in real-time. arXiv preprint arXiv:2103.12352, 2021.
|
| 268 |
+
[45] E. Sucar, K. Wada, and A. Davison. Nodeslam: Neural object descriptors for multi-view shape reconstruction. In 2020 International Conference on 3D Vision (3DV), pages 949–958. IEEE, 2020.
|
| 269 |
+
[46] C. Tang and P. Tan. Ba-net: Dense bundle adjustment network. arXiv preprint arXiv:1806.04807, 2018.
|
| 270 |
+
[47] Z. Teed and J. Deng. Deepv2d: Video to depth with differentiable structure from motion. arXiv preprint arXiv:1812.04605, 2018.
|
| 271 |
+
[48] Z. Teed and J. Deng. Raft: Recurrent all-pairs field transforms for optical flow. In European Conference on Computer Vision, pages 402–419. Springer, 2020.
|
| 272 |
+
[49] Z. Teed and J. Deng. Tangent space backpropagation for 3d transformation groups. In Conference on Computer Vision and Pattern Recognition, 2021.
|
| 273 |
+
[50] B. Ummenhofer, H. Zhou, J. Uhrig, N. Mayer, E. Ilg, A. Dosovitskiy, and T. Brox. Demon: Depth and motion network for learning monocular stereo. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5038–5047, 2017.
|
| 274 |
+
[51] L. von Stumberg, P. Wenzel, N. Yang, and D. Cremers. Lm-reloc: Levenberg-marquardt based direct visual relocalization. arXiv preprint arXiv:2010.06323, 2020.
|
| 275 |
+
[52] S. Wang, R. Clark, H. Wen, and N. Trigoni. Deepvo: Towards end-to-end visual odometry with deep recurrent convolutional neural networks. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pages 2043–2050. IEEE, 2017.
|
| 276 |
+
[53] W. Wang, Y. Hu, and S. Scherer. Tartanvo: A generalizable learning-based vo. arXiv preprint arXiv:2011.00359, 2020.
|
| 277 |
+
[54] W. Wang, D. Zhu, X. Wang, Y. Hu, Y. Qiu, C. Wang, Y. Hu, A. Kapoor, and S. Scherer. Tartanair: A dataset to push the limits of visual slam. arXiv preprint arXiv:2003.14338, 2020.
|
| 278 |
+
[55] T. Whelan, M. Kaess, H. Johannsson, M. Fallon, J. J. Leonard, and J. McDonald. Real-time large-scale dense rgb-d slam with volumetric fusion. The International Journal of Robotics Research, 34(4-5):598–626, 2015.
|
| 279 |
+
[56] T. Whelan, S. Leutenegger, R. Salas-Moreno, B. Glocker, and A. Davison. Elasticfusion: Dense slam without a pose graph. Robotics: Science and Systems, 2015.
|
| 280 |
+
[57] N. Yang, L. v. Stumberg, R. Wang, and D. Cremers. D3vo: Deep depth, deep pose and deep uncertainty for monocular visual odometry. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1281–1292, 2020.
|
| 281 |
+
[58] N. Yang, R. Wang, J. Stuckler, and D. Cremers. Deep virtual stereo odometry: Leveraging deep depth prediction for monocular direct sparse odometry. In Proceedings of the European Conference on Computer Vision (ECCV), pages 817–833, 2018.
|
| 282 |
+
[59] H. Zhou, B. Ummenhofer, and T. Brox. Deeptam: Deep tracking and mapping. In Proceedings of the European conference on computer vision (ECCV), pages 822–838, 2018.
|
| 283 |
+
[60] J. Zubizarreta, I. Aguinaga, and J. M. M. Montiel. Direct sparse mapping. IEEE Transactions on Robotics, 36(4):1363–1370, 2020.
|
md/train/ZRcjSOmYraB/ZRcjSOmYraB.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning Distilled Collaboration Graph for Multi-Agent Perception
|
| 2 |
+
|
| 3 |
+
Yiming Li New York University yimingli@nyu.edu
|
| 4 |
+
|
| 5 |
+
Shunli Ren Shanghai Jiao Tong University renshunli@sjtu.edu.cn
|
| 6 |
+
|
| 7 |
+
Pengxiang Wu Rutgers University pxiangwu@gmail.com
|
| 8 |
+
|
| 9 |
+
Siheng Chen∗ Shanghai Jiao Tong University sihengc@sjtu.edu.cn
|
| 10 |
+
|
| 11 |
+
Chen Feng∗ New York University cfeng@nyu.edu
|
| 12 |
+
|
| 13 |
+
Wenjun Zhang Shanghai Jiao Tong University zhangwenjun@sjtu.edu.cn
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
To promote better performance-bandwidth trade-off for multi-agent perception, we propose a novel distilled collaboration graph (DiscoGraph) to model trainable, pose-aware, and adaptive collaboration among agents. Our key novelties lie in two aspects. First, we propose a teacher-student framework to train DiscoGraph via knowledge distillation. The teacher model employs an early collaboration with holistic-view inputs; the student model is based on intermediate collaboration with single-view inputs. Our framework trains DiscoGraph by constraining postcollaboration feature maps in the student model to match the correspondences in the teacher model. Second, we propose a matrix-valued edge weight in DiscoGraph. In such a matrix, each element reflects the inter-agent attention at a specific spatial region, allowing an agent to adaptively highlight the informative regions. During inference, we only need to use the student model named as the distilled collaboration network (DiscoNet). Attributed to the teacher-student framework, multiple agents with the shared DiscoNet could collaboratively approach the performance of a hypothetical teacher model with a holistic view. Our approach is validated on V2X$\mathrm { S i m } 1 . 0$ , a large-scale multi-agent perception dataset that we synthesized using CARLA and SUMO co-simulation. Our quantitative and qualitative experiments in multi-agent 3D object detection show that DiscoNet could not only achieve a better performance-bandwidth trade-off than the state-of-the-art collaborative perception methods, but also bring more straightforward design rationale. Our code is available on https://github.com/ai4ce/DiscoNet.
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Perception, which involves organizing, identifying and interpreting sensory information, is a crucial ability for intelligent agents to understand the environment. Single-agent perception [4] has been studied extensively in recent years, e.g., 2D/3D object detection [18, 27], tracking [23, 22] and segmentation [25, 16], etc. Despite its great progress, single-agent perception suffers from a number of shortcomings stemmed from its individual perspective. For example, in autonomous driving [8], the LiDAR-based perception system can hardly perceive the target in the occluded or long-range areas. Intuitively, with an appropriate collaboration strategy, multi-agent perception could fundamentally upgrade the perception ability over single-agent perception.
|
| 22 |
+
|
| 23 |
+
To design a collaboration strategy, current approaches mainly include raw-measurement-based early collaboration, output-based late collaboration and feature-based intermediate collaboration.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: Scheme comparison. (a) Early collaboration requires an expensive bandwidth for raw data transmission. (b) Intermediate collaboration needs an appropriate collaboration strategy. (c) The proposed method incorporates both early and intermediate collaboration into a knowledge distillation framework, enabling the knowledge of early collaboration to guide the training of an intermediate collaboration strategy, leading to better trade-off between performance and bandwidth.
|
| 27 |
+
|
| 28 |
+
Early collaboration [3] aggregates the raw measurements from all the agents, promoting a holistic perspective; see Fig. 1 (a). It can fundamentally solve the occlusion and long-range issues occurring in the single-agent perception; however, it requires a lot of communication bandwidth. Contrarily, late collaboration aggregates each agent’s perception outputs. Although it is bandwidth-efficient, each individual perception output could be noisy and incomplete, causing unsatisfying fusion results. To deal with the performance-bandwidth trade-off, intermediate collaboration [19, 34, 20] has been proposed to aggregate intermediate features across agents; see Fig. 1 (b). Since we can squeeze representative information to compact features, this approach can potentially both achieve communication bandwidth efficiency and upgrade perception ability; however, a bad design of collaboration strategy might cause information loss during feature abstraction and fusion, leading to limited improvement of the perception ability.
|
| 29 |
+
|
| 30 |
+
To achieve an effective design of intermediate collaboration, we propose a distilled collaboration graph (DiscoGraph) to model the collaboration among agents. In DiscoGraph, each node is an agent with real-time pose information and each edge reflects the pair-wise collaboration between two agents. The proposed DiscoGraph is trainable, pose-aware, and adaptive to real-time measurements, reflecting dynamic collaboration among agents. It is novel from two aspects. First, from the training aspect, we propose a teacher-student framework to train DiscoGraph through knowledge distillation [1, 10, 26]; see Fig. 1 (c). Here the teacher model is based on early collaboration with holistic-view inputs and the student model is based on intermediate collaboration with single-view inputs. The knowledge-distillation-based framework enhances the training of DiscoGraph by constraining the postcollaboration feature maps in the student model to match the correspondences in the teacher model. With the guidance of both output-level supervision from perception and feature-level supervision from knowledge distillation, the distilled collaboration graph promotes better feature abstraction and aggregation, improving the performance-bandwidth trade-off. Second, from the modeling aspect, we propose a matrix-valued edge weight in DiscoGraph to reflect the collaboration strength with a high spatial resolution. In the matrix, each element represents the inter-agent attention at a specific spatial region. This design allows the agents to adaptively highlight the informative regions and strategically select appropriate partners to request supplementary information.
|
| 31 |
+
|
| 32 |
+
During inference, we only need to use the student model. Since it leverages DiscoGraph as the key component, we call the student model as the distilled collaboration network (DiscoNet). Multiple agents with the shared DiscoNet could collaboratively approach the performance of a hypothetical teacher model with the holistic view.
|
| 33 |
+
|
| 34 |
+
To validate the proposed method, we build V2X-Sim 1.0, a new large-scale multi-agent 3D object detection dataset in autonomous driving scenarios based on CARLA and SUMO co-simulation platform [6]. Comprehensive experiments conducted in 3D object detection [37, 28, 29, 17] have shown that the proposed DiscoNet achieves better performance-bandwidth trade-off and lower communication latency than the state-of-the-art intermediate collaboration methods.
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 2: Overall teacher-student training framework. In the student model, for Agent 1 (in red), its input single-view point cloud can be converted to a BEV map, and then be consumed by a shared encoder $\Theta ^ { \mathrm { s } }$ to obtain the feature map $\mathbf { F } _ { i } ^ { \mathrm { s } }$ . Based on the collaboration graph $\mathcal { G } _ { \Pi }$ , Agent 1 aggregates the neural messages from other agents and obtains the updated feature map $\mathbf { H } _ { i } ^ { \mathrm { s } }$ . The shared header following the shared decoder outputs the 3D detection results. In the teacher model, we aggregate the points collected from all agents to obtain a holistic-view point cloud. We crop the region and align the pose to ensure the BEV maps in both teacher and student models are synchronized. We constrain all the post-collaboration feature maps in the student model to match the correspondences in the teacher model through knowledge distillation, resulting in a collaborative student model.
|
| 38 |
+
|
| 39 |
+
# 2 Multi-Agent Perception System with Distilled Collaboration Graph
|
| 40 |
+
|
| 41 |
+
This work considers a collaborative perception system to perceive a scene, where multiple agents can perceive and collaborate with each other through a broadcast communication channel. We assume each agent is provided with an accurate pose and the perceived measurements are well synchronized. Then, given a certain communication bandwidth, we aim to maximize the perception ability of each agent through optimizing a collaboration strategy. To design such a strategy, we consider a teacher-student training framework to integrate the strengths from both early and intermediate collaboration. During training, we leverage an early-collaboration model (teacher) to teach an intermediate-collaboration model (student) how to collaborate through knowledge distillation. Here the teacher model and the student model are shared by all the agents, but each agent would input raw measurements from its own view to either model; see Fig. 2. During inference, we only need the student model, where multiple agents with the shared student model could collaboratively approach the performance of the teacher model with the hypothetical holistic view.
|
| 42 |
+
|
| 43 |
+
In this work, we focus on the perception task of LiDAR-based 3D object detection because the unifying 3D space naturally allows the aggregation of multiple LiDAR scans. Note that in principle the proposed method is generally-applicable in collaborative perception if there exists a unified space to aggregate raw data across multiple agents.
|
| 44 |
+
|
| 45 |
+
# 2.1 Student: Intermediate collaboration via graphs
|
| 46 |
+
|
| 47 |
+
Feature encoder. The functionality is to extract informative features from raw measurements for each agent. Let $\mathcal { X } _ { i }$ be the 3D point cloud collected by the $i$ th agent ( $M$ agents in total), the feature of the ith agent is obtained as $\mathbf { F } _ { i } ^ { \mathrm { s } } \gets \Theta ^ { \mathrm { s } } ( \mathcal { X } _ { i } )$ , where $\Theta ^ { \mathrm { s } } ( \cdot )$ is the feature encoder shared by all the agents and the superscript s reflects the student mode. To implement the encoder, we convert a 3D point cloud to a bird’s-eye-view (BEV) map, which is amenable to classic 2D convolutions. Specifically, we quantize the 3D points into regular voxels and represent the 3D voxel lattice as a 2D pseudo-image, with the height dimension corresponding to image channels. Such a 2D image is virtually a BEV map, whose basic element is a cell that is associated with a binary vector along the vertical axis. Let $\mathbf { B } _ { i } \in \{ 0 , 1 \} ^ { K \times K \times C }$ be the BEV map of the $i$ th agent associated with $\mathcal { X } _ { i }$ . With this map, we can apply four blocks composed of 2D convolutions, batch normalization and ReLU activation to gradually reduce the spatial dimension and increase the number of channels for the BEV, to obtain the feature map $\mathbf { F } _ { i } ^ { \mathrm { s } } \in \bar { \mathbb { R } } ^ { \bar { K } \times \bar { K } \times \bar { C } }$ with $\bar { K } \times \bar { K }$ the spatial resolution and $\bar { C }$ the number of channels.
|
| 48 |
+
|
| 49 |
+
Feature compression. To save the communication bandwidth, each agent could compress its feature map prior to transmission. Here we consider a $1 \times 1$ convolutional autoencoder [24] to compress/decompress the feature maps along the channel dimension. The autoencoder is trained together with the whole system, making the system work with limited collaboration information.
|
| 50 |
+
|
| 51 |
+
Collaboration graph process. The functionality is to update the feature map through data transmission among the agents. The core component here is a collaboration graph1 $\dot { \mathcal { G } } _ { \Pi } ( \nu , \bar { \mathcal { E } } _ { \Pi } )$ , where $\nu$ is the fixed node set and $\mathcal { E } _ { \Pi }$ is the trainable edge set. Each node in $\nu$ is an agent with the real-time pose information; for instance, $\pmb { \xi } _ { i } \in \mathfrak { s e } ( 3 )$ is the ith agent’s pose in the global coordinate system; and each edge in $\mathcal { E } _ { \Pi }$ is trainable and models the collaboration between two agents, with $\Pi$ an edge-weight encoder, reflecting the trainable collaboration strength between agents. Let $\mathcal { M } _ { \mathcal { G } _ { \Pi } } ( \cdot )$ be the collaboration process defined on the collaboration graph $\mathcal { G } _ { \Pi }$ . The feature maps of all the agents after collaboration are $\{ \mathbf { H } _ { i } ^ { \mathrm { s } } \} _ { i = 1 } ^ { M } \mathcal { M } _ { \mathcal { G } _ { \Pi } } ( \{ \mathbf { F } _ { i } ^ { \mathrm { s } } \} _ { i = 1 } ^ { M } )$ . This process has three stages: neural message transmission (S1), neural message attention (S2) and neural message aggregation (S3).
|
| 52 |
+
|
| 53 |
+
In the neural message transmission stage (S1), each agent transmits its BEV-based feature map to the other agents. Since the BEV-based feature map summarizes the information of each agent, we consider it as a neural message. In the neural message attention stage (S2), each agent receives others’ neural messages and determines the matrix-valued edge weights, which reflect the importance of the neural message from one agent to another at each individual cell. Since each agent has its unique pose, we leverage the collaboration graph to achieve feature transformation across agents. For the ith agent, the transformed BEV-based feature map from the $j$ th agent is then $\mathbf { F } _ { j i } ^ { \mathrm { s } } = \bar { \Gamma } _ { j i } ( \mathbf { F } _ { i } ^ { \mathrm { s } } ) \in \mathbb { R } ^ { \bar { K } \times \bar { K } \times \bar { C } }$ where the transformation $\Gamma _ { j i } ( \cdot )$ is based on two ego poses $\xi _ { j }$ and $\pmb { \xi } _ { i }$ . Now $\mathbf { F } _ { j i } ^ { \mathrm { s } }$ and $\mathbf { F } _ { i } ^ { \mathrm { s } }$ are supported in the same coordinate system. To determine the edge weights, we use the edge encoder $\Pi$ to correlate the ego feature map and the feature map from another agent; that is, the matrix-valued edge weight from the $j$ th agent to the ith agent is $\mathbf { W } _ { j i } = \bar { \Pi } ( \bar { \mathbf { F } _ { j i } ^ { \mathrm { s } } } , \mathbf { F } _ { i } ^ { \mathrm { s } } ) \in \mathbb { R } ^ { \bar { K } \times \bar { K } }$ , where $\Pi$ concatenates two feature maps along the channel dimension and then uses four $1 \times 1$ convolutional layers to gradually reduce the number of channels from $2 \bar { C }$ to 1. Meanwhile, there is a softmax operation applied at each cell in the feature map to normalize the edge weights across multiple agents. Note that previous works [19, 20, 34] generally consider a scalar-valued edge weight to reflect the overall collaboration strength between two agents; while we consider a matrix-valued edge weight $\mathbf { W } _ { j i }$ , which models the collaboration strength from the $j$ th agent to the ith agent with a ${ \bar { K } } \times { \bar { K } }$ spatial resolution. In this matrix, each element corresponds to a cell in the BEV map, indicating a specific spatial region; thus, this matrix reflects the spatial attention at a cell-level resolution. In the neural message aggregation stage (S3), each agent aggregates the feature maps from all the agents based on the normalized matrix-valued edge weights. The updated feature map of the agent $i$ is $\begin{array} { r } { \mathbf { H } _ { i } ^ { \mathrm { s } } = \sum _ { j = 1 } ^ { M } \mathbf { W } _ { j i } \odot \mathbf { F } _ { j i } ^ { \mathrm { s } } } \end{array}$ , where $\odot$ denotes the dot product with channel-wise broadcasting.
|
| 54 |
+
|
| 55 |
+
Remark. The proposed collaboration graph is trainable because each matrix-valued edge weight is a trainable matrix to reflect the agent-to-agent attention in a cell-level spatial resolution; it is poseaware, empowering all the agents to work with the synchronized coordinate system; furthermore, it is dynamic at each timestamp as each edge weight would adapt to the real-time neural messages. According to the proposed collaboration graph, the agents can discover the region requiring collaboration on the fly, and strategically select appropriate partners to request supplementary information.
|
| 56 |
+
|
| 57 |
+
Decoder and header. After collaboration, each agent decodes the updated BEV-based feature map. The decoded feature map is ${ \bf M } _ { i } ^ { \mathrm { s } } \Psi ^ { \mathrm { s } } ( { \bf H } _ { i } ^ { \mathrm { s } } )$ . To implement the decoder $\Psi ^ { \mathrm { s } } ( \cdot )$ , we progressively up-sample $\mathbf { H } _ { i } ^ { \mathrm { s } }$ with four layers, where each layer first concatenates the previous feature map with the corresponding feature map in the encoder and then uses a $1 \times 1$ convolutional operation to halve the number of channels. Finally, we use an output header to generate the final detection outputs, $\hat { \mathbf { Y } } _ { i } ^ { \mathrm { s } } \gets \Phi ^ { \mathrm { s } } ( \mathbf { M } _ { i } ^ { \mathrm { s } } )$ . To implement the header $\Psi ^ { \mathrm { s } } ( \cdot )$ , we use two branches of convolutional layers to classify the foreground-background categories and regress the bounding boxes.
|
| 58 |
+
|
| 59 |
+
# 2.2 Teacher: Early collaboration
|
| 60 |
+
|
| 61 |
+
During the training phase, an early-collaboration model, as the teacher, is introduced to guide the intermediate-collaboration model, which is a student. Similar to the student model, the teacher’s pipeline has the feature encoder $\Theta ^ { \mathrm { t } }$ , feature decoder $\Psi ^ { \mathrm { t } }$ and the output header $\Phi ^ { \mathrm { t } }$ . Note that all the agents share the same teacher model to guide one student model; however, each agent provides the inputs with its own pose, and its inputs to both the teacher and student models should be well aligned.
|
| 62 |
+
|
| 63 |
+
Feature encoder. Let $\mathcal { X } = \mathcal { A } ( \pmb { \xi } _ { 1 } \circ \mathcal { X } _ { 1 } , \pmb { \xi } _ { 2 } \circ \mathcal { X } _ { 2 } , . . . , \pmb { \xi } _ { M } \circ \mathcal { X } _ { M } )$ be a holistic-view 3D point cloud that aggregates all the points from all $M$ agents in the global coordinate system, where $\mathcal { A } ( \cdot , . . . , \cdot )$ is the aggregation operator of multiple 3D point clouds, and $\pmb { \xi } _ { i }$ and $\mathcal { X } _ { i }$ are the pose and the 3D point cloud of the ith agent, respectively. To ensure the inputs to the teacher model and the student model are aligned, we transform the holistic-view point cloud $\mathcal { X }$ to an agent’s own coordinate based on the pose information. Now, for the ith agent, the input to the teacher model $\pmb { \xi } _ { i } ^ { - 1 } \circ \pmb { \chi }$ and the input to the student model $\mathcal { X } _ { i }$ are in the same coordinate system. Similarly to the feature encoder in the student model, we convert the 3D point cloud $\pmb { \xi } _ { i } ^ { - 1 } \circ \mathscr { X }$ to a BEV map and use 2D convolutions to obtain the feature map of the ith agent in the teacher model, $\mathbf { H } _ { i } ^ { \mathrm { t } } \in \mathbb { R } ^ { \bar { K } \times \bar { K } \times \bar { C } }$ . Here we crop the BEV map to ensure it has the same spatial range and resolution with the BEV map in the student model.
|
| 64 |
+
|
| 65 |
+
Decoder and header. Similarly to the decoder and header in the student model, we adopt $\mathbf { M } _ { i } ^ { \mathrm { t } } \gets$ $\Psi ^ { \mathrm { t } } ( \mathbf { H } _ { i } ^ { \mathrm { t } } )$ to obtain the decoded BEV-based feature map and $\widehat { \mathbf { Y } } _ { i } ^ { \mathrm { t } } \gets \Phi ^ { \mathrm { t } } ( \mathbf { M } _ { i } ^ { \mathrm { t } } )$ to obtain the predicted foreground-background categories and regressed bounding boxes.
|
| 66 |
+
|
| 67 |
+
Teacher training scheme. As in common teacher-student frameworks, we train the teacher model
|
| 68 |
+
separately. We employ the binary cross-entropy loss to supervise foreground-background classifi
|
| 69 |
+
cation andloss functidenoted as $L _ { 1 }$ ise the bounding-box regression. Overall, we min, where classification and regression losses are cound-truth detection in the perception region of the mize thelectivelyth agent. $\begin{array} { r } { \mathcal { L } ^ { \mathrm { t } } = \sum _ { i = 1 } ^ { M } \mathcal { L } _ { \mathrm { d e t } } ( \mathbf { Y } _ { i } ^ { \mathrm { t } } , \widehat { \mathbf { Y } } _ { i } ^ { \mathrm { t } } ) } \end{array}$ $\mathcal { L } _ { \mathrm { d e t } }$ $\mathbf { Y } _ { i } ^ { \mathrm { t } } = \mathbf { Y } _ { i } ^ { \mathrm { s } }$ $i$
|
| 70 |
+
|
| 71 |
+
# 2.3 System training with knowledge distillation
|
| 72 |
+
|
| 73 |
+
Given a well-trained teacher model, we use both detection loss and knowledge distillation loss to supervise the training of the student model. We consider minimizing the following loss
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathcal { L } ^ { \mathrm { s } } = \sum _ { i = 1 } ^ { M } \left( \mathcal { L } _ { \mathrm { d e t } } ( \mathbf { Y } _ { i } ^ { \mathrm { s } } , \widehat { \mathbf { Y } } _ { i } ^ { \mathrm { s } } ) + \lambda _ { \mathrm { k d } } \mathcal { L } _ { \mathrm { k d } } ( \mathbf { H } _ { i } ^ { \mathrm { s } } , \mathbf { H } _ { i } ^ { \mathrm { t } } ) + \lambda _ { \mathrm { k d } } \mathcal { L } _ { \mathrm { k d } } ( \mathbf { M } _ { i } ^ { \mathrm { s } } , \mathbf { M } _ { i } ^ { \mathrm { t } } ) \right) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The detection loss $\mathcal { L } _ { \mathrm { d e t } }$ is similar to that of the teacher, including both foreground-background classification loss and the bounding box regression loss, pushing the detection result of each agent to be close to its local ground-truth. The second and third terms form a knowledge distillation loss, regularizing the student model to generate similar feature maps with the teacher model. The hyperparameter $\lambda _ { \mathrm { k d } }$ controls the weight of the knowledge distillation loss $\mathcal { L } _ { \mathrm { k d } }$ defined as follows
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathcal { L } _ { \mathrm { k d } } ( \mathbf { H } _ { i } ^ { \mathrm { s } } , \mathbf { H } _ { i } ^ { \mathrm { t } } ) = \sum _ { n = 1 } ^ { { \bar { K } } \times { \bar { K } } } D _ { \mathrm { K L } } \left( \sigma \left( \left( \mathbf { H } _ { i } ^ { \mathrm { t } } \right) _ { n } \right) \vert \vert \sigma \left( \left( \mathbf { H } _ { i } ^ { \mathrm { s } } \right) _ { n } \right) \right) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $D _ { K L } ( p ( \mathbf { x } ) | | q ( \mathbf { x } ) )$ denotes the Kullback-Leibler (KL) divergence of distribution $q ( \mathbf { x } )$ from distribution $p ( \mathbf { x } ) , \sigma ( \cdot )$ indicates the softmax operation of the feature vector along the channel dimension, and $( \mathbf { H } _ { i } ^ { \mathrm { s } } ) _ { n }$ and $( { \bf { H } } _ { i } ^ { \mathrm { { t } } } ) _ { n }$ denote the feature vectors at the $n$ th cell of the ith agent’s feature map in the student model and teacher model, respectively. Similarly, the loss on decoded feature maps $\mathcal { L } _ { \mathrm { k d } } ( \mathbf { M } _ { i } ^ { \mathrm { s } } , \mathbf { M } _ { i } ^ { \mathrm { t } } )$ can be introduced to enhance the regularization.
|
| 86 |
+
|
| 87 |
+
Remark. As mentioned in Section 2.in the student model is computed by $\{ \mathbf { H } _ { i } ^ { \mathrm { s } } \} _ { i = 1 } ^ { M } \mathcal { M } _ { \mathcal { G } _ { \Pi } } ( \{ \mathbf { \dot { F } } _ { i } ^ { \mathrm { s } } \} _ { i = 1 } ^ { M ^ { - } } ) .$ the collaboration graph process. Intuitively, the feature map of the teacher model $\{ \mathbf { H } _ { i } ^ { \mathrm { t } } \} _ { i = 1 } ^ { M }$ would be the desired output of the collaboration graph process $\mathcal { M } _ { \mathcal { G } _ { \Pi } } ( \cdot )$ . Therefore, we constrain all the post-collaboration feature maps in the student model to match the correspondences in the teacher model through knowledge distillation. This constraint would further regularize the upfront trainable components: i) the distilled student encoder $\Theta ^ { \mathrm { s } }$ , which abstracts the features from raw measurements and produces the input to $\mathcal { M } _ { \mathcal { G } _ { \Pi } } ( \cdot )$ , and ii) the edge-weight encoder $\Pi$ in the distilled collaboration graph. Consequently, through knowledge distillation and back-propagation, the distilled student encoder would learn to abstract informative features from raw data for better collaboration; and the distilled edge-weight encoder would learn how to control the collaboration based on agents’ features. In a word, our distilled collaboration network (DiscoNet) can comprehend feature abstraction and fusion via the proposed knowledge distillation framework.
|
| 88 |
+
|
| 89 |
+
# 3 Related Work
|
| 90 |
+
|
| 91 |
+
Multi-agent communication. As core components in a multi-agent system, communication strategy among agents has been actively studied in previous works [30, 7, 31]. For example, CommNet [32] adopted the averaging operation to achieve continuous communication in multi-agent system; VAIN [11] considered an attention mechanism to determine which agents would share information;
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure $3 \colon \mathrm { V } 2 \mathrm { X } { \cdot } \mathrm { S i m } 1 . 0$ dataset. (a) Point clouds from multiple agents in a top-down view (each color indicates an individual agent). (b) Snapshot of the rendered CARLA-SUMO co-simulation. (c) The map of Town05 which is a squared-grid town with cross junctions and multiple lanes per direction.
|
| 95 |
+
|
| 96 |
+
ATOC [12] exploited an attention unit to determine what information to share with other agents; and TarMAC [5] implicitly learned a signature-based soft attention mechanism to let agents actively select which agents should receive the messages. In this work, we focus on the 3D perception task and propose a trainable, dynamic collaboration graph to control the communication among agents.
|
| 97 |
+
|
| 98 |
+
Collaborative perception. Collaborative perception is an application of multi-agent communication system to perception tasks [9, 36, 14]. Who2com [20] exploited a handshake communication mechanism to determine which two agents should communicate for image segmentation; When2com [19] introduced an asymmetric attention mechanism to decide when to communicate and how to create communication groups for image segmentation; V2VNet [34] proposed multiple rounds of message passing on a spatial-aware graph neural network for joint perception and prediction in autonomous driving; and [33] proposed a pose error regression module to learn to correct pose errors when the pose information from other agents is noisy.
|
| 99 |
+
|
| 100 |
+
Knowledge distillation. Knowledge distillation (KD) is a widely used technique to compress a larger teacher network to a smaller student network by pushing the student to approach the teacher in either output or intermediate feature space [10], and it has been applied to various tasks such as semantic segmentation [21], single-agent 3D detection [35], and object re-identification [13]. In this work, we apply the KD technique to a new application scenario: multi-agent graph learning. The teacher is an early-collaboration model with privileged information, and the student is an intermediatecollaboration model with limited viewpoint. The distilled collaboration graph could enable effective and efficient inference for the student model without teacher’s supervision.
|
| 101 |
+
|
| 102 |
+
Advantages and limitation of DiscoNet. First, previous collaborative perception only rely on the final detection supervision; while DiscoNet leverages both detection supervision and intermediate feature supervision, acquiring more explicit guidance. Second, the collaboration attention in previous methods is a scalar, which cannot reflect the significance of each region; while DiscoNet uses a matrix, leading to more flexible collaboration at various spatial regions. Third, previous methods uses multiple-round collaboration: When2com needs at least one more round of communication after the first handshake, and V2VNet claims three rounds to ensure reliable performance; while DiscoNet only requires one round, suffering less from latency. Admittedly, DiscoNet has a limitation by assuming accurate pose for each agent, which could be improved by method like [33].
|
| 103 |
+
|
| 104 |
+
# 4 Experiment
|
| 105 |
+
|
| 106 |
+
# 4.1 V2X-Sim 1.0: A multi-agent 3D object detection dataset
|
| 107 |
+
|
| 108 |
+
Since there is no public dataset to support the research on multi-agent 3D object detection in selfdriving scenarios, we build such a dataset named as $\mathrm { V } 2 \mathrm { X } { \mathrm { - } } \mathrm { S i m ~ } 1 . 0 ^ { \circ }$ , based on both SUMO [15], a micro-traffic simulation, and CARLA [6], a widely-used open-source simulator for autonomous driving research. SUMO is firstly used to produce numerically-realistic traffic flow and CARLA is employed to get realistic sensory streams including LiDAR and RGB data, from multiple vehicles located in the same geographical area. The simulated LiDAR is rotated at a frequency of $2 0 \mathrm { H z }$ and has 32 channels; the range which denotes the maximum distance to capture is 70 meters. We use Town05 with multiple lanes and cross junctions for dense traffic simulation; see Fig. 3.
|
| 109 |
+
|
| 110 |
+
Table 1: Detection comparison. Our method is in bold and ∗ indicates the pose-aware version. The proposed DiscoNet is the best among intermediate collaboration. Even with 16 times compression, DiscoNet(16) still outperforms V2VNet without compression.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Method</td><td colspan="3">Collaboration Approach Early Intermediate Late</td><td colspan="2">Average Precision (AP)</td></tr><tr><td>Upper-bound</td><td></td><td></td><td>X</td><td>IoU=0.5 63.3</td><td>IoU=0.7 60.2</td></tr><tr><td></td><td>、</td><td>X</td><td>√</td><td>59.7</td><td>55.8</td></tr><tr><td>When2com*[19]</td><td>X</td><td>√</td><td>X</td><td>45.7</td><td>41.7</td></tr><tr><td>When2com[19]</td><td>X</td><td>√</td><td>X</td><td>45.7</td><td>41.8</td></tr><tr><td>Who2com*[20]</td><td>X</td><td>√</td><td>X</td><td>44.3</td><td>40.3</td></tr><tr><td>Who2com [20]</td><td>X</td><td>√</td><td>X</td><td>44.8</td><td>40.4</td></tr><tr><td>V2VNet [34]</td><td>X</td><td>√</td><td>X</td><td>56.8</td><td>50.7</td></tr><tr><td>DiscoNet</td><td>X</td><td>√</td><td>X</td><td>60.3</td><td>53.9</td></tr><tr><td>DiscoNet(16)</td><td>X</td><td>√</td><td>X</td><td>58.5</td><td>53.0</td></tr><tr><td>Lower-bound</td><td>X</td><td>X</td><td>√</td><td>57.6</td><td>54.2</td></tr><tr><td></td><td>X</td><td>X</td><td>X</td><td>45.8</td><td>42.3</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 2: Detection performance by regularizing various layers via knowledge distillation (KD). ${ \bf M } _ { i } ^ { \mathrm { s } } \{ n \} ( n \stackrel { \cdot } { = } 1 , 2 , 3 , 4 )$ denotes different layers in the decoder. The performance significantly boots once the KD regularization is applied. Further regularization has a slight effect on the detection performance.
|
| 115 |
+
|
| 116 |
+
<table><tr><td colspan="4">KD Regularization M{3}</td><td colspan="2">Average Precision (AP)</td></tr><tr><td colspan="4">H M{1} M{2}</td><td>IoU=0.5</td><td>IoU=0.7</td></tr><tr><td>xν<√</td><td></td><td></td><td>M{4}</td><td>57.2</td><td>52.3</td></tr><tr><td></td><td></td><td>xxxx<<></td><td>xxxxx<v</td><td>57.5</td><td>52.7</td></tr><tr><td></td><td></td><td></td><td></td><td>58.2</td><td>52.7</td></tr><tr><td></td><td></td><td></td><td></td><td>59.7</td><td>53.5</td></tr><tr><td></td><td></td><td></td><td></td><td>60.3</td><td>53.9</td></tr><tr><td></td><td></td><td></td><td></td><td>59.1 58.3</td><td>53.8</td></tr><tr><td>v/x</td><td>xx<<<<></td><td>xxx<<<></td><td></td><td></td><td>52.6</td></tr></table>
|
| 117 |
+
|
| 118 |
+
$\mathrm { V } 2 \mathrm { X } { \cdot } \mathrm { S i m } 1 . 0$ follows the same storage format of nuScenes [2], a widely-used autonomous driving dataset. nuScenes collected real-world single-agent data; while we simulate multi-agent scenarios. Each scene includes a 20 second traffic flow at a certain intersection of Town05, and the LiDAR streams are recorded every 0.2 second, so each scene consists of 100 frames. We generate 100 scenes with a total of 10,000 frames, and in each scene, we randomly select 2-5 vehicles as the collaboration agents. We use 8,000/900/1,100 frames for training/validation/testing. Each frame has multiple samples, and there are 23,500 samples in the training set and 3,100 samples in the test set.
|
| 119 |
+
|
| 120 |
+
# 4.2 Quantitative evaluation
|
| 121 |
+
|
| 122 |
+
Implementation and evaluation. We crop the points located in the region of $[ - 3 2 , 3 2 ] \times [ - 3 2 , 3 2 ] \times$ $[ - 3 , 2 ]$ meters defined in the ego-vehicle $X Y Z$ coordinate. We set the width/length of each voxel as 0.25 meter, and the height as 0.4 meter; therefore the BEV map input to the student/teacher encoder has a dimension of $2 5 6 \times 2 5 6 \times 1 3$ . The intermediate feature output by the encoder has a dimension of $3 2 \times 3 2 \times 2 5 6$ , and we use an autoencoder (AE) for compression to save bandwidth: the sent message is the embedding output by AE. After the agents receive the embedding, they will decode it to the original resolution $3 2 \times 3 2 \times 2 5 6$ for intermediate collaboration. The hyperparameter $\lambda _ { \mathrm { k d } }$ is set as $1 0 ^ { 5 }$ . We train all the models using NVIDIA GeForce RTX 3090 GPU. We employ the generic BEV detection evaluation metric: Average Precision (AP) at Intersection-over-Union (IoU) threshold of 0.5 and 0.7. We target the detection of the car category and report the results on the test set.
|
| 123 |
+
|
| 124 |
+
Baselines and existing methods. We consider the single-agent perception model; called Lowerbound, which consumes a single-view point cloud. The teacher model based on early collaboration with a holistic view is considered as the Upper-bound. Both lower-bound and upper-bound can involve late collaboration, which aggregates all the boxes and applies a global non-maximum suppression (NMS). We also consider three intermediate-collaboration methods, Who2com [20], When2com [19] and V2VNet [34]. Since the original Who2com and When2com do not consider pose information, we consider both pose-aware and pose-agnostic versions to achieve fair comparisons. All the methods use the same detection architecture and conduct collaboration at the same intermediate feature layer.
|
| 125 |
+
|
| 126 |
+
Results and comparisons. Table 1 shows the comparisons in terms of AP ( $\textcircled { a } \mathrm { I o U } = 0 . 5 / 0 . 7 $ ). We see that i) early collaboration (first row) achieves the best detection performance, and there is an obvious improvement over no collaboration (last row), i.e., $\mathrm { A P } @ 0 . 5$ and $\mathrm { A P @ 0 . 7 }$ are increased by $3 8 . 2 \%$ and $4 2 . 3 \%$ respectively, reflecting the significance of collaboration; ii) late collaboration improves the lower-bound (second last row), but hurts the upper-bound (second row), reflecting the unreliability of late collaboration. This is because the final, global NMS can remove a lot of noisy boxes for the lower-bound, but would also remove many useful boxes for the upper-bound; and iii) among the intermediate collaboration-based methods, the proposed DiscoNet achieves the best performance. Comparing to the pose-aware When2com, DiscoNet improves by $3 1 . 9 \%$ in $\mathrm { A P } @ 0 . 5$ and $2 9 . 3 \%$ in $\mathrm { A P @ 0 . 7 }$ . Comparing to V2VNet, DiscoNet improves by $6 . 2 \%$ in $\mathsf { A P @ 0 . 5 }$ and $6 . 3 \ \%$ in $\mathrm { A P @ 0 . 7 }$ Even with 16-times compression by the autoencoder, DiscoNet(16) still outperforms V2VNet.
|
| 127 |
+
|
| 128 |
+
Table 3: Comparison of various intermediate collaboration strategies. KD indicates knowledge distillation. With KD and matrix-valued edge weights, our DiscoGraph outperforms the others.
|
| 129 |
+
|
| 130 |
+
<table><tr><td rowspan="2">Collaboration Strategy</td><td colspan="4">Scalar Weight</td><td colspan="3">Matrix Weight</td></tr><tr><td>No</td><td>Sum</td><td>Average</td><td>Weighted Average</td><td>Max</td><td>Cat</td><td>DiscoGraph</td></tr><tr><td>w/o KD (AP@IoU 0.5/0.7)</td><td>45.8/42.3</td><td>55.7/50.9</td><td>55.7/50.4</td><td>56.1/51.4</td><td>56.7/51.4</td><td>55.0/50.2</td><td>57.2/52.3</td></tr><tr><td>w/ KD (AP@IoU 0.5/0.7)</td><td>46.5/42.9</td><td>54.4/46.3</td><td>56.4/51.1</td><td>56.7/50.9</td><td>56.7/51.8</td><td>57.5/52.6</td><td>60.3/53.9</td></tr><tr><td>Gain</td><td>0.7/0.6</td><td>-1.3/-4.6</td><td>0.7/0.7</td><td>0.6/-0.5</td><td>0.0/0.4</td><td>2.5/2.4</td><td>3.1/1.6</td></tr><tr><td>Gain (%)</td><td>1.5/1.4</td><td>-2.3/-9.0</td><td>1.3/1.4</td><td>1.1/-1.0</td><td>0.0/0.7</td><td>3.3/4.6</td><td>5.4/3.1</td></tr></table>
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 4: Performance-bandwidth trade-off. DiscoNet(64) achieves 192 times less communication volume and still outperforms V2VNet [34].
|
| 134 |
+
|
| 135 |
+
Performance-bandwidth trade-off analysis. Fig. 4 thoroughly compares the proposed DiscoNet with the baseline methods in terms of the trade-off between detection performance and communication bandwidth. In Plots (a) and (b), the lower-bound with no collaboration is shown as a dashed line since the communication volume is zero, and the other method is shown as one dot in the plot. We see that i) DiscoNet with feature-map compression by an autoencoder achieves a far-more superior trade-off than the other methods; ii) DiscoNet(64), which is DiscoNet with 64-times feature compression by autoencoder, achieves 192 times less communication volume and still outperforms V2VNet for both $\mathrm { A P } @ 0 . 5$ and 0.7; and iii) feature compression does not significantly hurt the detection performance.
|
| 136 |
+
|
| 137 |
+
Comparison of training times with and without KD. Incorporating KD will increase the training time a little bit, from ${ \sim } 1 2 0 0 \mathrm { s }$ to ${ \sim } 1 5 0 0 \mathrm { s }$ per epoch (each epoch consists of 2,000 iterations). However, during inference, DiscoNet does not need the teacher model anymore and can work alone without extra computations. Note that our key advantage is to push the computation burden into the training stage in pursuit of efficient and effective inference which is crucial in the real-world deployment.
|
| 138 |
+
|
| 139 |
+
# 4.3 Qualitative evaluation
|
| 140 |
+
|
| 141 |
+
Visualization of edge weight. To understand the working mechanism of the proposed collaboration graph, we visualize the detection results and the corresponding edge weights; see Fig. 5 and Fig. 7. Note that the proposed edge weight is a matrix, reflecting the collaboration attention in a cell-level resolution, which is shown as a heat map. Fig. 5 (a), (b) and (c) show three exemplar detection results of Agent 1 based on the lower-bound, upper-bound and the proposed DiscoNet, respectively. We see that with the collaboration, DiscoNet is able to detect boxes in those occluded and long-range regions. To understand why, Fig. 5 (d) and (e) provide the corresponding ego edge weight and the edge weight from agent 2 to agent 1, respectively. We clearly see that with the proposed collaboration graph, Agent 1 is able to receive complementary information from the other agents. Take the first row in Fig. 5 as an example, we see that in Plot (d), the bottom-left spatial region has a much darker color, indicating that Agent 1 has less confidence about this region; while in Plot (e), the bottom-left spatial region has a much brighter color, indicating that Agent 1 has much stronger demands to request information from Agent 2.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 5: Detection and matrix-valued edge weight for Agent 1. Green and red boxes denote groundtruth (GT) and predictions, respectively. (a-c) shows the outputs of lower-bound, upper-bound and DiscoNet compared to GT. (d) Ego matrix-valued edge weight for Agent 1. Attention to the region with sparse/no measurement is suppressed. (e) Matrix-valued edge weight from Agent 2 to Agent 1. Attention to the region with complementary information from Agent 2 is enhanced.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 6: DiscoNet qualitatively outperforms the state-of-the-art methods. Green and red boxes denote ground-truth and detection, respectively. (a) Output of when2com. (b) Output of V2VNet. (c) Output of DiscoNet. (d)-(f) Matrix-valued edge weights. (Ego agent: 1; neighbour agents: 2 and 3.)
|
| 148 |
+
|
| 149 |
+
Comparison with When2com and V2VNet. Fig. 6 shows two examples to compare the proposed DiscoNet with When2com, V2VNet. We see that DiscoNet is able to detect more objects. The reason is that both V2VNet and when2com employ a scalar to denote the agent-to-agent attention, which cannot distinguish which region is more informative; while DiscoNet can adaptively find beneficial region in a cell-level resolution; see the visualization of matrix-valued edge weights in Fig. 6 (d)-(f).
|
| 150 |
+
|
| 151 |
+
# 4.4 Ablation study
|
| 152 |
+
|
| 153 |
+
Effect of collaboration strategy. Table 3 compares the proposed method with five baselines using different intermediate collaboration strategies. Sum simply sums all the intermediate feature maps. Average calculates the mean of all the feature maps. Max selects the maximum value of all the feature maps at each cell to produce the final feature. Cat concatenates the mean of others’ features with its own feature, and then uses a convolution layer to halve the channel number. Weighted Average appends one convolutional layer to our edge encoder $\Pi$ , to generate a scalar value as the agent-wise edge weight. We use a matrix-valued edge weight to model the collaboration among agents. Without knowledge distillation, Max has achieved the second best performance probably because it ignores the noisy information with lower value. We see that with the proposed matrix-valued edge weight and knowledge distillation, DiscoGraph significantly outperforms all the other collaboration choices.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 7: Detection and matrix-valued edge weight for Agent 1. Green/red boxes denote GT/predictions. (a)(b) show the outputs of upper-bound and DiscoNet. (c) Ego edge weight for Agent 1. (d) Edge weight from Agent 2 to Agent 1. The spatial regions containing complementary information for Agent 1 are highlighted by green circles in (d) and red circles in (a).
|
| 157 |
+
|
| 158 |
+
Effect of knowledge distillation. In Table 3 we investigate the versions with and without knowledge distillation, We see that i) for our method, the knowledge distillation can guide the learning of collaboration graph, and the agents can work collaboratively to approach the teacher’s performance; ii) for max without a learnable module during collaboration, knowledge distillation has no impact; and iii) for cat and average, their performances are improved a little bit, as knowledge distillation can influence the feature abstraction process. Table 2 further shows the detection performances when we apply knowledge-distillation regularization at various network layers. We see that i) once we apply knowledge distillation to regularize the feature map, the proposed method starts to achieve improvement; and ii) applying regularization on four layers has the best performance.
|
| 159 |
+
|
| 160 |
+
# 5 Conclusion
|
| 161 |
+
|
| 162 |
+
We propose a novel intermediate-collaboration method, called distilled collaboration network (DiscoNet), for multi-agent perception. Its core component is a distilled collaboration graph (DiscoGraph), which is novel in both the training paradigm and the edge weight setting. DiscoGraph is also pose-aware and adaptive to perception measurements, allowing multiple agents with the shared DiscoNet to collaboratively approach the performance of the teacher model. To validate, we build $\mathrm { V } 2 \mathrm { X } { \cdot } \mathrm { S i m } 1 . 0$ , a large-scale multi-agent 3D object detection dataset based on CARLA and SUMO. Comprehensive quantitative and qualitative experiments show that DiscoNet achieves appealing performance-bandwidth trade-off with a more straightforward design rationale.
|
| 163 |
+
|
| 164 |
+
Acknowledgment. This research is partially supported by the NSF CPS program under CMMI1932187, the National Natural Science Foundation of China under Grant 6217010074, and the Science and Technology Commission of Shanghai Municipal under Grant 21511100900. The authors gratefully acknowledge the useful comments and suggestions from anonymous reviewers.
|
| 165 |
+
|
| 166 |
+
References
|
| 167 |
+
[1] Rohan Anil, Gabriel Pereyra, Alexandre Passos, Robert Ormandi, George E Dahl, and Geoffrey E Hinton. Large scale distributed neural network training through online distillation. In International Conference on Learning Representations, 2018. 2
|
| 168 |
+
[2] Holger Caesar, Varun Bankiti, Alex H Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 11621–11631, 2020. 7
|
| 169 |
+
[3] Qi Chen, Sihai Tang, Qing Yang, and Song Fu. Cooper: Cooperative perception for connected autonomous vehicles based on 3d point clouds. In IEEE International Conference on Distributed Computing Systems (ICDCS), pages 514–524, 2019. 2
|
| 170 |
+
[4] Siheng Chen, Baoan Liu, Chen Feng, Carlos Vallespi-Gonzalez, and Carl K. Wellington. 3d point cloud processing and learning for autonomous driving: Impacting map creation, localization, and perception. IEEE Signal Processing Magazine, 38:68–86, 2021. 1
|
| 171 |
+
[5] Abhishek Das, Théophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Mike Rabbat, and Joelle Pineau. Tarmac: Targeted multi-agent communication. In International Conference on Machine Learning, pages 1538–1546, 2019. 6
|
| 172 |
+
[6] Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. CARLA: An open urban driving simulator. In Proceedings of the 1st Annual Conference on Robot Learning, pages 1–16, 2017. 2, 6
|
| 173 |
+
[7] Jakob N. Foerster, Yannis M. Assael, N. D. Freitas, and S. Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In NeurIPS, 2016. 5
|
| 174 |
+
[8] Andreas Geiger, Philip Lenz, and Raquel Urtasun. Are we ready for autonomous driving? the kitti vision benchmark suite. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 3354–3361, 2012. 1
|
| 175 |
+
[9] Ramyad Hadidi, Jiashen Cao, Matthew Woodward, Michael S Ryoo, and Hyesoon Kim. Distributed perception by collaborative robots. IEEE Robotics and Automation Letters, 3(4):3709–3716, 2018. 6
|
| 176 |
+
[10] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. 2, 6
|
| 177 |
+
[11] Yedid Hoshen. Vain: Attentional multi-agent predictive modeling. In NeurIPS, 2017. 5
|
| 178 |
+
[12] Jiechuan Jiang and Zongqing Lu. Learning attentional communication for multi-agent cooperation. In NeurIPS, 2018. 6
|
| 179 |
+
[13] Xin Jin, Cuiling Lan, Wenjun Zeng, and Zhibo Chen. Uncertainty-aware multi-shot knowledge distillation for image-based object re-identification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 11165–11172, 2020. 6
|
| 180 |
+
[14] Saifullah Khan, Franz Andert, Nicolai Wojke, Julian Schindler, Alejandro Correa, and Anton Wijbenga. Towards collaborative perception for automated vehicles in heterogeneous traffic. In International Forum on Advanced Microsystems for Automotive Applications, pages 31–42, 2018. 6
|
| 181 |
+
[15] Daniel Krajzewicz, Jakob Erdmann, Michael Behrisch, and Laura Bieker. Recent development and applications of sumo-simulation of urban mobility. International journal on advances in systems and measurements, 5(3&4), 2012. 6
|
| 182 |
+
[16] Loic Landrieu and Martin Simonovsky. Large-scale point cloud semantic segmentation with superpoint graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4558–4567, 2018. 1
|
| 183 |
+
[17] Yiming Li, Congcong Wen, Felix Juefei-Xu, and Chen Feng. Fooling lidar perception via adversarial trajectory perturbation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 7898–7907, October 2021. 2
|
| 184 |
+
[18] Li Liu, Wanli Ouyang, Xiaogang Wang, Paul Fieguth, Jie Chen, Xinwang Liu, and Matti Pietikäinen. Deep learning for generic object detection: A survey. International journal of computer vision, 128(2):261–318, 2020. 1
|
| 185 |
+
[19] Yen-Cheng Liu, Junjiao Tian, Nathaniel Glaser, and Zsolt Kira. When2com: multi-agent perception via communication graph grouping. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4106–4115, 2020. 2, 4, 6, 7
|
| 186 |
+
[20] Yen-Cheng Liu, Junjiao Tian, Chih-Yao Ma, Nathan Glaser, Chia-Wen Kuo, and Zsolt Kira. Who2com: Collaborative perception via learnable handshake communication. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 6876–6883, 2020. 2, 4, 6, 7
|
| 187 |
+
[21] Yifan Liu, Ke Chen, Chris Liu, Zengchang Qin, Zhenbo Luo, and Jingdong Wang. Structured knowledge distillation for semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 2604–2613, 2019. 6
|
| 188 |
+
[22] Wenjie Luo, Bin Yang, and Raquel Urtasun. Fast and furious: Real time end-to-end 3d detection, tracking and motion forecasting with a single convolutional net. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 3569–3577, 2018. 1
|
| 189 |
+
[23] Seyed Mojtaba Marvasti-Zadeh, Li Cheng, Hossein Ghanei-Yakhdan, and Shohreh Kasaei. Deep learning for visual tracking: A comprehensive survey. IEEE Transactions on Intelligent Transportation Systems, 2021. 1
|
| 190 |
+
[24] Jonathan Masci, Ueli Meier, Dan Cire¸san, and Jürgen Schmidhuber. Stacked convolutional auto-encoders for hierarchical feature extraction. In International conference on artificial neural networks, pages 52–59, 2011. 4
|
| 191 |
+
[25] Shervin Minaee, Yuri Boykov, F. Porikli, A. Plaza, N. Kehtarnavaz, and Demetri Terzopoulos. Image segmentation using deep learning: A survey. IEEE transactions on pattern analysis and machine intelligence, PP, 2021. 1
|
| 192 |
+
[26] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. CoRR, abs/1412.6550, 2015. 2
|
| 193 |
+
[27] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li. Pointrcnn: 3d object proposal generation and detection from point cloud. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–779, 2019. 1
|
| 194 |
+
[28] Shaoshuai Shi, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li. From points to parts: 3d object detection from point cloud with part-aware and part-aggregation network. IEEE transactions on pattern analysis and machine intelligence, 2020. 2
|
| 195 |
+
[29] Weijing Shi and Raj Rajkumar. Point-gnn: Graph neural network for 3d object detection in a point cloud. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 1711–1719, 2020. 2
|
| 196 |
+
[30] Yoav Shoham and Kevin Leyton-Brown. Multiagent systems: Algorithmic, game-theoretic, and logical foundations. Cambridge University Press, 2008. 5
|
| 197 |
+
[31] Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In International Conference on Learning Representations, 2018. 5
|
| 198 |
+
[32] Sainbayar Sukhbaatar, Arthur D. Szlam, and Rob Fergus. Learning multiagent communication with backpropagation. In NeurIPS, 2016. 5
|
| 199 |
+
[33] Nicholas Vadivelu, Mengye Ren, James Tu, Jingkang Wang, and Raquel Urtasun. Learning to communicate and correct pose errors. In 4th Conference on Robot Learning (CoRL), 2020. 6
|
| 200 |
+
[34] Tsun-Hsuan Wang, Sivabalan Manivasagam, Ming Liang, Bin Yang, Wenyuan Zeng, and Raquel Urtasun. V2vnet: Vehicle-to-vehicle communication for joint perception and prediction. In Proceedings of the European Conference on Computer Vision (ECCV), pages 605–621, 2020. 2, 4, 6, 7, 8
|
| 201 |
+
[35] Yue Wang, Alireza Fathi, Jiajun Wu, Thomas Funkhouser, and Justin Solomon. Multi-frame to singleframe: Knowledge distillation for 3d object detection. In Proceedings of the European Conference on Computer Vision Workshops, 2020. 6
|
| 202 |
+
[36] Yufeng Yue, Chunyang Zhao, Mingxing Wen, Zhenyu Wu, and Danwei Wang. Collaborative semantic perception and relative localization based on map matching. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 6188–6193, 2020. 6
|
| 203 |
+
[37] Yin Zhou and Oncel Tuzel. Voxelnet: End-to-end learning for point cloud based 3d object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4490–4499, 2018. 2
|
md/train/_x4A8IZ-rRv/_x4A8IZ-rRv.md
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Differentiable Sparsification for Deep Neural Networks
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Deep neural networks have relieved the feature engineering burden on human
|
| 11 |
+
2 experts. However, comparable efforts are instead required to determine an effective
|
| 12 |
+
3 architecture. In addition, as the sizes of networks have over-grown, a considerable
|
| 13 |
+
4 amount of resources is also invested in reducing the sizes. The sparsification of an
|
| 14 |
+
5 over-complete model addresses these problems as it removes redundant parameters
|
| 15 |
+
6 or connections. In this study, we propose a fully differentiable sparsification
|
| 16 |
+
7 method for deep neural networks, which allows parameters to be zero during
|
| 17 |
+
8 training with the stochastic gradient descent. Thus, the proposed method can
|
| 18 |
+
9 simultaneously learn the sparsified structure and weights of networks in an end
|
| 19 |
+
10 to-end manner, which can be directly applies to modern deep neural networks
|
| 20 |
+
11 and imposes minimum overhead to the training process. To the authors’ best
|
| 21 |
+
12 knowledge, it is the first fully [sub-]differentiable sparsification method that zeroes
|
| 22 |
+
13 out components, and it provides a foundation for future structure learning and
|
| 23 |
+
14 model compression methods.
|
| 24 |
+
|
| 25 |
+
# 15 1 Introduction
|
| 26 |
+
|
| 27 |
+
16 The success of deep neural networks has changed the paradigm of machine learning and pattern
|
| 28 |
+
17 recognition from feature engineering to architecture engineering [16, 14, 22, 7, 32]. Although deep
|
| 29 |
+
18 neural networks have relieved the burden of feature engineering, comparable human efforts are instead
|
| 30 |
+
19 required to determine an effective architecture, such as the number of neurons or layers and the
|
| 31 |
+
20 connections between nodes. In addition, as deep neural networks have over-grown (even up to 10–68
|
| 32 |
+
21 million parameters) [8, 10, 15, 32], considerable effort is also being invested in reducing existing
|
| 33 |
+
22 model sizes and in meeting the demands of deploying such networks on constrained platforms at
|
| 34 |
+
23 inference time [26, 25].
|
| 35 |
+
24 These problems can be addressed by the sparsification of an over-complete model [20]. A network
|
| 36 |
+
25 structure can be carved out of an over-complete model by removing redundant blocks [3, 29] or
|
| 37 |
+
26 deleting unnecessary connections between nodes or blocks [2, 18, 30], which also reduces the network
|
| 38 |
+
27 size. Among several approaches, pruning has long been adapted [17, 6, 26, 19, 5]. It typically requires
|
| 39 |
+
28 a pre-trained model and several steps (select unimportant parameters of a pre-trained model, delete
|
| 40 |
+
29 the parameters, and retrain the pruned model) and may repeat the process multiple times. Another
|
| 41 |
+
30 approach is a sparsity regularizer with the proximal gradient [21, 3, 29, 33] which shrinks redundant
|
| 42 |
+
31 parameters to zero during training and requires no pre-trained model. Among the most popular ones
|
| 43 |
+
32 is $l _ { 1 }$ -regularizer [28]. However, as it acts on an individual parameter, it often produces unstructured
|
| 44 |
+
33 irregular models; thus, it diminishes the benefit of parallel hardware computation, such as GPUs [29].
|
| 45 |
+
34 In order to obtain regular sparse structures, a sparse regularization with $l _ { 2 }$ -norm [3, 29] was adopted
|
| 46 |
+
35 on a group of parameters so that all parameters under the same group are either retained or zeroed
|
| 47 |
+
36 out together. By zeroing-out parameters at a group level, the number of neurons or layers can be
|
| 48 |
+
37 automatically determined as a part of training. However, the optimization of a regularization term is
|
| 49 |
+
38 performed as a separate step separately from the gradient descent-based optimization for prediction
|
| 50 |
+
39 loss. The update rules should be implemented manually and the approach is limited to the cases
|
| 51 |
+
40 where closed form solutions for the proximal operation are known.
|
| 52 |
+
41 In this work, we propose a fully [sub-]differentiable sparsification method for deep neural networks,
|
| 53 |
+
42 which directly optimizes a regularized objective function and allows parameters to be exactly zero
|
| 54 |
+
43 during training with the stochastic gradient descent. Thus, it can simultaneously learn the sparsified
|
| 55 |
+
44 structure and weights of deep neural networks in an end-to-end manner. It leads to simpler implemen
|
| 56 |
+
45 tation and it does not require to manually code a pruning step or an update rule like a soft-thresholding
|
| 57 |
+
46 operator. It can adopt various norms as a regularizer regardless of whether their closed form solutions
|
| 58 |
+
47 for the proximal operator are known or not. Another advantage of the proposed method is that it
|
| 59 |
+
48 can be easily applied on a group of parameters or a building block; thus, it can produce a structured
|
| 60 |
+
49 model and maximize the benefits of parallel hardware computation (e.g., GPUs) and it well suits the
|
| 61 |
+
50 trend of a modularized design in deep learning [22, 27, 7, 32].
|
| 62 |
+
|
| 63 |
+
# 51 2 Related Work
|
| 64 |
+
|
| 65 |
+
# 2.1 Proximal Gradient
|
| 66 |
+
|
| 67 |
+
Our proposed method is related to sparsity regularization with the proximal gradient [21]. A regularized objective function is written as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { L } \left( D , W \right) + \lambda \mathcal { R } \left( W \right) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
55 where $\mathcal { L }$ denotes a prediction loss, $\mathcal { R }$ is a regularization term, $D$ is a set of training data, $W$ is a set
|
| 74 |
+
56 of model parameters, and $\lambda$ controls the trade-off between prediction loss and model complexity. The
|
| 75 |
+
57 most popular regularizer is $l _ { 1 }$ -norm,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
{ \mathcal { R } } \left( W \right) = \sum _ { i } \left| w _ { i } \right| ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
58 where $w _ { i }$ is an individual element of $W$ . To optimize the regularization term, parameter updating is
|
| 82 |
+
59 performed with a proximal operator,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
w _ { i } s i g n ( w _ { i } ) ( | w _ { i } | - \eta \lambda ) _ { + } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
60 where denotes an assignment operator, $\eta$ is a learning rate, and $( \cdot ) _ { + }$ represents $\operatorname* { m a x } ( \cdot , 0 )$ . As this
|
| 89 |
+
61 approach acts on an individual parameter, it often produces unstructured irregular models. In order
|
| 90 |
+
62 to obtain regular sparse structures, the sparse regularization with $l _ { 2 , 1 }$ -norm can be adopted [3, 29].
|
| 91 |
+
63 All parameters in the same group are either retained or zeroed-out together. The regularization with
|
| 92 |
+
64 $l _ { 2 , 1 }$ -norm is written as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathcal { R } \left( W \right) = \sum _ { g } \left. \mathbf { w } _ { g } \right. _ { 2 } = \sum _ { g } \sqrt { \sum _ { i } w _ { g , i } ^ { 2 } } ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
65 where $W = \{ \mathbf { w } _ { g } \}$ and ${ \bf w } _ { g }$ represents a group of model parameters. The regularization term is
|
| 99 |
+
66 optimized with a proximal operator,
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
w _ { g , i } \gets \left( \frac { \left\| \mathbf { w } _ { g } \right\| _ { 2 } - \eta \lambda } { \left\| \mathbf { w } _ { g } \right\| _ { 2 } } \right) _ { + } w _ { g , i } .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
67 When a group has only one single parameter, it degenerates to the $l _ { 1 }$ -norm regularization.
|
| 106 |
+
|
| 107 |
+
68 Another group regularization is exclusive lasso with $l _ { 1 , 2 }$ -norm [34, 33]. Rather than either retaining
|
| 108 |
+
69 or removing an entire group altogether, it promotes the competition or sparsity within a group. The
|
| 109 |
+
70 regularization term is written as
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathcal { R } \left( W \right) = \frac { 1 } { 2 } \sum _ { g } \left. \mathbf { w } _ { g } \right. _ { 1 } ^ { 2 } = \frac { 1 } { 2 } \sum _ { g } \left( \sum _ { i } \left. w _ { g , i } \right. \right) ^ { 2 } ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
71 and its updating rule is derived as
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
w _ { g , i } s i g n ( w _ { g , i } ) ( | w _ { g , i } | - \eta \lambda \big | \big | \mathbf { w } _ { g } \big | \big | _ { 1 } ) _ { + } .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
72 These proximal operators consist of weight decaying and thresholding steps, and they are performed
|
| 122 |
+
73 at every mini-batch or epoch in a sperate step after the optimization of a prediction loss. It requires
|
| 123 |
+
74 some extra efforts to implement the update rules manually and applications are limited to the cases
|
| 124 |
+
75 where closed form solutions for the proximal operator are known. In contrast, our approach optimizes
|
| 125 |
+
76 a regularized objective function directly and allows parameters to be zero during training with the
|
| 126 |
+
77 stochastic gradient descent. It leads to simpler implementations and it can employ various norms
|
| 127 |
+
78 regardless of whether closed form solutions for proximal operators are known or not, for example
|
| 128 |
+
79 $p$ -norm with $p < 1$ .
|
| 129 |
+
|
| 130 |
+
# 80 2.2 Differentiable Approach
|
| 131 |
+
|
| 132 |
+
81 Similar to our work, previous differentiable approaches [2, 18] learn the structure of a neural
|
| 133 |
+
82 network by optimizing architecture parameters in a relaxed continuous domain, where architecture
|
| 134 |
+
83 parameters represent the importance scores of building blocks or the connection strengths between
|
| 135 |
+
84 them. However, as the architecture parameter magnitudes cannot be zero during training, the
|
| 136 |
+
85 top $k$ connections or components are stochastically or deterministically selected according to the
|
| 137 |
+
86 architecture parameter values to derive a discretized architecture. Therefore, the approach may suffer
|
| 138 |
+
87 from the discrepancy between a learned architecture and a final discretized one. Moreover, the
|
| 139 |
+
88 value of $k$ should be pre-specified manually; thus, the same value is set for all blocks or modules,
|
| 140 |
+
89 which may be sub-optimal. Our approach drives the architecture parameters to zero by optimizing a
|
| 141 |
+
90 regularized objective function. This can minimize the model discrepancy, and a network can choose
|
| 142 |
+
91 the different numbers of components or connections in each module through training.
|
| 143 |
+
|
| 144 |
+
# 92 3 Proposed Approach
|
| 145 |
+
|
| 146 |
+
# 3.1 Base Model
|
| 147 |
+
|
| 148 |
+
94 We assume that there are $n$ components in a module. A component can be any building block for a
|
| 149 |
+
95 deep neural network or its output. For example, it can be a channel or a layer of convolutional neural
|
| 150 |
+
96 networks such as ResNet [7, 8] and DenseNet layer [10]. It can also represent a node in a neural
|
| 151 |
+
97 graph [30] or a convolutional neural network [11]. A module represents a composite of components,
|
| 152 |
+
98 such as a group of channels or nodes. For illustration purposes, we assume that a module $\mathbf { y }$ can be
|
| 153 |
+
99 written as the linear combination of components $\mathbf { f } _ { i }$ :
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\mathbf { y } \left( \mathbf { x } \right) = \sum _ { i = 1 } ^ { n } a _ { i } \mathbf { f } _ { i } \left( \mathbf { x } ; \mathbf { w } _ { i } \right) ,
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
100 where $\mathbf { X }$ denotes a module input, $\mathbf { w } _ { i }$ model parameters for component $\mathbf { f } _ { i }$ , and $a _ { i }$ an architecture
|
| 160 |
+
101 parameter. Model parameters $\mathbf { w } _ { i }$ denote ordinary parameters, such as a filter in a convolutional layer
|
| 161 |
+
102 or weight in a fully connected layer. The value of $a _ { i }$ represents the importance of component $i$ , and it
|
| 162 |
+
103 represents the connection strength between nodes in another context. Enforcing $a _ { i }$ to be zero amounts
|
| 163 |
+
104 to removing component $\mathbf { f } _ { i }$ or zeroing-out $\mathbf { w } _ { i }$ . Thus, by creating the competition between elements of
|
| 164 |
+
105 $a$ and driving them to be zero, we can eliminate unnecessary components or connections. The sample
|
| 165 |
+
106 model is simple, but we will show that it can be applied to various cases.
|
| 166 |
+
|
| 167 |
+
# 107 3.2 Differentiable Sparse Parameterization
|
| 168 |
+
|
| 169 |
+
08 First, we show how to parameterize architecture parameters with non-negative constraints, which is
|
| 170 |
+
09 useful for the attention mechanism with the softmax. To set up the competition between the elements
|
| 171 |
+
110 of $a$ and allow them to be zero, we parameterize the architecture parameters as follows:
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\gamma _ { i } = \exp \left( \alpha _ { i } \right)
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\tilde { \gamma } _ { i } = \left( \gamma _ { i } - \sigma \left( \beta \right) \cdot \left. \gamma \right. _ { 1 } \right) _ { + }
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
a _ { i } = \frac { \tilde { \gamma } _ { i } } { \sum _ { j = 1 } ^ { n } \tilde { \gamma } _ { j } } ,
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
113 where $\alpha _ { i }$ and $\beta$ are unconstrained free parameters, $\sigma ( \cdot )$ denotes a sigmoid function, and $( \cdot ) _ { + }$ rep
|
| 186 |
+
114 resents $r e l u ( \cdot ) = \operatorname* { m a x } ( \cdot , 0 )$ . When a parameter is non-negative, the proximal operator of Eq. (7)
|
| 187 |
+
115 is reduced to Eq. (10). Although the forms are similar, they have completely different meanings.
|
| 188 |
+
116 The proximal operator is a learning rule, whereas Eq. (10) is the parameterized form of architecture
|
| 189 |
+
117 parameters, which is part of a neural network.
|
| 190 |
+
118 We can easily verify that $a _ { i }$ is allowed to be zero and is also differentiable from a modern deep
|
| 191 |
+
119 learning perspective. The free parameters $\alpha _ { i }$ and $\beta$ are real-valued and they do not restrict a training
|
| 192 |
+
120 process with the stochastic gradient descent. Thus, we can train $a _ { i }$ through $\alpha _ { i }$ and $\beta$ . The exponential
|
| 193 |
+
121 function in Eq. (9) ensures that the architecture parameters are non-negative. Typically, $a _ { i }$ cannot
|
| 194 |
+
122 be zero due to the exponential function of Eq. (9). However, $\tilde { \gamma } _ { i }$ in Eq. (10) can be zero by the
|
| 195 |
+
123 thresholding operation; hence, $a _ { i }$ can be zero as well. The term $\sigma \left( \beta \right) \cdot \| \gamma \| _ { 1 }$ plays the role of a
|
| 196 |
+
124 threshold, and the thresholding operation is interpreted as follows: if the strength of component $i$
|
| 197 |
+
125 in a competition group is small compared to the total strength, it is dropped from the competition.
|
| 198 |
+
126 Note that the scalar parameter $\beta$ in Eq. (10), which determines the magnitude of a threshold, is
|
| 199 |
+
127 not a hyper-parameter, but its value is automatically determined through training. Mathematically,
|
| 200 |
+
128 the thresholding operator is not differentiable, but this should not pose an issue considering the
|
| 201 |
+
129 support of relu as a built-in differentiable function in a modern deep learning tool. Additionally, $\gamma$ is
|
| 202 |
+
130 non-negative; thus, its $l _ { 1 }$ -norm is simply the sum of $\gamma _ { i }$ (i.e., $\| \gamma \| _ { 1 } = \sum \gamma _ { i } )$ . The softmax of Eq. (11)
|
| 203 |
+
131 is also differentiable. The softmax is optional but useful when we need to promote the competition
|
| 204 |
+
132 between components as in the attention mechanism.
|
| 205 |
+
|
| 206 |
+
33 By relaxing the differentiability, singed architecture parameter can be similarly formed as
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
a _ { i } = s i g n ( \alpha _ { i } ) ( | \alpha _ { i } | - \sigma ( \beta ) | | \alpha | | _ { 1 } ) _ { + } ,
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
134 where $\alpha$ and $\beta$ are free parameters. The gradient of the sign function is zero almost everywhere, but
|
| 213 |
+
135 it does not cause a problem for a modern deep learning tool. The equation can be rewritten as
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
a _ { i } = \left\{ \begin{array} { l l } { \left( \alpha _ { i } + \sigma \left( \beta \right) \lVert \alpha \rVert _ { 1 } \right) _ { - } } & { \mathrm { i f } \ \alpha _ { i } < 0 } \\ { \left( \alpha _ { i } - \sigma \left( \beta \right) \lVert \alpha \rVert _ { 1 } \right) _ { + } } & { \mathrm { o t h e r w i s e } , } \end{array} \right.
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
136 where $( \cdot ) _ { - } = \operatorname* { m i n } ( \cdot , 0 )$ . The gradient can be computed separately according to whether its value
|
| 220 |
+
137 is negative or not. To the authors’ understanding, sign function is already taken care in the ex
|
| 221 |
+
138 plained manner by TensorFlow [1], and thus $t f . m a t h . s i g n ( )$ can be simply used without the manual
|
| 222 |
+
139 implementation of the conditional statement.
|
| 223 |
+
|
| 224 |
+
# 3.3 Sparsity Regularizer
|
| 225 |
+
|
| 226 |
+
141 In the proposed approach, an objective function is written as
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
\mathcal { L } \left( D , W , a \right) + \lambda \mathcal { R } \left( a \right) ,
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
142 where $a$ denotes the vector of architecture parameters. Sparsifying $a$ is equivalent to sparsifying a
|
| 233 |
+
143 deep neural network. Therefore, we can use the regularization term on $a$ to encourage the sparsity of
|
| 234 |
+
144 $a$ . The proposed method is not limited to a particular norm and we can drive different sparsity patterns
|
| 235 |
+
145 depending on the types of norms. For example, the most popular choice for parameter selection is
|
| 236 |
+
146 $l _ { 1 }$ -norm, but it is unsuitable on $a$ in Eq. (11) as it is normalized using the softmax. Its $l _ { 1 }$ -norm is
|
| 237 |
+
147 always 1, i.e., $\begin{array} { r } { \| a \| _ { 1 } = \sum _ { i = 1 } ^ { n } | a _ { i } | = 1 } \end{array}$ . Therefore, we should employ $p$ -norm with $p < 1$ :
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\mathcal { R } \left( a \right) = \left( \sum _ { i = 1 } ^ { n } \lvert a _ { i } \rvert ^ { p } \right) ^ { \frac { 1 } { p } } = \left( \sum _ { i = 1 } ^ { n } a _ { i } ^ { p } \right) ^ { \frac { 1 } { p } } ,
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
148 where the second equality holds as $a _ { i }$ is always non-negative. To the authors’ best knowledge, a closed
|
| 244 |
+
149 form solution for the proximal operator of $p$ -norm with $p < 1$ is unknown, but the regularization term
|
| 245 |
+
150 is differentiable almost everywhere as relu is. Thus, the proposed approach can directly optimize the
|
| 246 |
+
151 regularized objective function and zero-out components with the stochastic gradient descent.
|
| 247 |
+
152 By simply switching one norm to another one for a regularizer, different sparsity patterns can be
|
| 248 |
+
153 derived. For example, an individual component can be removed with $l _ { 1 }$ -norm (Eq. 2) and a group of
|
| 249 |
+
154 components or an entire module can be zeroed-out with $l _ { 2 , 1 }$ -norm (Eq. 4). Note that we do not need
|
| 250 |
+
155 to manually implement different updating rules as in the proximal gradient approach. We just need to
|
| 251 |
+
156 rewrite a regularization term in the objective function. Examples codes and experiment results are
|
| 252 |
+
157 shown in the supplementary material.
|
| 253 |
+
|
| 254 |
+
If $\gamma _ { i }$ Eq. (10) or $\alpha _ { i }$ in Eq. (12) is less than the threshold, the gradient will be zero, and it will not receive learning signals. However, note that it does not necessarily mean that a component dies permanently once its importance score is less than the threshold. The component still has a chance to recover because the threshold is adjustable and the importance scores of other components may decrease. Nevertheless, to ensure that the architecture parameters of dropped components continuously receive learning signals, we propose approximating the gradient of the thresholding function. As in [31] where the gradient of a step function was approximated using that of leaky relu or soft plus, we suggest employing elu [4] as a variant of the proposed method: relu is used in the forward pass, but elu is used in the backward pass.
|
| 255 |
+
|
| 256 |
+
168 This heuristic approach leads to a similar learning mechanism proposed in [30], where the gradient
|
| 257 |
+
169 flows to dropped (or zeroed out) edges but does not flow through these dropped edges. The architecture
|
| 258 |
+
170 parameters in our proposed method correspond to the edges in [30]. Note that our approach can
|
| 259 |
+
171 be easily implemented, and it does not require additional codes to control the gradient flow. The
|
| 260 |
+
172 implementation codes are shown in the appendix.
|
| 261 |
+
|
| 262 |
+
# 173 4 Application and Experiment
|
| 263 |
+
|
| 264 |
+
174 In this section, we show that the proposed approach can be applied to reduce the size of a network as
|
| 265 |
+
175 well as to learn the structure. Our aim is not to achieve state-of-the-art performance but to validate the
|
| 266 |
+
176 idea and the broad applicability of the proposed approach. In order to show the broad applicability
|
| 267 |
+
177 with limited computing resources, we perform experiments with relative small datasets such as
|
| 268 |
+
178 CIFAR-10/100 [13]. Our implementations closely follow those of baseline models, including model
|
| 269 |
+
179 structures and hyper-parameter settings.
|
| 270 |
+
|
| 271 |
+
# 180 4.1 Channel Pruning in Convolutional Network
|
| 272 |
+
|
| 273 |
+
Table 1: Performance on CIFAR-10, DenseNet-100-BC-K12
|
| 274 |
+
|
| 275 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Sparsity(%)</td><td colspan="2">Top-1 Error(%)</td><td colspan="2">Parmas</td><td colspan="2">FLOPs</td></tr><tr><td>Avg.</td><td>Std.</td><td>Avg.</td><td>Std.</td><td>Avg.</td><td>Std.</td><td>Avg.</td><td>Std.</td></tr><tr><td>Base</td><td>00.0</td><td>0.0</td><td>5.44</td><td>0.11</td><td>7.6×105</td><td>0.0</td><td>5.8×108</td><td>0.0</td></tr><tr><td>NS</td><td>70.0</td><td>0.0</td><td>6.53</td><td>0.19</td><td>2.9×105</td><td>9.3×10²</td><td>1.9×108</td><td>5.0×106</td></tr><tr><td>NS</td><td>80.0</td><td>0.0</td><td>8.39</td><td>0.28</td><td>2.0×105</td><td>2.0×103</td><td>1.4 × 108</td><td>3.4×106</td></tr><tr><td>DS</td><td>70.3</td><td>0.1</td><td>5.77</td><td>0.09</td><td>2.7×105</td><td>2.3×10</td><td>1.8×108</td><td>1.6 ×106</td></tr><tr><td>DS</td><td>80.4</td><td>0.1</td><td>6.64</td><td>0.11</td><td>1.7 × 105</td><td>0.6×103</td><td>1.3×108</td><td>2.0×106</td></tr></table>
|
| 276 |
+
|
| 277 |
+
181 Network-slimming(NS) [20] prunes unimportant channels in convolutional layers by leveraging the 182 scaling factors in batch normalization. Let $x _ { i }$ and $y _ { i }$ be the input and output of batch normalization 183 for channel $i$ and then the operation can be written as
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
\tilde { x } _ { i } = \frac { x _ { i } - \mu _ { i } } { \sqrt { \sigma _ { i } ^ { 2 } + \epsilon } } ; y _ { i } = a _ { i } \tilde { x } _ { i } + b _ { i } ,
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
184 where $\mu _ { i }$ and $\sigma _ { i }$ denotes the mean and standard deviation of input activations, $a$ and $b$ are scale
|
| 284 |
+
185 and shift parameters, $\epsilon$ is a small constant for numerical stability. The scaling parameter $a$ can be
|
| 285 |
+
186 considered as an importance score or an architecture parameter, and the affine transformation can be
|
| 286 |
+
187 re-written as
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
y _ { i } = a \left( \tilde { x } _ { i } + b _ { i } \right) .
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
188 By pushing $a _ { i }$ to be zero, a corresponding channel can be removed. Network-slimming trains an
|
| 293 |
+
189 initial network with $l _ { 1 }$ -regularization on $a$ to identify insignificant channels. After the training,
|
| 294 |
+
190 channels with small values of $a$ are pruned. To compensate the damage caused by pruning, a pruned
|
| 295 |
+
191 network is fine-tuned. In our approach, we parameterize the scaling parameter using Eq. (12) and train
|
| 296 |
+
192 a network with $l _ { 1 }$ -norm on $a$ using the stochastic gradient descent without pruning and fine-tuning.
|
| 297 |
+
193 We perform comparison experiments on CIFAR-10/100 [13]. The training and test sets contain
|
| 298 |
+
194 $5 0 , 0 0 0$ and 10, 000 samples respectively, and the final test error is reported at the end of training or
|
| 299 |
+
195 fine-tuning on all training images. We adopt a standard data augmentation scheme (random shifting
|
| 300 |
+
196 and flipping) as in [7, 8]. In network-slimming, $\lambda$ in Eq. 13 is fixed to $1 0 ^ { - 5 }$ , but in our approach
|
| 301 |
+
197 we vary its value to induce different level of sparsity. DenseNet-BC-K12 with 100 layers [10] and
|
| 302 |
+
198 ResNet with 164 layers [7, 8] are employed as base networks. In network-slimming, pre-trained
|
| 303 |
+
199 models are obtained by training networks for 160 epochs with the initial learning of 0.1. The learning
|
| 304 |
+
200 rate is divided by 10 at $5 0 \%$ and $7 5 \%$ of the total number of training epochs. After the training,
|
| 305 |
+
201 channels with small values of $a$ are pruned and a slimmed network is fine-turned for another 160
|
| 306 |
+
202 epochs with the same setting as in the initial training, but learned weights are not re-initialized. In our
|
| 307 |
+
203 approach, we train networks for 320 epochs without fine-tuning or re-training. Network-slimming
|
| 308 |
+
204 initializes the scaling factor to be 0.5 and we set $\alpha = 0 . 5 ( n + \bar { 1 } ) / n$ and $\beta = \log \left( n ^ { 2 } + n - 1 \right)$ in
|
| 309 |
+
205 Eq. 12 so that $a$ starts with 0.5.
|
| 310 |
+
|
| 311 |
+
Table 1 shows experiment results on CIFAR-10 with DenseNet. More experiments, including ResNet and CIFAR-100, are given in the supplementary materials due to page limitation. The authors strongly urge readers to see the supplementary materials. We ran each experiments 5 times and showed the 9 average and the standard deviation. Our proposed method is denoted by Differentiable Sparsification (DS). We controlled the value of $\lambda$ such that similar pruning rate with that of the network-slimming approach. In the tables, sparsity denotes the number of removed channels in hidden layers. The experiments show that the proposed differentiable approach more effectively learns slimed models.
|
| 312 |
+
|
| 313 |
+
# 213 4.2 Discovering Neural Wirings
|
| 314 |
+
|
| 315 |
+
Table 2: Performance on CIFAR-10, Discovering Neural Wirings
|
| 316 |
+
|
| 317 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Top-1 Error(%)</td><td colspan="2">Parmas</td><td colspan="2">Mult-Adds</td></tr><tr><td>Avg.</td><td>Std.</td><td>Avg.</td><td>Std.</td><td>Avg.</td><td>Std.</td></tr><tr><td>MobileNetV1(×0.25)</td><td>13.44</td><td>0.24</td><td>2.2 × 105</td><td>0.0</td><td>3.3× 106</td><td>0.0</td></tr><tr><td>No Update(×0.225)</td><td>13.86</td><td>0.27</td><td>2.2×105</td><td>3.7×101</td><td>4.5×106</td><td>3.7×104</td></tr><tr><td>DNW(×0.225)</td><td>10.30</td><td>0.20</td><td>1.8×105</td><td>6.7×101</td><td>3.1 × 106</td><td>4.6×104</td></tr><tr><td>PG-l1-norm</td><td>12.17</td><td>0.44</td><td>2.1×104</td><td>9.4×10²</td><td>3.3× 106</td><td>1.7× 105</td></tr><tr><td>PG-l1,2-norm</td><td>13.62</td><td>0.56</td><td>9.6×104</td><td>1.6 ×104</td><td>3.4 ×106</td><td>8.6×104</td></tr><tr><td>DS-No Rectified Grad.</td><td>10.55</td><td>0.23</td><td>6.1×104</td><td>5.7×10²</td><td>3.4×106</td><td>4.5×104</td></tr><tr><td>DS-Rectified Grad.</td><td>9.36</td><td>0.27</td><td>4.7×104</td><td>8.4×10²</td><td>3.3× 106</td><td>6.7×104</td></tr></table>
|
| 318 |
+
|
| 319 |
+
214 Discovering Neural Wirings(DNW) [30] relaxes the notion of layers and treats channels as nodes 215 in a neural graph. By allowing channels to learn connections between them, it jointly discovers the 216 structure and learns the parameters of a neural network. An input to node $v$ , $\mathbf { x } _ { v }$ , is expressed
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
\mathbf { y } _ { v } = \sum _ { ( u , v ) \in \mathcal E } w _ { u , v } \mathbf { x } _ { u } ,
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
217 where $\mathbf { X } _ { u }$ denotes the state of a proceeding node, $\mathcal { E }$ represents a edge set and $w _ { u , v }$ is a connection
|
| 326 |
+
218 weight of an edge. The structure of a neural graph can be determined by choosing a subset of edges.
|
| 327 |
+
219 At each iteration of training, DNW chooses the top $k$ edges with the highest magnitude, which is
|
| 328 |
+
220 called a real edge set, and refers to the remaining edges as a hallucinated edge set. On the forwards
|
| 329 |
+
221 pass or at inference time, real edges are only used. As DNW allows the magnitude of the weights
|
| 330 |
+
222 in both sets to change throughout training, a hallucinated edge may replace a real edge when it
|
| 331 |
+
223 strengthens enough. The weights of real edges are updated in an ordinary manner with the stochastic
|
| 332 |
+
224 gradient descent, but those of hallucinated edges are updated by a specialized leaning rule: the
|
| 333 |
+
225 gradient flows to hallucinated edges but does not flow through them.
|
| 334 |
+
226 The architecture parameters in our proposed method correspond to the edges in DNW. We parame
|
| 335 |
+
227 terize the edges using Eq. (12) and train a network with $l _ { 1 }$ -norm on edges to induce sparsity. The
|
| 336 |
+
228 rectified gradient leads to an update rule which is similar to that of DNW: the rectified gradient
|
| 337 |
+
229 ensures that dropped architecture parameters continuously receive learning signals by approximating
|
| 338 |
+
230 the gradient of the thresholding function. However, we do not need to keep track of the real and
|
| 339 |
+
231 hallucinated edge sets. We simply optimize the objective function with approximated gradients. The
|
| 340 |
+
232 rectified gradient can be implemented in a couple of lines using modern deep learning tools and the
|
| 341 |
+
233 code is shown in the supplementary material.
|
| 342 |
+
234 We perform experiments on CIFAR-10/100 [13]. The final test error is reported at the end of training
|
| 343 |
+
235 without using separate validation data set. MobileNetV1 $( \times 0 . 2 5 )$ [9] is employed as a base model
|
| 344 |
+
236 and our implementation closely follows that of DNW. We train for 160 epochs with initial learning
|
| 345 |
+
237 rate 0.1. The learning rate is scheduled using Cosine Annealing. DNW chose the value of $k$ such that
|
| 346 |
+
238 a final learned model has similar Mult-Adds with the base model, and we also set the value of $\lambda$ in
|
| 347 |
+
239 the same manner.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 1: Left: Structure of a GCN block. Each block consists of a shared adjacency, an input feature, and a weight matrix. Each row and column of an adjacent matrix are treated as groups to enable the learning of relationship between a node (indexed by $i$ ) and its neighbors. Right: Row grouping creates the competition between in-coming nodes, and column grouping creates the competition between out-going nodes.
|
| 351 |
+
|
| 352 |
+
Table 2 shows experiment results on CIFAR-10. We ran each experiments 5 times and showed the average and the standard deviation. Our proposed method is denoted by DS. DNW without the update rule corresponds to DS without the rectified gradient method. Even without the rectified gradient, the performance of the proposed method is close to that of DNW with the update rule. It validates the effectiveness of our approach. We also performed experiments with the proximal gradients of Eq.(3) and Eq.(7), which is denoted by PG in Table 2. PG-l1-norm also uses the $l _ { 1 }$ -norm as a regularizer, but the learning is not as effective as ours. Similarly, $\mathrm { P G } \mathrm { - } l _ { 1 , 2 }$ -norm uses the update rule of Eq.(7) whose shape is similar to our sparse parameterization Eq. (12), but the performance is worse than ours. More experiments, including CIFAR-100, are given in the supplementary materials due to page limitation.
|
| 353 |
+
|
| 354 |
+
DNW determines the size and the structure of a network by choosing $k$ edges. However, there is no clear notion how to choose $k$ for different stages (or blocks) and thus it uses the same pruning rate for all stages, which may be restrict because each stage may play a different role and need a different amount of resources. In contrast, our approach controls the model complexity by adjusting the value of $\lambda$ in the objective function, and a different amount of resources is allocated for each stage through training. As shown in Table 2, the proposed method uses model parameters more efficiently.
|
| 355 |
+
|
| 356 |
+
# 4.3 Learning relationship between Nodes in Graph
|
| 357 |
+
|
| 358 |
+
In this section, we applied the proposed approach to learn the structure of an adjacency matrix in a graph convolutional network (GCN). The purpose of this case study is to test whether our approach can learn semantic structure from data rather than reducing the size of a neural network.
|
| 359 |
+
|
| 360 |
+
260 We adopted the model of [11], one of the most successful GCN models. A GCN block or a layer is
|
| 361 |
+
261 defined (see Fig. 1) as
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
H ^ { l + 1 } = F \left( A H ^ { l } W ^ { l } \right) ,
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
262 where $A$ is an adjacency matrix; $H ^ { l }$ and $W ^ { l }$ are an input feature and a weight matrix for layer $l$ ,
|
| 368 |
+
263 respectively; and $F$ is a nonlinear activation function. In general, $A$ is non-negative and shared
|
| 369 |
+
264 across GCN blocks. It is obtained by normalization. For example, $A = \tilde { D } ^ { - 1 } \tilde { A }$ or $\overset { \mathbf { \tilde { \lambda } } } { A } = \overset { \mathbf { \tilde { \mu } } } { D } ^ { - \frac { 1 } { 2 } } \overset { \mathbf { \tilde { \lambda } } } { A } \overset { \mathbf { \tilde { \mu } } } { D } ^ { - \frac { 1 } { 2 } }$ ,
|
| 370 |
+
265 where $\tilde { A }$ is an unnormalized adjacency matrix; and $\tilde { D }$ is a diagonal matrix, where $\begin{array} { r } { \tilde { D } _ { i } = \sum _ { j } \tilde { A } _ { i , j } } \end{array}$ .
|
| 371 |
+
266 The adjacency matrix represents the connections or relationships between nodes on a graph and is
|
| 372 |
+
267 usually given by prior knowledge. Learning the value of $A _ { i , j }$ amounts to determining the relationship
|
| 373 |
+
268 between nodes $i$ and $j$ . If the value of $A _ { i , j }$ is zero, it can be considered that the two nodes are
|
| 374 |
+
269 unrelated.
|
| 375 |
+
270 As shown in Fig. 1, we defined each row and column as a group. Row grouping creates the competition
|
| 376 |
+
271 between in-coming nodes, whereas column grouping creates the competition between out-going
|
| 377 |
+
272 nodes. Each row and column of unnormalized adjacency matrix $\tilde { A }$ can be parameterized similarly as
|
| 378 |
+
273 in $\tilde { \gamma }$ of in Eq. (10):
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 2: The gray lines represent 170 road links where the experimental data were collected.
|
| 382 |
+
|
| 383 |
+
274
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { c } { \gamma _ { i , j } = \exp \left( \alpha _ { i , j } \right) } \\ { \tilde { A } _ { i , j } = \left( \gamma _ { i , j } - \sigma \left( \beta _ { i } ^ { r } \right) \cdot \left. \gamma _ { i , : } \right. _ { 1 } - \sigma \left( \beta _ { j } ^ { c } \right) \cdot \left. \gamma _ { : , j } \right. _ { 1 } \right) _ { + } . } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
275 The softmax normalization of Eq. (11) is replaced with Sinkhorn normalization [23, 24, 12] to make
|
| 390 |
+
276 $A$ is doubly-stochastic: each row and column sum up to 1. Initializing $A$ with $\tilde { A }$ , we can convert $\tilde { A }$
|
| 391 |
+
277 into a doubly stochastic matrix by iteratively applying the following equations:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
A = D _ { r } ^ { - 1 } A { \mathrm { a n d } } A = A D _ { c } ^ { - 1 } ,
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
where 278 $D _ { r }$ and $D _ { c }$ are diagonal matrices; $\begin{array} { r } { [ D _ { r } ] _ { i } = \sum _ { j } A _ { i , j } } \end{array}$ ; $\begin{array} { r } { \left[ D _ { c } \right] _ { j } = \sum _ { i } A _ { i , j } } \end{array}$ . Note that although the 279 normalization is iterative, it is differentiable. Balanced normalization is also possible by iteratively 280 applying
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
A = D _ { r } ^ { - { \frac { 1 } { 2 } } } A D _ { c } ^ { - { \frac { 1 } { 2 } } } .
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
281 We verified through numerical experiments that iteratively applying the above equation also makes $\tilde { A }$
|
| 404 |
+
282 to doubly stochastic, but we could not find a theoretical justification. We leave the mathematical proof
|
| 405 |
+
283 as an open question for a future work. As competition groups are created in row- and column-wise
|
| 406 |
+
284 approaches, a regularized objective function can be written as
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\mathcal { L } \left( D , W , A \right) + \frac { \lambda } { 2 } \sum _ { i = 1 } ^ { N } \left\{ \mathcal { R } \left( A _ { i , : } \right) + \mathcal { R } \left( A _ { : , i } \right) \right\} ,
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
where 285 $W = \{ W ^ { l } \}$ , $N$ is the size of square matrix $A$ , and $A _ { i , }$ : and $A _ { : , i }$ denote ith row and column 286 vector of $A$ , respectively. We employ $l _ { p }$ -norm of Eq. (14) with $p = 0 . 5$ for a regularizer.
|
| 413 |
+
|
| 414 |
+
287 To validate our purposed method, we applied a GCN to estimate future traffic speeds in a road network.
|
| 415 |
+
288 The traffic speed data were collected from 170 road segments.Thus, the sizes of an adjacent matrix is
|
| 416 |
+
289 $1 7 0 \times 1 7 0$ . The map of the data area collected is shown in 2. One-step ahead observation is estimated
|
| 417 |
+
290 from eight past observations and an output layer generates 170 estimates, one for each road segment.
|
| 418 |
+
291 A prediction loss is measured using the mean relative error (MRE). More detailed specifications of
|
| 419 |
+
292 the experimental data and our GCN model can be found in the supplementary material. A prediction
|
| 420 |
+
293 loss is measured using the mean relative error (MRE).
|
| 421 |
+
294 Three baseline models were used: two were given the road connectivity and the other was not. For
|
| 422 |
+
295 the first baseline, we set the value of $A _ { i , j }$ as a constant such that $\begin{array} { r } { A _ { i , j } = \frac { 1 } { n _ { i } } } \end{array}$ if node (or road) $i$ and $j$
|
| 423 |
+
296 are adjacent to each other $\mathbf { \chi } _ { n _ { i } }$ is the number of neighbors of node $i$ ), and $\mathbf { \nabla } _ { A _ { i , j } } = 0$ otherwise. The
|
| 424 |
+
297 second baseline was taken in a similar approach, but we set $\tilde { A } _ { i , j } = \exp \left( \alpha _ { i , j } \right)$ if node $i$ and $j$ were
|
| 425 |
+
298 adjacent to each other to ensure that the strengths of the connections were learned. For the third
|
| 426 |
+
299 baseline, the connectivity was not given. However, we set $\tilde { A } _ { i , j } = \exp \left( \alpha _ { i , j } \right)$ for all $i , j$ regardless of
|
| 427 |
+
300 the actual connections. For the proposed method, we parameterized the adjacency matrix as in the
|
| 428 |
+
301 third baseline but applied the sparsification technique. The balanced normalization was applied to all
|
| 429 |
+
302 cases except the first baseline, for which the row sum is 1.
|
| 430 |
+
|
| 431 |
+
303 To measure the learned relationship between nodes, we propose the following scoring function:
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\frac { 1 } { 2 N } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \left[ \left( A ^ { r } + A ^ { c } \right) \odot M ^ { k } \right] _ { i , j } ,
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
304 where $A ^ { r } = D _ { r } ^ { - 1 } A$ , $A ^ { c } = A D _ { c } ^ { - 1 }$ , $\odot$ denotes the element-wise product, and $[ M ^ { k } ] _ { i , j } = 1$ if the
|
| 438 |
+
305 geodesic distance between node $i$ and $j$ is less than or equal to $k$ , whereas $[ M ^ { k } ] _ { i , j } = 0$ otherwise.
|
| 439 |
+
306 The maximum value is 1, and the minimum is 0. For example, the first and second baselines always
|
| 440 |
+
307 have the maximum value because their adjacency matrices have exactly the same structure of $\dot { M } ^ { 1 }$ .
|
| 441 |
+
308 We calculated the scores for $k = 1$ and 2. Note that we used $A ^ { r }$ and $A ^ { c }$ instead of $A$ because a
|
| 442 |
+
309 sparsified matrix is not guaranteed to be doubly stochastic even if the original Sinkhorn normalization
|
| 443 |
+
310 is adopted.
|
| 444 |
+
311 The performance of the baseline models is shown in Table 4a. We ran each experiment five times and
|
| 445 |
+
312 selected the median among the five lowest validation errors. For the first and second baselines, the
|
| 446 |
+
313 road connectivity is given, and the number of non-zero elements of the adjacent matrices is 878. Note
|
| 447 |
+
314 that the value of the learned relationship for Baselines I and II is constant, but we show it for reference.
|
| 448 |
+
315 The road connectivity is not given for the third baseline, and the number of non-zero elements of
|
| 449 |
+
316 the adjacent matrix is 28, $9 0 0 ( = 1 7 0 \times 1 7 0 )$ . The performance of the proposed model is shown in
|
| 450 |
+
317 Table 4b. The experiment of Baseline III shows that a GCN finds a nonlinear mapping between input
|
| 451 |
+
318 and target values simply in the way of reducing the prediction loss without learning the semantic
|
| 452 |
+
319 relationships between nodes, but the proposed approach finds actual relationships between nodes. We
|
| 453 |
+
320 further compared the proposed method with the proximal gradient method. The experimental results
|
| 454 |
+
321 are reported in the supplementary material due to page limitation.
|
| 455 |
+
|
| 456 |
+
Table 3: Traffic speed prediction with GCN
|
| 457 |
+
|
| 458 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">#N.Z.</td><td rowspan="2">MAPE(%)</td><td colspan="2">L.R.(×100)</td></tr><tr><td>k=1</td><td>k=2</td></tr><tr><td>I</td><td>878</td><td>5.6623</td><td>100.00</td><td>100.00</td></tr><tr><td>I</td><td>878</td><td>5.5160</td><td>100.00</td><td>100.00</td></tr><tr><td>Ⅲ</td><td>28.900</td><td>5.6343</td><td>13.76</td><td>20.87</td></tr></table>
|
| 459 |
+
|
| 460 |
+
(a) Baseline models
|
| 461 |
+
|
| 462 |
+
<table><tr><td rowspan="2">入</td><td rowspan="2">#N.Z.</td><td rowspan="2">MAPE(%)</td><td colspan="2">L.R.(×100)</td></tr><tr><td>k=1</td><td>k=2</td></tr><tr><td>0.050</td><td>1,220</td><td>5.4744</td><td>87.06</td><td>89.94</td></tr><tr><td>0.075</td><td>1,009</td><td>5.4957</td><td>88.62</td><td>91.39</td></tr><tr><td>0.100</td><td>835</td><td>5.5336</td><td>89.79</td><td>92.13</td></tr></table>
|
| 463 |
+
|
| 464 |
+
(b) Proposed method
|
| 465 |
+
|
| 466 |
+
# 322 5 Scope and Limitation
|
| 467 |
+
|
| 468 |
+
323 Our aim is not to achieve state-of-the-art performance but to validate the idea and the broad applicabil
|
| 469 |
+
324 ity of the proposed approach. To the authors’ best knowledge, it is the first fully [sub-]differentiable
|
| 470 |
+
325 sparsification method that zeroes out components, and we wish our work would provide a foundation
|
| 471 |
+
326 for future structure learning and model compression methods. The limitation of our approach is that
|
| 472 |
+
327 a sparsity rate cannot be explicitly specified before training as in conventional pruning approaches. If
|
| 473 |
+
328 a specific sparsity rate is required, it should be obtained by a try-and-error. The rectified gradient is
|
| 474 |
+
329 effective as shown in the experiments of discovering neural wirings, but it is not clear in which cases
|
| 475 |
+
330 it is effective or not. We need more theoretical analysis and leave it for a future work.
|
| 476 |
+
|
| 477 |
+
# 331 6 Conclusion
|
| 478 |
+
|
| 479 |
+
332 In this study, we proposed a fully differentiable sparsification method that can simultaneously learn
|
| 480 |
+
333 the sparsified structure and weights of deep neural networks. Our proposed method is versatile in that
|
| 481 |
+
334 it can be seamlessly integrated into different types of neural networks and various problems.
|
| 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 the scope and limitation section.
|
| 487 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 488 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [N/A]
|
| 489 |
+
|
| 490 |
+
2. If you are including theoretical results...
|
| 491 |
+
|
| 492 |
+
(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]
|
| 493 |
+
|
| 494 |
+
3. If you ran experiments...
|
| 495 |
+
|
| 496 |
+
(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] Main Codes are included in the supplemental material and a snippet is also given in the appendix(pdf supplemental material)
|
| 497 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 498 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We ran each experiment five times and gave the mean and the standard deviation.
|
| 499 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] However, readers may easily estimate required resources because we used well-known data and models in most experiments.
|
| 500 |
+
|
| 501 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 502 |
+
|
| 503 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 504 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 505 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 506 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 507 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 508 |
+
|
| 509 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 510 |
+
|
| 511 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 512 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 513 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
| 514 |
+
|
| 515 |
+
# 377 References
|
| 516 |
+
|
| 517 |
+
[1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Largescale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow. org/. Software available from tensorflow.org.
|
| 518 |
+
|
| 519 |
+
[2] Karim Ahmed and Lorenzo Torresani. Connectivity learning in multi-branch networks. CoRR, abs/1709.09582, 2017. URL http://arxiv.org/abs/1709.09582. [3] Jose M. Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In NIPS, 2016. [4] Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). In ICLR, 2016. [5] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In ICLR, 2019. [6] Babak Hassibi, David G. Stork, and Gregory J . Wolff. Optimal brain surgeon and general network pruning. In ICNN, 1993. [7] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016. [9] Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. CoRR, abs/1704.04861, 2017. URL https://arxiv. org/abs/1704.04861. [10] Gao Huang, Zhuang Liu, and Laurens van der Maaten. Densely connected convolutional networks. In CVPR, 2017.
|
| 520 |
+
07 [11] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 521 |
+
09 [12] P. A. Knight. The sinkhorn-knopp algorithm: convergence and applications. SIAM Journal on Matrix Analysis and Applications, 30(1), 2008. [13] Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical Report, 2009.
|
| 522 |
+
13 [14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [15] Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. In ICLR, 2017. [16] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural Computation, 1(4): 541–551, Dec 1989. ISSN 0899-7667. doi: 10.1162/neco.1989.1.4.541.
|
| 523 |
+
420 [17] Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In NIPS, 1989.
|
| 524 |
+
21 [18] Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. In ICLR, 2019.
|
| 525 |
+
23 [19] Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In ICCV, 2017.
|
| 526 |
+
425 [20] Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. In ICLR, 2019.
|
| 527 |
+
27 [21] Neal Parikh and Stephen Boyd. Proximal algorithms. Found. Trends Optim., 1(3):127–239, January 2014. ISSN 2167-3888. doi: 10.1561/2400000003. URL http://dx.doi.org/10. 1561/2400000003.
|
| 528 |
+
30 [22] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 529 |
+
[23] R. Sinkhorn. A relationship between arbitrary positive matrices and doubly stochastic matrices. The annals of mathematicalstatistics, 35(2):876–879, 1964.
|
| 530 |
+
[24] R. Sinkhorn and P. Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2), 1967.
|
| 531 |
+
[25] Huizi Mao Song Han and William J. Dally. Deep compression: Compressing deep neural network with pruning, trained quantization and huffman coding. In ICLR, 2016.
|
| 532 |
+
[26] John Tran Song Han, Jeff Pool and William Dally. Learning both weights and connections for efficient neural network. In NIPS, 2015.
|
| 533 |
+
[27] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, 2016.
|
| 534 |
+
[28] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), 58(1):267–288, 1996.
|
| 535 |
+
[29] Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In NIPS, 2016.
|
| 536 |
+
[30] Mitchell Wortsman, Ali Farhadi, and Mohammad Rastegari. Discovering neural wirings. In NeurIPS, 2019.
|
| 537 |
+
[31] Xia Xiao, Zigeng Wang, and Sanguthevar Rajasekaran. Autoprune: Automatic network pruning by regularizing auxiliary parameters. In NeurIPS, 2019.
|
| 538 |
+
[32] Saining Xie, Ross Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In CVPR, 2017.
|
| 539 |
+
[33] Jaehong Yoon and Sung Ju Hwang. Combined group and exclusive sparsity for deep neural networks. In ICML, 2017.
|
| 540 |
+
[34] Yang Zhou, Rong Jin, and Steven Chu–Hong Hoi. Exclusive lasso for multi-task feature selection. In AISTATS, 2010.
|
md/train/cVwc7IHWEWi/cVwc7IHWEWi.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Near-Optimal No-Regret Learning in General Games
|
| 2 |
+
|
| 3 |
+
Constantinos Daskalakis MIT CSAIL costis@csail.mit.edu
|
| 4 |
+
|
| 5 |
+
Maxwell Fishelson MIT CSAIL maxfish@mit.edu
|
| 6 |
+
|
| 7 |
+
Noah Golowich MIT CSAIL nzg@mit.edu
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
We show that Optimistic Hedge – a common variant of multiplicative-weightsupdates with recency bias – attains poly $( \log T )$ regret in multi-player general-sum games. In particular, when every player of the game uses Optimistic Hedge to iteratively update her strategy in response to the history of play so far, then after $T$ rounds of interaction, each player experiences total regret that is poly $( \log T )$ . Our bound improves, exponentially, the $O ( T ^ { 1 / 2 } )$ regret attainable by standard no-regret learners in games, the $O ( T ^ { 1 / 4 } )$ regret attainable by no-regret learners with recency bias [SALS15], and the $O ( T ^ { 1 / 6 } )$ bound that was recently shown for Optimistic Hedge in the special case of two-player games [CP20]. A corollary of our bound is that Optimistic Hedge converges to coarse correlated equilibrium in general games at a rate of ${ \tilde { O } } \left( { \scriptstyle { \frac { 1 } { T } } } \right)$ .
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Online learning has a long history that is intimately related to the development of game theory, convex optimization, and machine learning. One of its earliest instantiations can be traced to Brown’s proposal [Bro49] of fictitious play as a method to solve two-player zero-sum games. Indeed, as shown by [Rob51], when the players of (zero-sum) matrix game use fictitious play to iteratively update their actions in response to each other’s history of play, the resulting dynamics converge in the following sense: the product of the empirical distributions of strategies for each player converges to the set of Nash equilibria in the game, though the rate of convergence is now known to be exponentially slow [DP14]. Moreover, such convergence to Nash equilibria fails in non-zero-sum games [Sha64].
|
| 16 |
+
|
| 17 |
+
The slow convergence of fictitious play to Nash equilibria in zero-sum matrix games and nonconvergence in general-sum games can be mitigated by appealing to the pioneering works [Bla54, Han57] and the ensuing literature on no-regret learning [CBL06]. It is known that if both players of a zero-sum matrix game experience regret that is at most $\varepsilon ( T )$ , the product of the players’ empirical distributions of strategies is an $O ( \varepsilon ( \bar { T } ) / T )$ -approximate Nash equilibrium. More generally, if each player of a general-sum, multi-player game experiences regret that is at most $\varepsilon ( T )$ , the empirical distribution of joint strategies converges to a coarse correlated equilibrium1 of the game, at a rate of $O ( \varepsilon ( T ) / T )$ . Importantly, a multitude of online learning algorithms, such as the celebrated Hedge and Follow-The-Perturbed-Leader algorithms, guarantee adversarial regret $O ( \sqrt { T } )$ [CBL06]. Thus, when such algorithms are employed by all players in a game, their $O ( \sqrt { T } )$ regret implies convergence to coarse correlated equilibria (and Nash equilibria of matrix games) at a rate of $O ( 1 / \sqrt { T } )$ .
|
| 18 |
+
|
| 19 |
+
While standard no-regret learners guarantee $O ( \sqrt { T } )$ regret for each player in a game, the players can do better by employing specialized no-regret learning procedures. Indeed, it was established by [DDK11] that there exists a somewhat complex no-regret learner based on Nesterov’s excessive gap technique [Nes05], which guarantees ${ \cal O } ( \log T )$ regret to each player of a two-player zero-sum game.
|
| 20 |
+
|
| 21 |
+
Table 1: Overview of prior work on fast rates for learning in games. $m$ denotes the number of players, and $n$ denotes the number of actions per player (assumed to be the same for all players). For Optimistic Hedge, the adversarial regret bounds in the right-hand column are obtained via a choice of adaptive step-sizes. The ${ \tilde { O } } ( \cdot )$ notation hides factors that are polynomial in $\log T$ .
|
| 22 |
+
|
| 23 |
+
<table><tr><td>Algorithm</td><td>Setting</td><td>Regret in games</td><td>Adversarial regret</td></tr><tr><td>Hedge (& many other algs.)</td><td>multi-player, general-sum</td><td>O(√Tlog n) [CBL06]</td><td>O(√Tlog n) [CBL06]</td></tr><tr><td>Excessive Gap Technique</td><td>2-player, 0-sum</td><td>O(1og n(logT + 10g3/2 n)) [DDK11]</td><td>O(√Tlog n) [DDK11]</td></tr><tr><td>DS-OptMD, OptDA</td><td>2-player, 0-sum</td><td>l0g0(1)(n) [HAM21]</td><td>√T l0go(1)(n) [HAM21]</td></tr><tr><td>Optimistic Hedge</td><td>multi-player, general-sum</td><td>O(log n · √m T1/4) [RS13b, SALS15]</td><td>0(√Tlogn) [RS13b, SALS15]</td></tr><tr><td>Optimistic Hedge</td><td>2-player, general-sum</td><td>O(log5/6 n · T1/6) [CP20]</td><td>O(√Tlogn)</td></tr><tr><td>Optimistic Hedge</td><td>multi-player, general-sum</td><td>O(log n · m · log4 T) (Theorem 3.1)</td><td>0(√Tlogn) (Corollary D.1)</td></tr></table>
|
| 24 |
+
|
| 25 |
+
This represents an exponential improvement over the regret guaranteed by standard no-regret learners. More generally, [SALS15] established that if players of a multi-player, general-sum game use any algorithm from the family of Optimistic Mirror Descent (MD) or Optimistic Follow-the-RegularizedLeader (FTRL) algorithms (which are analogoues of the MD and FTRL algorithms, respectively, with recency bias), each player enjoys regret that is $O ( T ^ { 1 / 4 } )$ . This was recently improved by [CP20] to $O ( T ^ { 1 / 6 } )$ in the special case of two-player games in which the players use Optimistic Hedge, a particularly simple representative from both the Optimistic MD and Optimistic FTRL families.
|
| 26 |
+
|
| 27 |
+
The above results for general-sum games represent significant improvements over the $O ( \sqrt { T } )$ regret attainable by standard no-regret learners, but are not as dramatic as the logarithmic regret that has been shown attainable by no-regret learners, albeit more complex ones, in 2-player zero-sum games (e.g., [DDK11]). Indeed, despite extensive work on no-regret learning, understanding the optimal regret that can be guaranteed by no-regret learning algorithms in general-sum games has remained elusive. This question is especially intruiging in light of experiments suggesting that polylogarithmic regret should be attainable [SALS15, HAM21]. In this paper we settle this question by showing that no-regret learners can guarantee polylogarithmic regret to each player in general-sum multi-player games. Moreover, this regret is attainable by a particularly simple algorithm – Optimistic Hedge:
|
| 28 |
+
|
| 29 |
+
Theorem 1.1 (Abbreviated version of Theorem 3.1). Suppose that m players play a general-sum multi-player game, with a finite set of n strategies per player, over $T$ rounds. Suppose also that each player uses Optimistic Hedge to update her strategy in every round, as a function of the history of play so far. Then each player experiences $O ( m \cdot \log n \cdot \log ^ { 4 } T )$ regret.
|
| 30 |
+
|
| 31 |
+
An immediate corollary of Theorem 1.1 is that the empirical distribution of play is a O ⇣ m log n log4 TT ⌘ approximate coarse correlated equilibrium (CCE) of the game. We remark that Theorem 1.1 bounds the total regret experienced by each player of the multi-player game, which is the most standard regret objective for no-regret learning in games, and which is essential to achieve convergence to CCE. For the looser objective of the average of all players’ regrets, [RS13b] established a ${ \bar { O } } ( \log n )$ bound for Optimistic Hedge in two-player zero-sum games, and [SALS15] generalized this bound, to $O ( m \log n )$ in $m$ -player general-sum games. Note that since some players may experience negative regret [HAM21], the average of the players’ regrets cannot be used in general to bound the maximum regret experienced by any individual player. Finally, we remark that several results in the literature posit no-regret learning as a model of agents’ rational behavior; for instance, [Rou09, ST13, RST17] show that no-regret learners in smooth games enjoy strong Price-of-Anarchy bounds. By showing that each agent can obtain very small regret in games by playing Optimistic Hedge, Theorem 1.1 strengthens the plausability of the common assumption made in this literature that each agent will choose to use such a no-regret algorithm.
|
| 32 |
+
|
| 33 |
+
# 1.1 Related work
|
| 34 |
+
|
| 35 |
+
Table 1 summarizes the prior works that aim to establish optimal regret bounds for no-regret learners in games. We remark that [CP20] shows that the regret of Hedge is $\Omega ( { \sqrt { T } } )$ even in 2-player games where each player has 2 actions, meaning that optimism is necessary to obtain fast rates. The table also includes a recent result of [HAM21] showing that when the players in a 2-player zero-sum game with $n$ actions per player use a variant of Optimistic Hedge with adaptive step size (a special case of their algorithms DS-OptMD and OptDA), each player has $\log ^ { O ( 1 ) } { \bar { n } }$ regret. The techniques of [HAM21] differ substantially from ours: the result in [HAM21] is based on showing that the joint strategies $x ^ { ( t ) }$ rapidly converge, pointwise, to a Nash equilibrium $x ^ { \star }$ . Such a result seems very unlikely to extend to our setting of general-sum games, since finding an approximate Nash equilibrium even in 2-player games is PPAD-complete [CDT09]. We also remark that the earlier work [KHSC18] shows that each player’s regret is at most $O ( \log T \cdot \log n )$ when they use a certain algorithm based on Optimistic MD in 2-player zero-sum games; their technique is heavily tailored to 2-player zero-sum games, relying on the notion of duality in such a setting.
|
| 36 |
+
|
| 37 |
+
$[ \mathrm { F L L ^ { + } } 1 6 ]$ shows that one can obtain fast rates in games for a broader class of algorithms (e.g., including Hedge) if one adopts a relaxed (approximate) notion of optimality. [WL18] uses optimism to obtain adaptive regret bounds for bandit problems. Many recent papers (e.g., [DP19, GPD20, LGNPw21, HAM21, WLZL21, AIMM21]) have studied the last-iterate convergence of algorithms from the Optimistic Mirror Descent family, which includes Optimistic Hedge. Finally, a long line of papers (e.g., $[ \mathrm { H M c W ^ { + } } 0 3$ , $\mathrm { D F P ^ { + } 1 0 }$ , KLP11, BCM12, PP16, BP18, MPP18, BP19, CP19, $\mathrm { V G F L } ^ { + } 2 0 \bar { ] }$ ) has studied the dynamics of learning algorithms in games. Essentially all of these papers do not use optimism, and many of them show non-convergence (e.g., divergence or recurrence) of the iterates of various learning algorithms such as FTRL and Mirror Descent when used in games.
|
| 38 |
+
|
| 39 |
+
# 2 Preliminaries
|
| 40 |
+
|
| 41 |
+
Notation. For a positive integer $n$ , let $[ n ] : = \{ 1 , 2 , . . . , n \}$ . For a finite set $s$ , let $\Delta ( S )$ denote the space of distributions on $s$ . For $\mathcal { S } = [ n ]$ , we will write $\Delta ^ { n } : = \Delta ( S )$ and interpret elements of $\Delta ^ { n }$ as vectors in $\mathbb { R } ^ { n }$ . For a vector $v \in \mathbb { R } ^ { n }$ and $j \in [ n ]$ , we denote the $j$ th coordinate of $v$ as $v ( j )$ . For vectors $v , w \in \mathbb { R } ^ { n }$ , write $\begin{array} { r } { \langle v , w \rangle = \sum _ { j = 1 } ^ { n } v ( j ) w ( j ) } \end{array}$ . The base-2 logarithm of $x > 0$ is denoted $\log x$
|
| 42 |
+
|
| 43 |
+
No-regret learning in games. We consider a game $G$ with $m \in \mathbb { N }$ players, where player $i \in [ m ]$ has action space $A _ { i }$ with $n _ { i } : = | A _ { i } |$ actions. We may assume that $\mathcal { A } _ { i } = [ n _ { i } ]$ for each player $i$ . The joint action space is $\mathcal { A } : = \mathcal { A } _ { 1 } \times \dots \times \mathcal { A } _ { m }$ . The specification of the game $G$ is completed by a collection of loss functions $\mathcal { L } _ { 1 } , \ldots , \mathcal { L } _ { m } : \mathcal { A } [ 0 , 1 ]$ . For an action profile $a = ( a _ { 1 } , \ldots , a _ { m } ) \in \mathcal { A }$ and $i \in [ m ]$ , $\mathcal { L } _ { i } ( a )$ is the loss player $i$ experiences when each player $i ^ { \prime } \in [ m ]$ plays $a _ { i ^ { \prime } }$ . A mixed strategy $x _ { i } \in \Delta ( \mathcal { A } _ { i } )$ for player $i$ is a distribution over $A _ { i }$ , with the probability of playing action $j \in \mathcal A _ { i }$ given by $x _ { i } ( j )$ . Given a mixed strategy profile $\boldsymbol { x } = ( x _ { 1 } , \dots , x _ { m } )$ (or an action profile $\boldsymbol { a } = ( a _ { 1 } , \dots , a _ { m } ) )$ and a player $i \in [ m ]$ we let $x _ { - i }$ (or $a _ { - i }$ , respectively) denote the profile after removing the ith mixed strategy $x _ { i }$ (or the $i$ th action $a _ { i }$ , respectively).
|
| 44 |
+
|
| 45 |
+
The $m$ players play the game $G$ for a total of $T$ rounds. At the beginning of each round $t \in [ T ]$ , each player $i$ chooses a mixed strategy $x _ { i } ^ { ( t ) } \in \Delta ( \mathcal { A } _ { i } )$ . The loss vector of player $i$ , denoted $\ell _ { i } ^ { ( t ) } \in [ 0 , 1 ] ^ { n _ { i } }$ , is defined as $\ell _ { i } ^ { ( t ) } ( j ) = \mathbb { E } _ { a _ { - i } \sim x _ { - i } ^ { ( t ) } } [ \mathcal { L } _ { i } ( \dot { j } , a _ { - i } ) ]$ . As a matter of convention, set $\ell _ { i } ^ { ( 0 ) } = \mathbf { 0 }$ to be the all-zeros vector. We consider the full-information setting in this paper, meaning that player $i$ observes its full loss vector $\ell _ { i } ^ { ( t ) }$ for each round $t$ . Finally, player $i$ experiences a loss of $\langle \ell _ { i } ^ { ( t ) } , x _ { i } ^ { ( t ) } \rangle$ . The goal of each player $i$ is to minimize its regret, defined as: $\begin{array} { r } { \mathrm { R e g } _ { i , T } : = \sum _ { t \in [ T ] } \langle x _ { i } ^ { ( t ) } , \ell _ { i } ^ { ( t ) } \rangle - \operatorname* { m i n } _ { j \in [ n _ { i } ] } \sum _ { t \in [ T ] } \ell _ { i } ^ { ( t ) } ( j ) } \end{array}$ .
|
| 46 |
+
|
| 47 |
+
Optimistic hedge. The Optimistic Hedge algorithm chooses mixed strategies for player $i \in [ m ]$ as follows: at time $t = 1$ , it sets $x _ { i } ^ { ( 1 ) } = ( 1 / n _ { i } , \ldots , 1 / n _ { i } )$ to be the uniform distribution on $\mathbf { \mathcal { A } } _ { i }$ . Then for all $t < T$ , player $i$ ’s strategy at iteration $t + 1$ is defined as follows, for $j \in [ n _ { i } ]$ :
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
x _ { i } ^ { ( t + 1 ) } ( j ) : = \frac { x _ { i } ^ { ( t ) } ( j ) \cdot \exp ( - \eta \cdot ( 2 \ell _ { i } ^ { ( t ) } ( j ) - \ell _ { i } ^ { ( t - 1 ) } ( j ) ) ) } { \sum _ { k \in [ n _ { i } ] } x _ { i } ^ { ( t ) } ( k ) \cdot \exp ( - \eta \cdot ( 2 \ell _ { i } ^ { ( t ) } ( k ) - \ell _ { i } ^ { ( t - 1 ) } ( k ) ) ) } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Optimistic Hedge is a modification of Hedge, which performs the updates $x _ { i } ^ { ( t + 1 ) } ( j ) : =$ $\begin{array} { r l } & { \frac { x _ { i } ^ { ( t ) } ( j ) \cdot \exp ( - \eta \cdot \ell _ { i } ^ { ( t ) } ( j ) ) } { \sum _ { k \in [ n _ { i } ] } x _ { i } ^ { ( t ) } ( k ) \cdot \exp ( - \eta \cdot \ell _ { i } ^ { ( t ) } ( k ) ) } } \end{array}$ . The update (1) modifies the Hedge update by replacing the loss vector $\ell _ { i } ^ { ( t ) }$ 2 i with a predictor of the following iteration’s loss vector, $\ell _ { i } ^ { ( t ) } + ( \ell _ { i } ^ { ( t ) } - \ell _ { i } ^ { ( t - 1 ) } )$ . Hedge corresponds to FTRL with a negative entropy regularizer (see, e.g., [Bub15]), whereas Optimistic Hedge corresponds to Optimistic FTRL with a negative entropy regularizer [RS13b, RS13a].
|
| 54 |
+
|
| 55 |
+
Distributions $\pmb { \& }$ divergences. For distributions $P , Q$ on a finite domain $[ n ]$ , the $K L$ divergence between $P , Q$ is $\begin{array} { r } { \mathrm { K L } ( P ; Q ) = \sum _ { j = 1 } ^ { n } P ( j ) \cdot \log \left( \frac { P ( j ) } { Q ( j ) } \right) } \end{array}$ . The chi-squared divergence between $P , Q$ is $\begin{array} { r } { \chi ^ { 2 } ( P ; Q ) = \sum _ { j = 1 } ^ { n } Q ( j ) \cdot \left( \frac { P ( j ) } { Q ( j ) } \right) ^ { 2 } - 1 = \sum _ { j = 1 } ^ { n } \frac { ( P ( j ) - Q ( j ) ) ^ { 2 } } { Q ( j ) } } \end{array}$ (P (j) Q(j))2 . For a distribution P on [n] and a vector $v \in \mathbb { R } ^ { n }$ , we write $\begin{array} { r } { \mathrm { V a r } _ { P } \left( v \right) : = \sum _ { j = 1 } ^ { n } P ( j ) \cdot \left( v ( j ) - \sum _ { k = 1 } ^ { n } P ( k ) v ( k ) \right) ^ { 2 } } \end{array}$ . Also define $\begin{array} { r } { \| v \| _ { P } : = \sqrt { \sum _ { j = 1 } ^ { n } P ( j ) \cdot v ( j ) ^ { 2 } } } \end{array}$ . If further $P$ has full support, then define $\begin{array} { r } { \left\| v \right\| _ { P } ^ { \star } = \sqrt { \sum _ { j = 1 } ^ { n } \frac { v ( j ) ^ { 2 } } { P ( j ) } } } \end{array}$ The above notations will often be used when $P$ is the mixed strategy profile $x _ { i }$ for some player $i$ and $v$ is a loss vector $\ell _ { i }$ ; in such a case the norms $\| v \| _ { P }$ and $\| v \| _ { P } ^ { \star }$ are often called local norms.
|
| 56 |
+
|
| 57 |
+
# 3 Results
|
| 58 |
+
|
| 59 |
+
Below we state our main theorem, which shows that when all players in a game play according to Optimistic Hedge with appropriate step size, they all experience polylogarithmic individual regrets.
|
| 60 |
+
|
| 61 |
+
Theorem 3.1 (Formal version of Theorem 1.1). There are constants $C , C ^ { \prime } > 1$ so that the following holds. Suppose a time horizon $T \in \mathbb { N }$ and a game $G$ with m players and $n _ { i }$ actions for each player $i \in [ m ]$ is given. Suppose all players play according to Optimistic Hedge with any positive step size $\begin{array} { r } { \eta \leq \frac { 1 } { C \cdot m \log ^ { 4 } T } } \end{array}$ . Then for any $i \in [ m ]$ , the regret of player $i$ satisfies
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathrm { R e g } _ { i , T } \leq \frac { \log n _ { i } } { \eta } + C ^ { \prime } \cdot \log T .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
In particular, if the players’ step size is chosen as $\begin{array} { r } { \eta = \frac { 1 } { C \cdot m \log ^ { 4 } T } } \end{array}$ , then the regret of player $i$ satisfies
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathrm { R e g } _ { i , T } \leq O \left( m \cdot \log n _ { i } \cdot \log ^ { 4 } T \right) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
A common goal in the literature on learning in games is to obtain an algorithm that achieves fast rates whan played by all players, and so that each player $i$ still obtains the optimal rate of $O ( \sqrt { T } )$ in the adversarial setting (i.e., when $i$ receives an arbitrary sequence of losses $\ell _ { i } ^ { ( 1 ) } , \ldots , \ell _ { i } ^ { ( T ) } )$ . We show in Corollary D.1 (in the appendix) that by running Optimistic Hedge with an adaptive step size, this is possible. Table 1 compares our regret bounds discussed in this section to those of prior work.
|
| 74 |
+
|
| 75 |
+
# 4 Proof overview
|
| 76 |
+
|
| 77 |
+
In this section we overview the proof of Theorem 3.1; the full proof may be found in the appendix.
|
| 78 |
+
|
| 79 |
+
# 4.1 New adversarial regret bound
|
| 80 |
+
|
| 81 |
+
The first step in the proof of Theorem 3.1 is to prove a new regret bound (Lemma 4.1 below) for Optimistic Hedge that holds for an adversarial sequence of losses. We will show in later sections that when all players play according to Optimistic Hedge, the right-hand side of the regret bound (4) is bounded by a quantity that grows only poly-logarithmically in $T$ .
|
| 82 |
+
|
| 83 |
+
Lemma 4.1. There is a constant $C > 0$ so that the following holds. Suppose any player $i \in [ m ]$ follows the Optimistic Hedge updates (1) with step size $\eta < 1 / C$ , for an arbitrary sequence of losses $\ell _ { i } ^ { ( 1 ) } , \ldots , \ell _ { i } ^ { ( T ) } \in [ 0 , 1 ] ^ { n _ { i } }$ . Then
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathrm { R e g } _ { i , T } \leq \frac { \log n _ { i } } { \eta } + \sum _ { t = 1 } ^ { T } \left( \frac { \eta } { 2 } + C \eta ^ { 2 } \right) \mathrm { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t ) } - \ell _ { i } ^ { ( t - 1 ) } \right) - \sum _ { t = 1 } ^ { T } \frac { ( 1 - C \eta ) \eta } { 2 } \cdot \mathrm { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t - 1 ) } \right) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
The detailed proof of Lemma 4.1 can be found in Section A, but we sketch the main steps here. The starting point is a refinement of [RS13a, Lemma 3] (stated as Lemma A.5), which gives an upper
|
| 90 |
+
|
| 91 |
+
bound for $\mathrm { R e g } _ { i , T }$ in terms of local norms corresponding to each of the iterates $x _ { i } ^ { ( t ) }$ of Optimistic Hedge. The bound involves the difference between the Optimistic Hedge iterates $x _ { i } ^ { ( t ) }$ and iterates $\tilde { x } _ { i } ^ { ( t ) }$ defined by $\begin{array} { r } { \tilde { x } _ { i } ^ { ( t ) } = \frac { x _ { i } ^ { ( t ) } ( j ) \cdot \exp ( - \eta \cdot ( \ell _ { i } ^ { ( t ) } ( j ) - \ell _ { i } ^ { ( t - 1 ) } ( j ) ) ) } { \sum _ { k \in [ n _ { i } ] } x _ { i } ^ { ( t ) } ( k ) \cdot \exp ( - \eta \cdot ( \ell _ { i } ^ { ( t ) } ( k ) - \ell _ { i } ^ { ( t - 1 ) } ( k ) ) ) } } \end{array}$ :
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathrm { R e g } _ { i , T } \leq \frac { \log n _ { i } } { \eta } + \sum _ { t = 1 } ^ { T } \left. x _ { i } ^ { ( t ) } - \tilde { x } _ { i } ^ { ( t ) } \right. _ { x _ { i } ^ { ( t ) } } ^ { \times } \sqrt { \mathrm { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t ) } - \ell _ { i } ^ { ( t - 1 ) } \right) } - \frac { 1 } { \eta } \sum _ { t = 1 } ^ { T } \mathrm { K L } ( \tilde { x } _ { i } ^ { ( t ) } ; x _ { i } ^ { ( t ) } ) - \frac { 1 } { \eta } \sum _ { t = 1 } ^ { T } \mathrm { K L } ( \tilde { x } _ { i } ^ { ( t ) } ; x _ { i } ^ { ( t ) } ) ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
2) thand $\mathrm { K L } ( \tilde { x } _ { i } ^ { ( t ) } ; x _ { i } ^ { ( t ) } )$ $\mathrm { K L } ( x _ { i } ^ { ( t ) } ; \tilde { x } _ { i } ^ { ( t - 1 ) } )$ may be lower bounded bytively. Note it is a standard $( 1 / 2 - O ( \eta ) ) \cdot \chi ^ { 2 } ( \tilde { x } _ { i } ^ { ( t ) } ; x _ { i } ^ { ( t ) } )$ $( 1 / 2 - O ( \eta ) ) \cdot \chi ^ { 2 } ( x _ { i } ^ { ( t ) } ; \tilde { x } _ { i } ^ { ( t - 1 ) } )$ fact that the KL divergence between two distributions is upper bounded by the chi-squared distribution between them; by contrast, Lemma A.2 can exploit that $x _ { i } ^ { ( t ) }$ , $\tilde { x } _ { i } ^ { ( t ) }$ t) and x˜ (t 1)i a re close to each other between lower bo $x _ { i } ^ { ( t ) }$ i and x˜ $\tilde { x } _ { i } ^ { ( t - 1 ) }$ hat the , leadi $\chi ^ { 2 }$ -divergenco the term $\chi ^ { 2 } ( x _ { i } ^ { ( t ) } ; \tilde { x } _ { i } ^ { ( t - 1 ) } )$ $\left( 1 - O ( \eta ) \right) \cdot \eta ^ { 2 } \cdot \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t - 1 ) } \right)$ $\begin{array} { r } { \frac { ( 1 - C \eta ) \eta } { 2 } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t - 1 ) } \right) } \end{array}$ being subtracted in (4). The $\chi ^ { 2 }$ -divergence $\chi ^ { 2 } ( \tilde { x } _ { i } ^ { ( t ) } ; x _ { i } ^ { ( t ) } )$ , as well as the term $\left\| \boldsymbol { x } _ { i } ^ { ( t ) } - \tilde { \boldsymbol { x } } _ { i } ^ { ( t ) } \right\| _ { \boldsymbol { x } _ { i } ^ { ( t ) } } ^ { \star }$ in (5) are bounded in a similar manner to obtain (4).
|
| 98 |
+
|
| 99 |
+
# 4.2 Finite differences
|
| 100 |
+
|
| 101 |
+
Given Lemma 4.1, in order to establish Theorem 3.1, it suffices to show Lemma 4.2 below. Indeed, (6) below implies that the right-hand side of (4) is bounded above by $\frac { \log n _ { i } } { \eta } + \eta \cdot O ( \log ^ { 5 } T )$ , which is bounded above by $O ( m \log n _ { i } \log ^ { 4 } T )$ for the choice $\begin{array} { r } { \eta = \Theta \left( \frac { 1 } { m \cdot \log ^ { 4 } T } \right) } \end{array}$ of Theorem 3.1.2
|
| 102 |
+
|
| 103 |
+
Lemma 4.2 (Abbreviated; detailed version in Section C.3). Suppose all players play according to Optimistic Hedge with step size $\eta$ satifying $\begin{array} { r } { 1 / T \le \eta \le \frac { 1 } { C m \cdot \log ^ { 4 } T } } \end{array}$ for a sufficiently large constant $C$ . Then for any $i \in [ m ]$ , the losses $\ell _ { i } ^ { ( 1 ) } , \ldots , \ell _ { i } ^ { ( T ) } \in \mathbb { R } ^ { n _ { i } }$ for player $i$ satisfy:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t ) } - \ell _ { i } ^ { ( t - 1 ) } \right) \leq \frac { 1 } { 2 } \cdot \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \ell _ { i } ^ { ( t - 1 ) } \right) + O \left( \log ^ { 5 } T \right) .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
The definition below allows us to streamline our notation when proving Lemma 4.2.
|
| 110 |
+
|
| 111 |
+
Definition 4.1 (Finite differences). Suppose ${ \cal L } = ( L ^ { ( 1 ) } , \dots , L ^ { ( T ) } )$ is a sequence of vectors $L ^ { ( t ) } \in \mathbb { R } ^ { n }$ . For integers $h \geq 0$ , the order- $h$ finite difference sequence for the sequence $L$ , denoted by $\mathrm Ḋ _ Ḋ h Ḍ L Ḍ$ , is the sequence $\mathrm D _ { h } L : = \left( \left( \mathrm D _ { h } L \right) ^ { ( 1 ) } , \ldots , \left( \bar { \mathrm D _ { h } } L \right) ^ { ( T - h ) } \right)$ defined recursively as: $\left( \mathrm { D } _ { 0 } L \right) ^ { ( t ) } : = L ^ { ( t ) }$ for all $1 \leq t \leq T$ , and
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
( \mathrm Ḋ _ { Ḋ } L Ḍ ) ^ { ( t ) } : = ( \mathrm Ḋ _ { Ḋ } \mathrm Ḋ _ { Ḋ } L Ḍ Ḍ ) ^ { ( t + 1 ) } - ( \mathrm Ḋ _ { Ḋ } \mathrm Ḋ _ { Ḋ } L Ḍ Ḍ ) ^ { ( t ) }
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
for all $h \geq 1 , 1 \leq t \leq T - h$ .3
|
| 118 |
+
|
| 119 |
+
Remark 4.3. Notice that another way of writing (7) is: $\mathrm { D } _ { h } { \cal L } = \mathrm { D } _ { 1 } \mathrm { D } _ { h - 1 } { \cal L }$ . We also remark for later use that $\begin{array} { r } { ( \mathrm { D } _ { h } L ) ^ { ( t ) } = \sum _ { s = 0 } ^ { h } \binom { h } { s } ( - 1 ) ^ { h - s } L ^ { ( t + s ) } } \end{array}$ .
|
| 120 |
+
|
| 121 |
+
Let $H = \log T$ , where $T$ denotes the fixed time horizon from Theorem 3.1 (and thus Lemma 4.2). In the proof of Lemma 4.2, we will bound the finite differences of order $h \leq H$ for certain sequences. The bound (6) of Lemma 4.2 may be rephased as upper bounding $\textstyle \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( { \bigl ( } \operatorname { D } _ { 1 } \ell _ { i } { \bigr ) } ^ { ( t - 1 ) } \right)$ , by $\begin{array} { r } { \frac { 1 } { 2 } \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } } \Big ( \ell _ { i } ^ { ( t - 1 ) } \Big ) ; } \end{array}$ ; to prove this, we proceed in two steps:
|
| 122 |
+
|
| 123 |
+
1. (Upwards induction step) First, in Lemma 4.4 below, we find an upper bound on $\left\| \left( \operatorname { D } _ { h } \ell _ { i } \right) ^ { ( t ) } \right\| _ { \infty }$ for all $t \in [ T ]$ , $h \geq 0$ , which decays exponentially in $h$ for $h \leq H$ 1. This is done via upwards induction on $h$ , i.e., first proving the base case $h = 0$ using boundedness of the losses $\ell _ { i } ^ { ( t ) }$ and then $h = 1 , 2 , \ldots$ inductively. The main technical tool we develop for the inductive step is a weak form of the chain rule for finite differences, Lemma 4.5. The inductive step uses the fact that all players are following Optimistic Hedge to relate the $h$ th order finite differences of player $i$ ’s loss sequence $\ell _ { i } ^ { ( t ) }$ to the $h$ th order finite differences of the strategy sequences $x _ { i ^ { \prime } } ^ { ( t ) }$ for players $i ^ { \prime } \neq i$ ; then we use the exponential-weights style updates of Optimistic Hedge and Lemma 4.5 to relate the hth order finite differences of the strategies $x _ { i ^ { \prime } } ^ { ( t ) }$ to the $( h - 1 )$ th order finite differences of the losses $\ell _ { i ^ { \prime } } ^ { ( t ) }$ .
|
| 124 |
+
|
| 125 |
+
2. (Downwards induction step) We next show that for all $H _ { \mathbf { \varepsilon } } \leq \mathbf { \varepsilon } _ { h } \leq \mathbf { \varepsilon } _ { H } $ $\begin{array} { r } { \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \left( \operatorname { D } _ { h + 1 } \ell _ { i } \right) ^ { ( t - 1 ) } \right) } \end{array}$ is bounded above by $\begin{array} { r } { c _ { h } \cdot \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( ( \operatorname { D } _ { h } \ell _ { i } ) ^ { ( t - 1 ) } \right) + \mu _ { h } } \end{array}$ , for some $c _ { h } < 1 / 2$ and $\mu _ { h } < \dot { O } ( \log ^ { 5 } T )$ . This shown via downwards induction on $h$ , namely first establishing the base case $h = H$ by using the result of item 1 for $h = H$ and then treating the cases $h = H - 1 , H - 2 , \dots , 0$ . The inductive step makes use of the discrete Fourier transform (DFT) to relate the finite differences of different orders (see Lemmas 4.7 and 4.8). In particular, Parseval’s equality together with a standard relationship between the DFT of the finite differences of a sequence to the DFT of that sequence allow us to first prove the inductive step in the frequency domain and then transport it back to the original (time) domain.
|
| 126 |
+
|
| 127 |
+
In the following subsections we explain in further detail how the two steps above are completed.
|
| 128 |
+
|
| 129 |
+
# 4.3 Upwards induction proof overview
|
| 130 |
+
|
| 131 |
+
Addressing item 1 in the previous subsection, the lemma below gives a bound on the supremum norm of the $h$ -th order finite differences of each player’s loss vector, when all players play according to Optimistic Hedge and experience losses according to their loss functions $\mathcal { L } _ { 1 } , \ldots , \mathcal { L } _ { m } : \mathcal { A } [ 0 , 1 ]$ .
|
| 132 |
+
|
| 133 |
+
Lemma 4.4 (Abbreviated). Fix a step size $\eta > 0$ satisfying $\begin{array} { r } { \eta \ \leq \ o \left( \frac { 1 } { m \log T } \right) } \end{array}$ . If all players follow Optimistic Hedge updates with step size $\eta _ { ; }$ , then for any player $i \in [ m ]$ , integer $h$ satisfying $0 \leq h \leq H$ , and time step $t \in [ T - h ]$ , it holds that $\| \left( \operatorname { D } _ { h } \ell _ { i } \right) ^ { ( t ) } \| _ { \infty } \leq O ( m \eta ) ^ { h } \cdot h ^ { O ( h ) }$ .
|
| 134 |
+
|
| 135 |
+
A detailed version of Lemma 4.4, together with its full proof, may be found in Section B.4. We next give a proof overview of Lemma 4.4 for the case of 2 players, i.e., $m = 2$ ; we show in Section B.4 how to generalize this computation to general $m$ . Below we introduce the main technical tool in the proof, a “boundedness chain rule,” and then outline how it is used to prove Lemma 4.4.
|
| 136 |
+
|
| 137 |
+
Main technical tool for Lemma 4.4: boundedness chain rule. We say that a function $\phi : \mathbb { R } ^ { n } \mathbb { R }$ is a softmax-type function if there are real numbers $\xi _ { 1 } , \ldots , \xi _ { n }$ and some $j \in [ n ]$ so that for all $( z _ { 1 } , \ldots , z _ { n } ) \in \mathbb { R } ^ { n }$ , $\begin{array} { r } { \phi ( ( z _ { 1 } , \ldots , z _ { n } ) ) = \frac { \exp ( z _ { j } ) } { \sum _ { k = 1 } ^ { n } \xi _ { k } \cdot \exp ( z _ { k } ) } } \end{array}$ . Lemma 4.5 below may be interpreted as a “boundedness chain rule” for finite differences. To explain the context for this lemma, recall that given an infinitely differentiable vector-valued function $L : \mathbb { R } \to \mathbb { R } ^ { n }$ and an infinitely differentiable function $\phi : \mathbb { R } ^ { n } \mathbb { R }$ , the higher order derivatives of the function $\phi ( L ( t ) )$ may be computed in terms of those of $L$ and $\phi$ using the chain rule. Lemma 4.5 considers an analogous setting where the input variable $t$ to $L$ is discrete-valued, taking values in $[ T ]$ (and so we identify the function $L$ with the sequence $L ^ { ( 1 ) } , \dots , L ^ { ( T ) } )$ . In this case, the higher order finite differences of the sequence $L ^ { ( 1 ) } , \dots , L ^ { ( T ) }$ (Definition 4.1) take the place of the higher order derivatives of $L$ with respect to $t$ . Though there is no generic chain rule for finite differences, Lemma 4.5 states that, at least when $\phi$ is a softmax-type function, we may bound the higher order finite differences of the sequence $\phi ( L ^ { ( 1 ) } ) , \dots , \phi ( L ^ { ( T ) } )$ . In the lemma’s statement we let $\phi \circ L$ denote the sequence $\phi ( L ^ { ( 1 ) } ) , \dots , \phi ( L ^ { ( T ) } )$ .
|
| 138 |
+
|
| 139 |
+
Lemma 4.5 (“Boundedness chain rule” for finite differences; abbreviated). Suppose that $h , n \in \mathbb { N }$ , $\phi : \mathbb { R } ^ { n } \mathbb { R }$ is a softmax-type function, and ${ \cal L } = ( L ^ { ( 1 ) } , \dots , L ^ { ( T ) } )$ is a sequence of vectors in $\mathbb { R } ^ { n }$ satisfying $\| L ^ { ( t ) } \| _ { \infty } \leq 1$ for $t \in [ T ]$ . Suppose for some $\alpha \in ( 0 , 1 )$ , for each $0 \leq h ^ { \prime } \leq h$ and $t \in [ T - h ^ { \prime } ] ,$ , it holds that $\| \mathrm { D } _ { h ^ { \prime } } L ^ { ( t ) } \| _ { \infty } \leq O ( \alpha ^ { h ^ { \prime } } ) \cdot ( h ^ { \prime } ) ^ { O ( h ^ { \prime } ) }$ . Then for all $t \in [ T - h ]$ ,
|
| 140 |
+
|
| 141 |
+
A detailed version of Lemma 4.5 may be found in Section B.3. While Lemma 4.5 requires $\phi$ to be a softmax-type function for simplicity (and this is the only type of function $\phi$ we will need to consider for the case $m = 2$ ) we remark that the detailed version of Lemma 4.5 allows $\phi$ to be from a more general family of analytic functions whose higher order derivatives are appropriately bounded. The proof of Lemma 4.4 for all $m \geq 2$ requires that more general form of Lemma 4.5.
|
| 142 |
+
|
| 143 |
+
The proof of Lemma 4.5 proceeds by considering the Taylor expansion $P _ { \phi } ( \cdot )$ of the function $\phi$ at the origin, which we write as follows: for $z = ( z _ { 1 } , \ldots , z _ { n } ) \in \mathbb { R } ^ { n }$ , $\begin{array} { r } { P _ { \phi } ( z ) : = \sum _ { k \geq 0 , \gamma \in \mathbb { Z } _ { \geq 0 } ^ { n } : \ | \gamma | = k } a _ { \gamma } z ^ { \gamma } } \end{array}$ , where $a _ { \gamma } \in \mathbb { R } , | \gamma |$ denotes the quantity $\gamma _ { 1 } + \cdots + \gamma _ { n }$ and $z ^ { \gamma }$ denotes $z _ { 1 } ^ { \gamma _ { 1 } } \cdots z _ { n } ^ { \gamma _ { n } }$ . The fact that $\phi$ is a softmax-type function ensures that the radius of convergence of its Taylor series is at least 1, i.e., $\phi ( z ) = P _ { \phi } ( z )$ for any $z$ satisfying $\| z \| _ { \infty } \leq 1$ . By the assumption that $\| \dot { L } ^ { ( t ) } \| _ { \infty } \leq 1$ for each $t$ , we may therefore decompose $( \mathrm { D } _ { h } \left( \phi \circ L \right) ) ^ { ( t ) }$ as:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\left( \mathrm { D } _ { h } \left( \phi \circ L \right) \right) ^ { \left( t \right) } = \sum _ { k \geq 0 , \gamma \in \mathbb { Z } _ { \geq 0 } ^ { n } : \ \vert \gamma \vert = k } a _ { \gamma } \cdot \left( \mathrm { D } _ { h } L ^ { \gamma } \right) ^ { \left( t \right) } ,
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $L ^ { \gamma }$ denotes the sequence of scalars $( L ^ { \gamma } ) ^ { ( t ) } : = ( L ^ { ( t ) } ) ^ { \gamma }$ for all $t$ . The fact that $\phi$ is a softmaxtype function allows us to establish strong bounds on $| a _ { \gamma } |$ for each $\gamma$ in Lemma B.5. The proof of Lemma B.5 bounds the $| a _ { \gamma } |$ by exploiting the simple form of the derivative of a softmax-type function to decompose each $a _ { \gamma }$ into a sum of $| \gamma |$ ! terms. Then we establish a bijection between the terms of this decomposition and graph structures we refer to as factorial trees; that bijection together with the use of an appropriate generating function allow us to complete the proof of Lemma B.5.
|
| 150 |
+
|
| 151 |
+
Thus, to prove Lemma 4.5, it suffices to bound $\left| ( \mathrm Ḋ \boldsymbol Ḋ h Ḍ Ḍ L ^ { \gamma } ) ^ { ( t ) } \right|$ for all $\gamma$ . We do so by using Lemma 4.6. Lemma 4.6 (Abbreviated; detailed vesion in Section B.2). Fix any $h \geq 0$ , a multi-index $\gamma \in \mathbb { Z } _ { \geq 0 } ^ { n }$ and set $k = | \gamma |$ . For each of the $k ^ { h }$ functions $\pi : [ h ] [ k ]$ , and for each $r \in [ k ] .$ , there are integers $h _ { \pi , r } ^ { \prime } \in \{ 0 , 1 , \ldots , h \}$ , $t _ { \pi , r } ^ { \prime } \geq 0$ , and $j _ { \pi , r } ^ { \prime } \in [ n ]$ , so that the following holds. For any sequence $L ^ { ( 1 ) } , \ldots , L ^ { ( T ) } \in \mathbb { R } ^ { n }$ of vectors, it holds that, for each $t \in [ T - h ]$ ,
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
( \mathrm { D } _ { h } L ^ { \gamma } ) ^ { ( t ) } = \sum _ { \pi : [ h ] [ k ] } \prod _ { r = 1 } ^ { k } ( \mathrm { D } _ { h _ { \pi , r } ^ { \prime } } ( L ( j _ { \pi , r } ^ { \prime } ) ) ) ^ { ( t + t _ { \pi , r } ^ { \prime } ) } .
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Lemma 4.6 expresses the $h$ th order finite differences of the sequence $L ^ { \gamma }$ as a sum of $k ^ { h }$ terms, each of which is a product of $k$ finite order differences of a sequence $L ^ { ( t ) } ( j _ { \pi , r } ^ { \prime } )$ (i.e., the $j _ { \pi , r } ^ { \prime }$ th coordinate of the vectors $L ^ { ( t ) }$ ). Crucially, when using Lemma 4.6 to prove Lemma 4.5, the assumption of Lemma 4.5 gives that for each $j ^ { \prime } \in [ n ]$ , each $h ^ { \prime } \in [ h ]$ , and each $t ^ { \prime } \in [ T - h ^ { \prime } ]$ , we have the bound $\left| ( \operatorname { D } _ { h ^ { \prime } } L ( j ^ { \prime } ) ) ^ { ( t ^ { \prime } ) } \right| \le O ( \alpha ^ { h ^ { \prime } } ) \cdot ( h ^ { \prime } ) ^ { O ( h ^ { \prime } ) }$ . These assumed bounds may be used to bound the right-hand side of (9), which together with Lemma 4.6 and (8) lets us complete the proof of Lemma 4.5.
|
| 158 |
+
|
| 159 |
+
Proving Lemma 4.4 using the boundedness chain rule. Next we discuss how Lemma 4.5 is used to prove Lemma 4.4, namely to bound $\| \left( \mathrm { D } _ { h } \ell _ { i } \right) ^ { ( t ) } \| _ { \infty }$ for each $t \in [ T - h ]$ , $i \in [ m ]$ , and $0 \leq h \leq H$ . Lemma 4.4 is proved using induction, with the base case $h = 0$ being a straightforward consequence of the fact that $\| \left( \operatorname { D } _ { 0 } \ell _ { i } \right) ^ { ( t ) } \| _ { \infty } = \| \ell _ { i } ^ { ( t ) } \| _ { \infty } \leq 1$ for all $i \in [ m ] , t \in [ T ]$ . For the rest of this section we focus on the inductive case, i.e., we pick some $h \in [ H ]$ and assume Lemma 4.4 holds for all $h ^ { \prime } < h$ .
|
| 160 |
+
|
| 161 |
+
The first step is to reduce the claim of Lemma 4.4 to the claim that the upper bound $\Vert \left( \mathrm { D } _ { h } x _ { i } \right) ^ { ( t ) } \Vert _ { 1 } \leq$ $O \left( m \eta \right) ^ { h } \cdot h ^ { O ( h ) }$ holds for each $t \in [ T - h ] , i \in [ m ]$ . Recalling that we are only sketching here the case $m = 2$ for simplicity, this reduction proceeds as follows: for $i \in \{ 1 , 2 \}$ , define the matrix $A _ { i } \ \in \ \mathbb { R } ^ { n _ { 1 } \times n _ { 2 } }$ by $( A _ { i } ) _ { a _ { 1 } a _ { 2 } } = { \mathcal { L } } _ { i } ( a _ { 1 } , a _ { 2 } )$ , for $a _ { 1 } \in [ n _ { 1 } ] , a _ { 2 } \in [ n _ { 2 } ]$ . We have assumed that all players are using Optimistic Hedge and thus $\ell _ { i } ^ { ( t ) } = \mathbb { E } _ { a _ { i ^ { \prime } } \sim x _ { i ^ { \prime } } ^ { ( t ) } }$ , $\forall i ^ { \prime } \neq i ^ { } \lbrack \mathcal { L } _ { i } ( a _ { 1 } , \ldots , a _ { n } ) \rbrack$ ; for our case here $( m = 2$ ), this may be rewritten as $\ell _ { 1 } ^ { ( t ) } = A _ { 1 } x _ { 2 } ^ { ( t ) }$ , $\ell _ { 2 } ^ { ( t ) } = A _ { 2 } ^ { \top } x _ { 1 } ^ { ( t ) }$ . Thus
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
| ( \mathbf { D } _ { h } \ell _ { 1 } ) ^ { ( t ) } | | _ { \infty } = \| A _ { 1 } \cdot \sum _ { s = 0 } ^ { h } { \binom { h } { s } } ( - 1 ) ^ { h - s } x _ { 2 } ^ { ( t + s ) } \| _ { \infty } \leq \| \sum _ { s = 0 } ^ { h } { \binom { h } { s } } ( - 1 ) ^ { h - s } x _ { 2 } ^ { ( t + s ) } \| _ { 1 } = \| ( \mathbf { D } _ { h } x _ { 2 } ) ^ { ( t ) } \| _ { \infty }
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
where the first equality is from Remark 4.3 and the inequality follows since all entries of $A _ { 1 }$ have absolute value $\leq 1$ . A similar computation allows us to show $\| \left( \operatorname { D } _ { h } \ell _ { 2 } \right) ^ { ( t ) } \| _ { \infty } \leq \| \left( \operatorname { D } _ { h } x _ { 1 } \right) ^ { ( t ) } \| _ { 1 }$ .
|
| 168 |
+
|
| 169 |
+
To complete the inductive step it remains to upper bound the quantities $\Vert \left( \mathrm { D } _ { h } x _ { i } \right) ^ { ( t ) } \Vert _ { 1 }$ for $i \in [ m ] , t \in$ $[ T - h ]$ . To do so, we note that the definition of the Optimistic Hedge updates (1) implies that for any $\bar { i } \in [ m ] , t \in [ T ] , j \in [ n _ { i } ]$ , and $t ^ { \prime } \geq 1$ , we have
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
x _ { i } ^ { ( t + t ^ { \prime } ) } ( j ) = \frac { x _ { i } ^ { ( t ) } ( j ) \cdot \exp \left( \eta \cdot \left( \ell _ { i } ^ { ( t - 1 ) } ( j ) - \sum _ { s = 0 } ^ { t ^ { \prime } - 1 } \ell _ { i } ^ { ( t + s ) } ( j ) - \ell _ { i } ^ { ( t + t ^ { \prime } - 1 ) } ( j ) \right) \right) } { \sum _ { k = 1 } ^ { n _ { i } } x _ { i } ^ { ( t ) } ( k ) \cdot \exp \left( \eta \cdot \left( \ell _ { i } ^ { ( t - 1 ) } ( k ) - \sum _ { s = 0 } ^ { t ^ { \prime } - 1 } \ell _ { i } ^ { ( t + s ) } ( k ) - \ell _ { i } ^ { ( t + t ^ { \prime } - 1 ) } ( k ) \right) \right) } .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
For $t \in [ T ] , t ^ { \prime } \geq 0$ , set $\begin{array} { r } { \bar { \ell } _ { i , t } ^ { ( t ^ { \prime } ) } : = \eta \cdot \left( \ell _ { i } ^ { ( t - 1 ) } - \sum _ { s = 0 } ^ { t ^ { \prime } - 1 } \ell _ { i } ^ { ( t + s ) } - \ell _ { i } ^ { ( t + t ^ { \prime } - 1 ) } \right) . } \end{array}$ . Also, for each $i \in [ m ] , j \in$ $[ n _ { i } ] , t \in [ T ]$ , and any vector $z = ( z ( 1 ) , \dots , z ( n _ { i } ) ) \in \mathbb { R } ^ { n _ { i } }$ define $\begin{array} { r } { \overset { \cdot } { \phi _ { t , i , j } ( z ) } : = \frac { x _ { i } ^ { ( t ) } ( j ) \cdot \exp ( z ( j ) ) } { \sum _ { k = 1 } ^ { n _ { i } } x _ { i } ^ { ( t ) } ( k ) \cdot \exp ( z ( k ) ) } } \end{array}$ . Thus (10) gives that for $t ^ { \prime } \geq 1$ , $x _ { i } ^ { ( t + t ^ { \prime } ) } ( j ) = \phi _ { t , i , j } ( \bar { \ell } _ { i , t } ^ { ( t ^ { \prime } ) } )$ . Viewing $t$ k=1 i ·as a fixed parameter and letting $t ^ { \prime }$ vary, it follows that for $h \geq 0$ and $t ^ { \prime } \geq 1$ , $\begin{array} { r } { \left( \mathrm { D } _ { h } x _ { i } ^ { ( t + \cdot ) } ( j ) \right) ^ { ( t ^ { \prime } ) } = \left( \mathrm { D } _ { h } \left( \phi _ { t , i , j } \circ \bar { \ell } _ { i , t } \right) \right) ^ { ( t ^ { \prime } ) } . } \end{array}$
|
| 176 |
+
|
| 177 |
+
Recalling that our goal is to bound $\vert \left( \mathrm { D } _ { h } x _ { i } ( j ) \right) ^ { ( t + 1 ) } \vert$ for each $t$ , we can do so by using Lemma 4.5 with $\mathbf { \phi } \phi ~ = ~ \phi _ { t , i , j }$ and $\alpha ~ = ~ { \cal { O } } ( m \eta )$ , if we can show that its precondition is met, i.e. that $\begin{array} { r } { \| \left( \mathrm { D } _ { h ^ { \prime } } \bar { \ell } _ { i , t } \right) ^ { ( t ^ { \prime } ) } \| _ { \infty } \le \frac { 1 } { B _ { 1 } } \cdot \alpha ^ { h ^ { \prime } } \cdot ( h ^ { \prime } ) ^ { B _ { 0 } h ^ { \prime } } } \end{array}$ for all $h ^ { \prime } \leq h$ , the appropriate $\alpha$ and appropriate constants B0, B1. Helpfully, the definition of ¯\` (t0 )i,t a s a partial sum allows us to relate the $h ^ { \prime }$ -th order finite differences of the sequence $\bar { \ell } _ { i , t } ^ { ( t ^ { \prime } ) }$ to the $\left( h ^ { \prime } - 1 \right)$ -th order finite differences of the sequence $\ell _ { i } ^ { ( t ) }$ as follows:
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\left( \mathrm { D } _ { h ^ { \prime } } \bar { \ell } _ { i , t } \right) ^ { ( t ^ { \prime } ) } = \eta \cdot \left( \mathrm { D } _ { h ^ { \prime } - 1 } \ell _ { i } \right) ^ { ( t + t ^ { \prime } - 1 ) } - 2 \eta \cdot \left( \mathrm { D } _ { h ^ { \prime } - 1 } \ell _ { i } \right) ^ { ( t + t ^ { \prime } ) } .
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
Since $h ^ { \prime } - 1 < h$ for $h ^ { \prime } \leq h$ , the inductive assumption of Lemma 4.4 gives a bound on the $\ell _ { \infty }$ -norm of the terms on the right-hand side of (11), which are sufficient for us to apply Lemma 4.5. Note that the inductive assumption gives an upper bound on $\| \left( \mathrm { D } _ { h ^ { \prime } - 1 } \ell _ { i } \right) ^ { ( t ) } \| _ { \infty }$ that only scales with $\alpha ^ { h ^ { \prime } - 1 }$ , whereas Lemma 4.5 requires scaling of $\alpha ^ { h ^ { \prime } }$ . This discrepancy is corrected by the factor of $\eta$ on the right-hand side of (11), which gives the desired scaling $\alpha ^ { h ^ { \prime } }$ (since $\eta < \alpha$ for the choice $\alpha = { \cal { O } } ( m \eta ) ,$ ).
|
| 184 |
+
|
| 185 |
+
# 4.4 Downwards induction proof overview
|
| 186 |
+
|
| 187 |
+
In this section we discuss in further detail item 2 in Section 4.2; in particular, we will show that there is a parameter $\mu = \tilde { \Theta } ( \eta m )$ so that for all integers $h$ satisfying $H - 1 \geq h \geq 0$ ,
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\sum _ { t = 1 } ^ { T - h - 1 } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( ( \operatorname { D } _ { h + 1 } \ell _ { i } ) ^ { ( t ) } \right) \leq O ( 1 / H ) \cdot \sum _ { t = 1 } ^ { T - h } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( ( \operatorname { D } _ { h } \ell _ { i } ) ^ { ( t ) } \right) + \tilde { O } \left( \mu ^ { 2 h } \right) ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
where $\tilde { O }$ hides factors polynomial in $\log T$ . The validity of (12) for $h = 0$ implies Lemma 4.2. On implies that the other hand, as long we choose the value $\begin{array} { r } { \sum _ { t = 1 } ^ { T - H } \operatorname { V a r } _ { x _ { i } ^ { ( t ) } } \left( \left( \operatorname { D } _ { H } \ell _ { i } \right) ^ { ( t ) } \right) \leq O ( \mu ^ { 2 H } ) } \end{array}$ $\mu$ in (12) to satisfy . This gives that (12) holds for $\mu \geq m \eta H ^ { \Omega ( 1 ) }$ , then Lemma 4.4 $h = H - 1$ . To show that (12) holds for all $H - 1 > h \geq 0$ , we use downwards induction; fix any $h$ , and assume that (12) has been shown for all $h ^ { \prime }$ satisfying $h < h ^ { \prime } \leq H - 1$ . Our main tool in the inductive step is to apply Lemma 4.7 below. To state it, for $\zeta > 0 , n \in \mathbb { N }$ , we say that a sequence of distributions $P ^ { ( 1 ) } , \ldots , P ^ { ( T ) } \in \Delta ^ { n }$ is $\zeta$ -consecutively close if for each $1 \leq t < T$ , it holds that max $\left\{ \left\| \frac { P ^ { ( t ) } } { P ^ { ( t + 1 ) } } \right\| _ { \infty } , \left\| \frac { P ^ { ( t + 1 ) } } { P ^ { ( t ) } } \right\| _ { \infty } \right\} \leq 1 + \zeta$ . 4 Lemma 4.7 shows that given a sequence of vectors for which the variances of its second-order finite differences are bounded by the variances of its first-order finite differences, a similar relationship holds between its first- and zeroth-order finite differences.
|
| 194 |
+
|
| 195 |
+
Lemma 4.7. There is a sufficiently large constant $C _ { 0 } > 1$ so that the following holds. For any $M , \zeta , \alpha > 0$ and $n \in \mathbb N$ , suppose that $P ^ { ( 1 ) } , \ldots , P ^ { ( T ) } \in \Delta ^ { n }$ and $Z ^ { ( 1 ) } , \ldots , Z ^ { ( \breve { T } ) } \in [ - M , M ] ^ { \breve { n } }$ satisfy the following conditions:
|
| 196 |
+
|
| 197 |
+
1. The sequence $P ^ { ( 1 ) } , \ldots , P ^ { ( T ) }$ is $\zeta$ -consecutively close for some $\zeta \in [ 1 / ( 2 T ) , \alpha ^ { 4 } / C _ { 0 } ]$
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\begin{array} { r } { \sum _ { t = 1 } ^ { T - 2 } \operatorname { V a r } _ { P ^ { ( t ) } } \left( \left( \operatorname { D } _ { 2 } Z \right) ^ { ( t ) } \right) \leq \alpha \cdot \sum _ { t = 1 } ^ { T - 1 } \operatorname { V a r } _ { P ^ { ( t ) } } \left( \left( \operatorname { D } _ { 1 } Z \right) ^ { ( t ) } \right) + \mu . } \end{array}
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
4 Here, for distributions $P , Q \in \Delta ^ { n }$ , $\frac { P } { Q } \in \mathbb { R } ^ { n }$ denotes the vector whose $j$ th entry is $P ( j ) / Q ( j )$ .
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
\begin{array} { r } { \sum _ { t = 1 } ^ { T - 1 } \operatorname { V a r } _ { P ^ { ( t ) } } \left( \left( \operatorname { D } _ { 1 } Z \right) ^ { ( t ) } \right) \leq \alpha \cdot \left( 1 + \alpha \right) \sum _ { t = 1 } ^ { T } \operatorname { V a r } _ { P ^ { ( t ) } } \left( Z ^ { ( t ) } \right) + \frac { \mu } { \alpha } + \frac { C _ { 0 } M ^ { 2 } } { \alpha ^ { 3 } } . } \end{array}
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
Given Lemma 4.7, the inductive step for establishing (12) is straightforward: we apply Lemma 4.7 with $P ^ { ( t ) } = x _ { i } ^ { ( t ) }$ and $Z ^ { ( t ) } = ( \mathrm { D } _ { h } \ell _ { i } ) ^ { ( t ) }$ for all $t$ . The fact that $x _ { i } ^ { ( t ) }$ are updated with Optimistic Hedge may be used to establish that precondition 1 of Lemma 4.7 holds. Since $\left( \operatorname { D } _ { 1 } Z \right) ^ { ( t ) } = \left( \operatorname { D } _ { h + 1 } \ell _ { i } \right) ^ { ( t ) }$ and $( \mathrm { D } _ { 2 } Z ) ^ { ( t ) } = ( \mathrm { D } _ { h + 2 } \ell _ { i } ) ^ { ( t ) }$ , that the inductive hypothesis (12) holds for $h + 1$ implies that precondition 2 of Lemma 4.7 holds for appropriate $\alpha , \mu > 0$ . Thus Lemma 4.7 implies that (12) holds for the value $h$ , which completes the inductive step.
|
| 210 |
+
|
| 211 |
+
On the proof of Lemma 4.7. Finally we discuss the proof of Lemma 4.7. One technical challenge is the fact that the vectors $P ^ { ( t ) }$ are not constant functions of $t$ , but rather change slowly (as constrained by being $\zeta$ -consecutively close). The main tool for dealing with this difficulty is Lemma C.1, which shows that for a $\zeta$ -consecutively close sequence $P ^ { ( t ) }$ , for any vector $Z ^ { ( t ) }$ , $\begin{array} { r } { \frac { \dot { \operatorname { V a r } _ { P ^ { ( t ) } } } \left( Z ^ { ( t ) } \right) } { \operatorname { V a r } _ { P ^ { ( t + 1 ) } } \left( Z ^ { ( t ) } \right) } \in \left[ 1 - \zeta , 1 + \right. } \end{array}$ $\zeta ]$ . This fact, together with some algebraic manipulations, lets us to reduce to the case that all $P ^ { ( t ) }$ are equal. It is also relatively straightforward to reduce to the case that $\langle P ^ { ( t ) } , Z ^ { ( t ) } \rangle = 0$ for all $t$ , i.e., so that $\mathrm { V a r } _ { P ( t ) }$ $\left( Z ^ { ( t ) } \right) = \left\| Z ^ { ( t ) } \right\| _ { P ^ { ( t ) } } ^ { 2 }$ . We may further separate $\begin{array} { r } { \left. Z ^ { ( t ) } \right. _ { P ^ { ( t ) } } ^ { 2 } = \sum _ { j = 1 } ^ { n } P ^ { ( t ) } ( j ) \cdot ( Z ^ { ( t ) } ( j ) ) ^ { 2 } } \end{array}$ into its individual components $P ^ { ( t ) } ( j ) \cdot ( Z ^ { ( t ) } ( j ) ) ^ { 2 }$ , and treat each one separately, thus allowing us to reduce to a one-dimensional problem. Finally, we make one further reduction, which is to replace the finite differences $\mathrm { D } _ { h } \left( \cdot \right)$ in Lemma 4.7 with circular finite differences, defined below:
|
| 212 |
+
|
| 213 |
+
Definition 4.2 (Circular finite difference). Suppose $L = ( L ^ { ( 0 ) } , \dots , L ^ { ( S - 1 ) } )$ is a sequence of vectors $L ^ { ( t ) } \in \mathbb { R } ^ { n }$ . For integers $h \geq 0$ , the level- $h$ circular finite difference sequence for the sequence $L$ , denoted by $\mathrm { D } _ { h } ^ { \circ } L$ , is the sequence defined recursively as: $( \mathrm { D } _ { 0 } ^ { \circ } L ) ^ { ( t ) } = L ^ { \bar { ( t ) } }$ for all $0 \leq t < S$ , and
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\begin{array} { r } { ( \mathrm { D } _ { h } ^ { \circ } L ) ^ { ( t ) } = \left\{ \begin{array} { l l } { \left( \mathrm { D } _ { h - 1 } ^ { \circ } L \right) ^ { ( t + 1 ) } - \left( \mathrm { D } _ { h - 1 } ^ { \circ } L \right) ^ { ( t ) } } & { : 0 \le t \le S - 2 } \\ { \left( \mathrm { D } _ { h - 1 } ^ { \circ } L \right) ^ { ( 1 ) } - \left( \mathrm { D } _ { h - 1 } ^ { \circ } L \right) ^ { ( T ) } } & { : t = S - 1 . } \end{array} \right. } \end{array}
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
Circular finite differences for a sequence $L ^ { ( 0 ) } , \ldots , L ^ { ( S - 1 ) }$ are defined similarly to finite differences (Definition 4.1) except that unlike for finite differences, where (Dh L) (S h) , $\left( \mathrm { D } _ { h } \cal L \right) ^ { ( S - h ) } , . . . , \left( \mathrm { D } _ { h } \cal L \right) ^ { ( S - 1 ) }$ are not defined, (D h L) (S h) , $\big ( \mathrm { D } _ { h } ^ { \circ } L \big ) ^ { ( S - h ) } , \ldots , \big ( \mathrm { D } _ { h } ^ { \circ } L \big ) ^ { ( S - 1 ) }$ are defined by “wrapping around” back to the beginning of the sequence. The above-described reductions, which are worked out in detail in Section C.2, allow us to reduce proving Lemma 4.7 to proving the following simpler lemma:
|
| 220 |
+
|
| 221 |
+
Lemma 4.8. Suppose $\mu \in \mathbb { R } , \alpha > 0$ , and $W ^ { ( 0 ) } , \ldots , W ^ { ( S - 1 ) } \in \mathbb { R }$ is a sequence of reals satisfying
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
\begin{array} { c } { \displaystyle \sum _ { t = 0 } ^ { S - 1 } \left( ( \mathrm { D } _ { 2 } ^ { \circ } W ) ^ { ( t ) } \right) ^ { 2 } \leq \alpha \cdot \displaystyle \sum _ { t = 0 } ^ { S - 1 } \left( ( \mathrm { D } _ { 1 } ^ { \circ } W ) ^ { ( t ) } \right) ^ { 2 } + \mu . } \\ { \displaystyle \neg s - 1 \left( ( \mathrm { D } _ { 1 } ^ { \circ } W ) ^ { ( t ) } \right) ^ { 2 } \leq \alpha \cdot \sum _ { t = 1 } ^ { S - 1 } ( W ^ { ( t ) } ) ^ { 2 } + \mu / \alpha . } \end{array}
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
To prove Lemma 4.8, we apply the discrete Fourier transform to both sides of (14) and use the CauchySchwarz inequality in frequency dFourier transform is the sequence ence defi $W ^ { ( 0 ) } , \ldots , W ^ { ( S - 1 ) } \in \mathbb { R }$ . $\widehat { W } ^ { ( 0 ) } , \ldots , \widehat { W } ^ { ( S - \overline { { 1 } } ) }$ $\begin{array} { r } { \widehat { W } ^ { ( s ) } = \sum _ { t = 0 } ^ { S - 1 } W ^ { ( t ) } \cdot e ^ { - \frac { 2 \pi i s t } { S } } } \end{array}$ Below we prove Lemma 4.8 for the special case $\mu = 0$ ; we defer the general case to Section C.1.
|
| 228 |
+
|
| 229 |
+
Proof of Lemma 4.8 for special case $\mu = 0$ . We have the following:
|
| 230 |
+
|
| 231 |
+
$$
|
| 232 |
+
\sum _ { i = 1 } ^ { r } ( ( \mathrm { D } _ { 1 } ^ { \circ } W ) ^ { ( t ) } ) ^ { 2 } = \sum _ { s = 1 } ^ { T } | \widehat { \mathrm { D } _ { 1 } ^ { \circ } W } ^ { ( s ) } | ^ { 2 } = \sum _ { s = 1 } ^ { T } | \widehat { W } ^ { ( s ) } ( e ^ { 2 \pi i s / T - 1 } ) | ^ { 2 } \leq \sqrt { \sum _ { s = 1 } ^ { T } | \widehat { W } ^ { ( s ) } | ^ { 2 } } \sqrt { \sum _ { s = 1 } ^ { T } | \widehat { W } ^ { ( s ) } | ^ { 2 } | e ^ { 2 \pi } }
|
| 233 |
+
$$
|
| 234 |
+
|
| 235 |
+
where the first equality uses Parseval’s equality, the second uses Fact C.3 (in the appendix) for $h = 1$ , and the inequality uses Cauchy-Schwarz. By Parseval’s inequality and Fact C.3 for $h = 2$ , the righthand side of the above equals $S \cdot \sqrt { \textstyle \sum _ { t = 1 } ^ { T } ( W ^ { ( t ) } ) ^ { 2 } } \cdot \sqrt { \textstyle \sum _ { t = 1 } ^ { T } \left( \big ( \mathrm { D } _ { 2 } ^ { \circ } W \big ) ^ { ( t ) } \right) ^ { 2 } }$ , which, by assumption, is $\operatorname { a t } \operatorname { m o s t } S \cdot { \sqrt { \sum _ { t = 1 } ^ { T } ( W ^ { ( t ) } ) ^ { 2 } } } \cdot { \sqrt { \alpha \cdot \sum _ { t = 1 } ^ { T } \left( \left( \mathrm { D } _ { 1 } ^ { \circ } W \right) ^ { ( t ) } \right) ^ { 2 } } }$ . Rearranging terms completes the proof.
|
| 236 |
+
|
| 237 |
+
# Acknowledgments and Disclosure of Funding
|
| 238 |
+
|
| 239 |
+
C.D. is Supported by NSF Awards CCF-1901292, DMS-2022448 and DMS-2134108, by a Simons Investigator Award, by the Simons Collaboration on the Theory of Algorithmic Fairness, by a DSTA grant, and by the DOE PhILMs project (No. DE-AC05-76RL01830). N.G. is supported by a Fannie & John Hertz Foundation Fellowship and an NSF Graduate Fellowship.
|
| 240 |
+
|
| 241 |
+
# References
|
| 242 |
+
|
| 243 |
+
[AIMM21] Waïss Azizian, Franck Iutzeler, Jérome Malick, and Panayotis Mertikopoulos. The last-iterate convergence rate of optimistic mirror descent in stochastic variational inequalities. In Conference on Learning Theory, pages 1–32, 2021.
|
| 244 |
+
[BCM12] Maria-Florina Balcan, Florin Constantin, and Ruta Mehta. The Weighted Majority Algorithm does not Converge in Nearly Zero-sum Games. In ICML Workshop on Markets, Mechanisms, and Multi-Agent Models, 2012.
|
| 245 |
+
[Bla54] David Blackwell. Controlled Random Walks. In Proceedings of the International Congress of Mathematicians, volume 3, pages 336–338, 1954.
|
| 246 |
+
[BP18] James P. Bailey and Georgios Piliouras. Multiplicative Weights Update in Zero-Sum Games. In Proceedings of the 2018 ACM Conference on Economics and Computation - EC ’18, pages 321–338, Ithaca, NY, USA, 2018. ACM Press.
|
| 247 |
+
[BP19] James P. Bailey and Georgios Piliouras. Fast and furious learning in zero-sum games: Vanishing regret with non-vanishing step sizes. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 12977–12987, 2019.
|
| 248 |
+
[Bro49] George W Brown. Some Notes on Computation of Games Solutions. Technical report, RAND CORP SANTA MONICA CA, 1949.
|
| 249 |
+
[Bub15] Sébastien Bubeck. Convex Optimization: Algorithms and Complexity. Found. Trends Mach. Learn., 8(3–4):231–357, November 2015.
|
| 250 |
+
[CBL06] Nicolo Cesa-Bianchi and Gábor Lugosi. Prediction, Learning, and Games. Cambridge university press, 2006.
|
| 251 |
+
[CDT09] Xi Chen, Xiaotie Deng, and Shang-Hua Teng. Settling the complexity of computing two-player nash equilibria. Journal of the ACM (JACM), 56(3):1–57, 2009.
|
| 252 |
+
[CP19] Yun Kuen Cheung and Georgios Piliouras. Vortices instead of equilibria in minmax optimization: Chaos and butterfly effects of online learning in zero-sum games. In Proceedings of the ThirtySecond Conference on Learning Theory, pages 807–834, 2019.
|
| 253 |
+
[CP20] Xi Chen and Binghui Peng. Hedging in games: Faster convergence of external and swap regrets. In Advances in Neural Information Processing Systems, volume 33, pages 18990–18999. Curran Associates, Inc., 2020.
|
| 254 |
+
[CS04] Imre Csiszár and Paul C. Shields. Information Theory and Statistics: A Tutorial. Commun. Inf. Theory, 1(4):417–528, December 2004.
|
| 255 |
+
[DDK11] Constantinos Daskalakis, Alan Deckelbaum, and Anthony Kim. Near-Optimal No-Regret Algorithms for Zero-Sum Games. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms (SODA), 2011.
|
| 256 |
+
$[ \mathrm { D F P ^ { + } 1 0 } ]$ Constantinos Daskalakis, Rafael Frongillo, Christos H. Papadimitriou, George Pierrakos, and Gregory Valiant. On learning algorithms for nash equilibria. In Proceedings of the Third International Conference on Algorithmic Game Theory, SAGT’10, page 114–125, Berlin, Heidelberg, 2010. Springer-Verlag.
|
| 257 |
+
[DGP06] Constantinos Daskalakis, Paul W. Goldberg, and Christos H. Papadimitriou. The complexity of computing a nash equilibrium. In Proceedings of the Thirty-Eighth Annual ACM Symposium on Theory of Computing (STOC), 2006.
|
| 258 |
+
[DP14] Constantinos Daskalakis and Qinxuan Pan. A counter-example to Karlin’s strong conjecture for fictitious play. In Proceedings of the 55th Annual Symposium on Foundations of Computer Science (FOCS), 2014.
|
| 259 |
+
[DP19] Constantinos Daskalakis and Ioannis Panageas. Last-iterate convergence: Zero-sum games and constrained min-max optimization. In 10th Innovations in Theoretical Computer Science Conference, ITCS 2019, January 10-12, 2019, San Diego, California, USA, volume 124 of LIPIcs, pages 27:1–27:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019.
|
| 260 |
+
$[ \mathrm { F L L ^ { + } } 1 6 ]$ Dylan J Foster, Zhiyuan Li, Thodoris Lykouris, Karthik Sridharan, and Eva Tardos. Learning in games: Robustness of fast convergence. In Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
|
| 261 |
+
[GKP89] Ronald L. Graham, Donald E. Knuth, and Oren Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, Reading, 1989.
|
| 262 |
+
[GPD20] Noah Golowich, Sarath Pattathil, and Constantinos Daskalakis. Tight last-iterate convergence rates for no-regret learning in multi-player games. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
|
| 263 |
+
[HAM21] Yu-Guan Hsieh, Kimon Antonakopoulos, and Panayotis Mertikopoulos. Adaptive learning in continuous games: Optimal regret bounds and convergence to nash equilibrium. In Conference on Learning Theory, 2021.
|
| 264 |
+
[Han57] James Hannan. Approximation to Bayes risk in repeated play. Contributions to the Theory of Games, 3:97–139, 1957.
|
| 265 |
+
$[ \mathrm { H M c W ^ { + } } 0 3 ]$ ] Hart, Andreu Mas-colell, Of Jörgen W. Weibull, O Vega, Drew Fudenberg, David K. Levine, Josef Hofbauer, Karl Sigmund, Eric Maskin, Motty Perry, and Er Vasin. Uncoupled dynamics do not lead to nash equilibrium. Amer. Econ. Rev, pages 1830–1836, 2003.
|
| 266 |
+
[KHSC18] Ehsan Asadi Kangarshahi, Ya-Ping Hsieh, Mehmet Fatih Sahin, and Volkan Cevher. Let’s be honest: An optimal no-regret framework for zero-sum games. In Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 2488–2496. PMLR, 10–15 Jul 2018.
|
| 267 |
+
[KLP11] Robert Kleinberg, Katrina Ligett, and Georgios Piliouras. Beyond the nash equilibrium barrier. In In Innovations in Computer Science (ICS, pages 125–140, 2011.
|
| 268 |
+
[LGNPw21] Qi Lei, Sai Ganesh Nagarajan, Ioannis Panageas, and xiao wang. Last iterate convergence in no-regret learning: constrained min-max optimization for convex-concave landscapes. In Arindam Banerjee and Kenji Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 1441–1449. PMLR, 13–15 Apr 2021.
|
| 269 |
+
[MPP18] Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’18, page 2703–2717, USA, 2018. Society for Industrial and Applied Mathematics.
|
| 270 |
+
[Nes05] Yu Nesterov. Excessive gap technique in nonsmooth convex minimization. SIAM Journal on Optimization, 16(1):235–249, 2005.
|
| 271 |
+
[PP16] Christos Papadimitriou and Georgios Piliouras. From nash equilibria to chain recurrent sets: Solution concepts and topology. In Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science, ITCS ’16, page 227–235, New York, NY, USA, 2016. Association for Computing Machinery.
|
| 272 |
+
[Rob51] Julia Robinson. An Iterative Method of Solving a Game. Annals of mathematics, pages 296–301, 1951.
|
| 273 |
+
[Rou09] Tim Roughgarden. Intrinsic robustness of the price of anarchy. In Proceedings of the Forty-First Annual ACM Symposium on Theory of Computing, STOC ’09, page 513–522, New York, NY, USA, 2009. Association for Computing Machinery.
|
| 274 |
+
[RS13a] Alexander Rakhlin and Karthik Sridharan. Online learning with predictable sequences. In Proceedings of the 26th Annual Conference on Learning Theory, pages 993–1019, 2013.
|
| 275 |
+
[RS13b] Alexander Rakhlin and Karthik Sridharan. Optimization, Learning, and Games with Predictable Sequences. arXiv:1311.1869 [cs], November 2013. arXiv: 1311.1869.
|
| 276 |
+
[RST17] Tim Roughgarden, Vasilis Syrgkanis, and Éva Tardos. The price of anarchy in auctions. J. Artif. Int. Res., 59(1):59–101, May 2017.
|
| 277 |
+
[SALS15] Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E Schapire. Fast convergence of regularized learning in games. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc., 2015.
|
| 278 |
+
[Sha64] L. Shapley. Some Topics in Two-Person Games. Advances in Game theory, 1964.
|
| 279 |
+
[ST13] Vasilis Syrgkanis and Eva Tardos. Composable and efficient mechanisms. In Proceedings of the Forty-Fifth Annual ACM Symposium on Theory of Computing, STOC ’13, page 211–220, New York, NY, USA, 2013. Association for Computing Machinery.
|
| 280 |
+
[VGFL $^ { + } 2 0 ]$ 1 Emmanouil-Vasileios Vlatakis-Gkaragkounis, Lampros Flokas, Thanasis Lianeas, Panayotis Mertikopoulos, and Georgios Piliouras. No-regret learning and mixed nash equilibria: They do not mix. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1380–1391. Curran Associates, Inc., 2020.
|
| 281 |
+
[WL18] Chen-Yu Wei and Haipeng Luo. More adaptive algorithms for adversarial bandits. In Proceedings of the 31st Conference On Learning Theory, pages 1263–1291, 2018.
|
| 282 |
+
[WLZL21] Chen-Yu Wei, Chung-Wei Lee, Mengxiao Zhang, and Haipeng Luo. Linear last-iterate convergence in constrained saddle-point optimization. In International Conference on Learning Representations, 2021.
|
| 283 |
+
|
| 284 |
+
# Checklist
|
| 285 |
+
|
| 286 |
+
1. For all authors...
|
| 287 |
+
|
| 288 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 289 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 290 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 291 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 292 |
+
|
| 293 |
+
2. If you are including theoretical results...
|
| 294 |
+
|
| 295 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Sections 2 and 3.
|
| 296 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] See Section 4 and the appendix (in the supplementary material).
|
| 297 |
+
|
| 298 |
+
3. If you ran experiments...
|
| 299 |
+
|
| 300 |
+
(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]
|
| 301 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
|
| 302 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
|
| 303 |
+
(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]
|
| 304 |
+
|
| 305 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 306 |
+
|
| 307 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 308 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 309 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 310 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 311 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 312 |
+
|
| 313 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 314 |
+
|
| 315 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 316 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 317 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/gV3wdEOGy_V/gV3wdEOGy_V.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/jLoC4ez43PZ/jLoC4ez43PZ.md
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRAPHCODEBERT: PRE-TRAINING CODE REPRESENTATIONS WITH DATA FLOW
|
| 2 |
+
|
| 3 |
+
Daya $\mathbf { G u o ^ { 1 * } }$ , Shuo $ { \mathbf { R e n } } ^ { 2 * }$ , Shuai $\mathbf { L u ^ { 3 * } }$ , Zhangyin $\mathbf { F e n g ^ { 4 * } }$ , Duyu Tang5, Shujie $\mathbf { L i u ^ { 5 } }$ , Long Zhou5, Nan Duan5, Alexey Svyatkovskiy6, Shengyu $\mathbf { F u } ^ { 6 }$ , Michele Tufano6, Shao Kun Deng6, Colin Clement6, Dawn Drain6, Neel Sundaresan6, Jian $\mathbf { Y i n } ^ { 1 }$ , Daxin Jiang7, and Ming Zhou5
|
| 4 |
+
|
| 5 |
+
1School of Computer Science and Engineering, Sun Yat-sen University.
|
| 6 |
+
2Beihang University, 3Peking University, 4Harbin Institute of Technology,
|
| 7 |
+
5Microsoft Research Asia, 6Microsoft Devdiv, 7Microsoft STCA
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Pre-trained models for programming language have achieved dramatic empirical improvements on a variety of code-related tasks such as code search, code completion, code summarization, etc. However, existing pre-trained models regard a code snippet as a sequence of tokens, while ignoring the inherent structure of code, which provides crucial code semantics and would enhance the code understanding process. We present GraphCodeBERT, a pre-trained model for programming language that considers the inherent structure of code. Instead of taking syntactic-level structure of code like abstract syntax tree (AST), we use data flow in the pre-training stage, which is a semantic-level structure of code that encodes the relation of “wherethe-value-comes-from” between variables. Such a semantic-level structure is less complex and does not bring an unnecessarily deep hierarchy of AST, the property of which makes the model more efficient. We develop GraphCodeBERT based on Transformer. In addition to using the task of masked language modeling, we introduce two structure-aware pre-training tasks. One is to predict code structure edges, and the other is to align representations between source code and code structure. We implement the model in an efficient way with a graph-guided masked attention function to incorporate the code structure. We evaluate our model on four tasks, including code search, clone detection, code translation, and code refinement. Results show that code structure and newly introduced pre-training tasks can improve GraphCodeBERT and achieves state-of-the-art performance on the four downstream tasks. We further show that the model prefers structure-level attentions over token-level attentions in the task of code search.1
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Pre-trained models such as ELMo (Peters et al., 2018), GPT (Radford et al., 2018) and BERT (Devlin et al., 2018) have led to strong improvement on numerous natural language processing (NLP) tasks. These pre-trained models are first pre-trained on a large unsupervised text corpus, and then fine-tuned on downstream tasks. The success of pre-trained models in NLP also promotes the development of pre-trained models for programming language. Existing works (Kanade et al., 2019; Karampatsis & Sutton, 2020; Feng et al., 2020; Svyatkovskiy et al., 2020; Buratti et al., 2020) regard a source code as a sequence of tokens and pre-train models on source code to support code-related tasks such as code search, code completion, code summarization, etc. However, previous works only utilize source code for pre-training, while ignoring the inherent structure of code. Such code structure provides useful semantic information of code, which would benefit the code understanding process. Taking the expression $v = m a x . v a l u e - m i n \_ v a l u e$ as an example, $v$ is computed from max value and min value. Programmers do not always follow the naming conventions so that it’s hard to understand the semantic of the variable $v$ only from its name. The semantic structure of code provides a way to understand the semantic of the variable $v$ by leveraging dependency relation between variables.
|
| 16 |
+
|
| 17 |
+
In this work, we present GraphCodeBERT, a pre-trained model for programming language that considers the inherent structure of code. Instead of taking syntactic-level structure of code like abstract syntax tree (AST), we leverage semantic-level information of code, i.e. data flow, for pretraining. Data flow is a graph, in which nodes represent variables and edges represent the relation of “where-the-value-comes-from” between variables. Compared with AST, data flow is less complex and does not bring an unnecessarily deep hierarchy, the property of which makes the model more efficient. In order to learn code representation from source code and code structure, we introduce two new structure-aware pre-training tasks. One is data flow edges prediction for learning representation from code structure, and the other is variable-alignment across source code and data flow for aligning representation between source code and code structure. GraphCodeBERT is based on Transformer neural architecture (Vaswani et al., 2017) and we extend it by introducing a graph-guided masked attention function to incorporate the code structure.
|
| 18 |
+
|
| 19 |
+
We pre-train GraphCodeBERT on the CodeSearchNet dataset (Husain et al., 2019), which includes $2 . 3 \mathbf { M }$ functions of six programming languages paired with natural language documents. We evaluate the model on four downstream tasks: natural language code search, clone detection, code translation, and code refinement. Experiments show that our model achieves state-of-the-art performance on the four tasks. Further analysis shows that code structure and newly introduced pre-training tasks can improve GraphCodeBERT and the model has consistent preference for attending data flow.
|
| 20 |
+
|
| 21 |
+
In summary, the contributions of this paper are: (1) GraphCodeBERT is the first pre-trained model that leverages semantic structure of code to learn code representation. (2) We introduce two new structure-aware pre-training tasks for learning representation from source code and data flow. (3) GraphCodeBERT provides significant improvement on four downstream tasks, i.e. code search, clone detection, code translation, and code refinement.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORKS
|
| 24 |
+
|
| 25 |
+
Pre-Trained Models for Programming Languages Inspired by the big success of pre-training in NLP (Devlin et al., 2018; Yang et al., 2019; Liu et al., 2019; Raffel et al., 2019), pre-trained models for programming languages also promotes the development of code intelligence (Kanade et al., 2019; Feng et al., 2020; Karampatsis & Sutton, 2020; Svyatkovskiy et al., 2020; Buratti et al., 2020). Kanade et al. (2019) pre-train a BERT model on a massive corpus of Python source codes by masked language modeling and next sentence prediction objectives. Feng et al. (2020) propose CodeBERT, a bimodal pre-trained model for programming and natural languages by masked language modeling and replaced token detection to support text-code tasks such as code search. Karampatsis & Sutton (2020) pre-train contextual embeddings on a JavaScript corpus using the ELMo framework for program repair task. Svyatkovskiy et al. (2020) propose GPT-C, which is a variant of the GPT-2 trained from scratch on source code data to support generative tasks like code completion. Buratti et al. (2020) present C-BERT, a transformer-based language model pre-trained on a collection of repositories written in C language, and achieve high accuracy in the abstract syntax tree (AST) tagging task.
|
| 26 |
+
|
| 27 |
+
Different with previous works, GraphCodeBERT is the first pre-trained model that leverages code structure to learn code representation to improve code understanding. We further introduce a graphguided masked attention function to incorporate the code structure into Transformer and two new structure-aware pre-training tasks to learn representation from source code and code structure.
|
| 28 |
+
|
| 29 |
+
Neural Networks with Code Structure In recent years, some neural networks leveraging code structure such as AST have been proposed and achieved strong performance in code-related tasks like code completion (Li et al., 2017; Alon et al., 2019; Kim et al., 2020), code generation (Rabinovich et al., 2017; Yin & Neubig, 2017; Brockschmidt et al., 2018), code clone detection (Wei & Li, 2017; Zhang et al., 2019; Wang et al., 2020), code summarization (Alon et al., 2018; Hu et al., 2018) and so on (Nguyen & Nguyen, 2015; Allamanis et al., 2018; Hellendoorn et al., 2019). Nguyen & Nguyen (2015) propose an AST-based language model to support the detection and suggestion of a syntactic template at the current editing location. Allamanis et al. (2018) use graphs to represent programs and graph neural network to reason over program structures. Hellendoorn et al. (2019) propose two different architectures using a gated graph neural network and Transformers for combining local and global information to leverage richly structured representations of source code. However, these works leverage code structure to learn models on specific tasks from scratch without using pre-trained models. In this work, we study how to leverage code structure for pre-training code representation.
|
| 30 |
+
|
| 31 |
+
# 3 DATA FLOW
|
| 32 |
+
|
| 33 |
+
In this section, we describe the basic concept and extraction of data flow. In next section, we will describe how to use data flow for pre-training.
|
| 34 |
+
|
| 35 |
+
Data flow is a graph that represents dependency relation between variables, in which nodes represent variables and edges represent where the value of each variable comes from. Unlike AST, data flow is same under different abstract grammars for the same source code. Such code structure provides crucial code semantic information for code understanding. Taking $v = m a x \_ v a l u e - m i n \_ v a l u e$ as an example, programmers do not always follow the naming conventions so that it is hard to understand the semantic of the variable. Data flow provides a way to understand the semantic of the variable $v$ to some extent, i.e. the value of $v$ comes from max value and min value in data flow. Besides, data flow supports the model to consider long-range dependencies induced by using the same variable or function in distant locations. Taking Figure 1 as an example, there are four variables with same name (i.e. $x ^ { 3 }$ , $x ^ { 7 }$ , $x ^ { 9 }$ and $x ^ { 1 1 }$ ) but with different semantic. The graph in the figure shows dependency relation between these variables and supports $x ^ { 1 1 }$ to pay more attention to $x ^ { 7 }$ and $x ^ { 9 }$ instead of $x ^ { \mathrm { { 3 } } }$ Next, we describe how to extract data flow from a source code.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: The procedure of extracting data flow given a source code. The graph in the rightmost is data flow that represents the relation of ”where-the-value-comes-from” between variables.
|
| 39 |
+
|
| 40 |
+
Figure 1 shows the extraction of data flow through a source code. Given a source code $C =$ $\{ c _ { 1 } , . c _ { 2 } , . . . , c _ { n } \}$ , we first parse the code into an abstract syntax tree (AST) by a standard compiler $\mathrm { \ t o o l } ^ { 2 }$ . The AST includes syntax information of the code and terminals (leaves) are used to identify the variable sequence, denoted as $V = \{ v _ { 1 } , v _ { 2 } , . . . , v _ { k } \}$ . We take each variable as a node of the graph and an direct edge $\varepsilon = \langle v _ { i } , v _ { j } \rangle$ from $v _ { i }$ to $v _ { j }$ refers that the value of $j$ -th variable comes from $i$ -th variable. Taking $x = e x p r$ as an example, edges from all variables in expr to $x$ are added into the graph. We denote the set of directed edges as $E = \{ \varepsilon _ { 1 } , \varepsilon _ { 2 } , . . . , \varepsilon _ { l } \}$ and the graph $\mathcal { G } ( C ) = ( V , E )$ is data flow used to represent dependency relation between variables of the source code $C$ .
|
| 41 |
+
|
| 42 |
+
# 4 GRAPHCODEBERT
|
| 43 |
+
|
| 44 |
+
In this section, we describe GraphCodeBERT, a graph-based pre-trained model based on Transformer for programming language. We introduce model architecture, graph-guided masked attention and pre-training tasks including standard masked language model and newly introduced ones. More details about model pre-training setting are provided in the Appendix A.
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: An illustration about GraphCodeBERT pre-training. The model takes source code paired with comment and the corresponding data flow as the input, and is pre-trained using standard masked language modeling (Devlin et al., 2018) and two structure-aware tasks. One structure-aware task is to predict where a variable is identified from (marked with orange lines) and the other is data flow edges prediction between variables (marked with blue lines).
|
| 48 |
+
|
| 49 |
+
# 4.1 MODEL ARCHITECTURE
|
| 50 |
+
|
| 51 |
+
Figure 2 shows the model architecture of GraphCodeBERT. We follow BERT (Devlin et al., 2018) and use the multi-layer bidirectional Transformer (Vaswani et al., 2017) as the model backbone. Instead of only using source code, we also utilize paired comments to pre-train the model to support more code-related tasks involving natural language such as natural language code search (Feng et al., 2020). We further take data flow, which is a graph, as a part of the input to the model.
|
| 52 |
+
|
| 53 |
+
Given a source code $C = \{ c _ { 1 } , c _ { 2 } , . . . , c _ { n } \}$ with its comment $W = \{ w _ { 1 } , w _ { 2 } , . . . , w _ { m } \}$ , we can obtain the corresponding data flow $\mathcal { G } ( C ) = ( V , E )$ as discussed in the Section 3, where $V \doteq \{ v _ { 1 } , v _ { 2 } , . . . , v _ { k } \}$ is a set of variables and $E = \{ \varepsilon _ { 1 } , \varepsilon _ { 2 } , . . . , \varepsilon _ { l } \}$ is a set of direct edges that represent where the value of each variable comes from. We concatenate the comment, source code and the set of variables as the sequence input $X = \{ [ C L S ] , W , [ S E P ] , C , [ S E P ] , V \}$ , where $[ C L S ]$ is a special token in front of three segments and $[ S E P ]$ is a special symbol to split two kinds of data types.
|
| 54 |
+
|
| 55 |
+
GraphCodeBERT takes the sequence $X$ as the input and then converts the sequence into input vectors $H ^ { 0 }$ . For each token, its input vector is constructed by summing the corresponding token and position embeddings. We use a special position embedding for all variables to indicate that they are nodes of data flow. The model applies $_ \mathrm { N }$ transformer layers over the input vectors to produce contextual representations $H ^ { n } = t r a n s f o r m e r _ { n } ( H ^ { n - 1 } ) , \stackrel { . } { n } \in [ 1 , N ]$ . Each transformer layer contains an architecturally identical transformer that applies a multi-headed self-attention operation (Vaswani et al., 2017) followed by a feed forward layer over the input $H ^ { n - 1 }$ in the $n$ -th layer.
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\begin{array} { c } { { G ^ { n } = L N ( M u l t i A t t n ( H ^ { n - 1 } ) + H ^ { n - 1 } ) } } \\ { { H ^ { n } = L N ( F F N ( G ^ { n } ) + G ^ { n } ) } } \end{array}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where M ultiAttn is a multi-headed self-attention mechanism, $F F N$ is a two layers feed forward network, and $L N$ represents a layer normalization operation. For the $n$ -th transformer layer, the output $\hat { G } ^ { n }$ of a multi-headed self-attention is computed via:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { c } { Q _ { i } = H ^ { n - 1 } W _ { i } ^ { Q } , K _ { i } = H ^ { n - 1 } W _ { i } ^ { K } , V _ { i } = H ^ { n - 1 } W _ { i } ^ { V } } \\ { \displaystyle h e a d _ { i } = \mathrm { s o f t m a x } ( \frac { \mathrm { Q _ { i } } \mathrm { K _ { i } ^ { T } } } { \sqrt { \mathrm { d _ { k } } } } + \mathrm { M } ) \mathrm { V _ { i } } } \\ { \hat { G } ^ { n } = [ h e a d _ { 1 } ; . . . ; h e a d _ { u } ] W _ { n } ^ { O } } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where the previous layer’s output $H ^ { n - 1 } \in \mathbb { R } ^ { | X | \times d _ { h } }$ is linearly projected to a triplet of queries, keys and values using model parameters $W _ { i } ^ { Q } , W _ { i } ^ { K } , W _ { i } ^ { V } \in \mathbb { R } ^ { d _ { h } \times d _ { k } }$ , respectively. $u$ is the number of heads, $d _ { k }$ is the dimension of a head, and $W _ { n } ^ { O } \in \mathbb { R } ^ { d _ { h } \times d _ { h } }$ is the model parameters. $M \in \mathbb { R } ^ { | X | \times | X | }$ is a mask matrix, where $M _ { i j }$ is 0 if $i$ -th token is allowed to attend $j$ -th token otherwise $- \infty$ .
|
| 68 |
+
|
| 69 |
+
# 4.2 GRAPH-GUIDED MASKED ATTENTION
|
| 70 |
+
|
| 71 |
+
To incorporate the graph structure into Transformer, we define a graph-guided masked attention function to filter out irrelevant signals. The attention masking function could avoid the key $k _ { i }$ attended by the query $q _ { j }$ by adding the attention score $q _ { j } ^ { T } k _ { i }$ an infinitely negative value so that the attention weight becomes zero after using a softmax function. To represent dependency relation between variables, a node-query $q _ { v _ { i } }$ is allowed to attend to a node-key $k _ { v _ { j } }$ if there is a direct edge from the node $v _ { j }$ to the node $v _ { i }$ (i.e. $\langle v _ { j } , v _ { i } \rangle \in E )$ or they are the same node (i.e. $i = j$ ). Otherwise, the attention is masked by adding an infinitely negative value into the attention score. To represent the relation between source code tokens and nodes of the data flow, we first define a set $E ^ { ' }$ , where $\langle v _ { i } , c _ { j } \rangle / \langle c _ { j } , v _ { i } \rangle \in E ^ { ' }$ if the variable $v _ { i }$ is identified from the source code token $c _ { j }$ . We then allow the node $q _ { v _ { i } }$ and code $k _ { c _ { j } }$ attend each other if and only if $\langle v _ { i } , c _ { j } \rangle / \langle c _ { j } , v _ { i } \rangle \in E ^ { ' } .$ . More formally, we use the following graph-guided masked attention matrix as the mask matrix $M$ in the equation 4:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
M _ { i j } = \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } q _ { i } \in \{ [ C L S ] , [ S E P ] \} \mathrm { ~ o r ~ } q _ { i } , k _ { j } \in W \cup C \mathrm { ~ o r ~ } \langle q _ { i } , k _ { j } \rangle \in E \cup E ^ { ' } \mathrm { ~ } } \\ { - \infty } & { \mathrm { o t h e r w i s e ~ } } \end{array} \right.
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
# 4.3 PRE-TRAINING TASKS
|
| 78 |
+
|
| 79 |
+
We describe three pre-training tasks used for pre-training GraphCodeBERT in this section. The first task is masked language modeling (Devlin et al., 2018) for learning representation from the source code. The second task is data flow edge prediction for learning representation from data flow, where we first mask some variables’ data flow edges and then let GraphCodeBERT predict those edges. The last task is variable-alignment across source code and data flow for aligning representation between source code and data flow, which predicts where a variable is identified from.
|
| 80 |
+
|
| 81 |
+
Masked Language Modeling We follow Devlin et al. (2018) to apply masked language modeling (MLM) pre-training task. Specially, we sample randomly $15 \%$ of the tokens from the source code and paired comment. We replace them with a [MASK] token $80 \%$ of the time, with a random token $10 \%$ of the time, and leave them unchanged $10 \%$ of the time. The MLM objective is to predict original tokens of these sampled tokens, which has proven effective in previous works (Devlin et al., 2018; Liu et al., 2019; Feng et al., 2020). In particular, the model can leverage the comment context if the source code context is not sufficient to infer the masked code token, encouraging the model to align the natural language and programming language representations.
|
| 82 |
+
|
| 83 |
+
Edge Prediction To learn representation from data flow, we introduce a pre-training task of data flow edges prediction. The motivation is to encourage the model to learn structure-aware representation that encodes the relation of “where-the-value-comes-from” for better code understanding. Specially, we randomly sample $20 \%$ of nodes $V _ { s }$ in data flow, mask direct edges connecting these sampled nodes by add an infinitely negative value in the mask matrix, and then predict these masked edges $E _ { m a s k }$ . Taking the variable $x ^ { \bar { 1 1 } }$ in Figure 2 for an example, we first mask edges $\langle x ^ { 7 } , x ^ { 1 1 } \rangle$ and $\langle x ^ { 9 } , x ^ { 1 1 } \rangle$ in the graph and then let the model to predict these edges. Formally, the pre-training objective of the task is calculated as Equation 7, where $E _ { c } = V _ { s } \times V \cup V \times V _ { s }$ is a set of candidates for edge prediction, $\delta ( e _ { i j } \in E )$ is 1 if $\langle v _ { i } , v _ { j } \rangle \in E$ otherwise 0, and the probability $p _ { e _ { i j } }$ of existing an edge from $i$ -th to $j$ -th node is calculated by dot product following a sigmoid function using representations of two nodes from GraphCodeBERT. To balance positive-negative ratio of examples, we sample negative and positive samples with the same number for $E _ { c }$ .
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathit { l o s s } _ { \mathit { E d g e P r e d } } = - \sum _ { \mathit { e _ { i j } \in E _ { c } } } [ \delta ( \mathit { e _ { i j } \in E _ { m a s k } } ) l o g p _ { e _ { i j } } + ( 1 - \delta ( \mathit { e _ { i j } \in E _ { m a s k } } ) ) l o g ( 1 - p _ { e _ { i j } } ) ]
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Node Alignment To align representation between source code and data flow, we introduce a pretraining task of node alignment across source code and data flow, which is similar to data flow edge prediction. Instead of predicting edges between nodes, we predict edges between code tokens and nodes. The motivation is to encourage the model to align variables and source code according to data flow. Taking Figure 3 for an example, we first mask edges between the variable $x ^ { 1 1 }$ in data flow and code tokens, and then predict which code token the variable $x ^ { 1 1 }$ in data flow is identified from. As we can see, the model could predict that the variable $x ^ { 1 1 }$ is identified form the variable $x$ in the expression “return $\mathbf { X } ^ { \prime \prime }$ according to data flow information (i.e. the value of $x ^ { 1 1 }$ comes from $x ^ { 7 }$ or $x ^ { 9 }$ ).
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: An example of the Node Alignment task.
|
| 93 |
+
|
| 94 |
+
Specially, we randomly sample $20 \%$ nodes $V _ { s } ^ { ' }$ in the graph, mask edges between code tokens and sampled nodes, and then predict masked edges $E _ { m a s k } ^ { ' }$ . The pre-training objective of this task is similar to Equation 7, where $E _ { c } ^ { ' } = V _ { s } ^ { ' } \times C$ is a set of candidates for node alignment. Similarly, we also sample negative and positive samples with the same number for $E _ { c } ^ { ' }$ .
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathit { l o s s } _ { N o d e A l i g n } = - \sum _ { e _ { i j } \in E _ { c } ^ { \prime } } [ \delta ( e _ { i j } \in E _ { m a s k } ^ { \prime } ) l o g { p _ { e _ { i j } } } + ( 1 - \delta ( e _ { i j } \in E _ { m a s k } ^ { \prime } ) ) l o g ( 1 - p _ { e _ { i j } } ) ]
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 5 EXPERIMENTS
|
| 101 |
+
|
| 102 |
+
We evaluate our model on four downstream tasks, including code search, clone detection, code translation and code refinement. Detailed experimental settings can be found in the Appendix.
|
| 103 |
+
|
| 104 |
+
# 5.1 NATURAL LANGUAGE CODE SEARCH
|
| 105 |
+
|
| 106 |
+
Given a natural language as the input, the task aims to find the most semantically related code from a collection of candidate codes. We conduct experiments on the CodeSearchNet code corpus (Husain et al., 2019), which includes six programming languages. Different from the dataset and the setting used in the Husain et al. (2019), we filter low-quality queries by handcrafted rules and expand 1000 candidates to the whole code corpus, which is closer to the real-life scenario. We use Mean Reciprocal Rank (MRR) as our evaluation metric and report results of existing methods in the Table 1. We provide more details about the filtered dataset and also give results using the same setting of Husain et al. (2019) in the Appendix B.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>model</td><td>Ruby</td><td>Javascript</td><td>Go</td><td>Python</td><td>Java</td><td>Php</td><td>Overall</td></tr><tr><td>NBow</td><td>0.162</td><td>0.157</td><td>0.330</td><td>0.161</td><td>0.171</td><td>0.152</td><td>0.189</td></tr><tr><td>CNN</td><td>0.276</td><td>0.224</td><td>0.680</td><td>0.242</td><td>0.263</td><td>0.260</td><td>0.324</td></tr><tr><td>BiRNN</td><td>0.213</td><td>0.193</td><td>0.688</td><td>0.290</td><td>0.304</td><td>0.338</td><td>0.338</td></tr><tr><td>selfAtt</td><td>0.275</td><td>0.287</td><td>0.723</td><td>0.398</td><td>0.404</td><td>0.426</td><td>0.419</td></tr><tr><td>RoBERTa</td><td>0.587</td><td>0.517</td><td>0.850</td><td>0.587</td><td>0.599</td><td>0.560</td><td>0.617</td></tr><tr><td>RoBERTa (code)</td><td>0.628</td><td>0.562</td><td>0.859</td><td>0.610</td><td>0.620</td><td>0.579</td><td>0.643</td></tr><tr><td>CodeBERT</td><td>0.679</td><td>0.620</td><td>0.882</td><td>0.672</td><td>0.676</td><td>0.628</td><td>0.693</td></tr><tr><td>GraphCodeBERT</td><td>0.703</td><td>0.644</td><td>0.897</td><td>0.692</td><td>0.691</td><td>0.649</td><td>0.713</td></tr></table>
|
| 109 |
+
|
| 110 |
+
Table 1: Results on code search. GraphCodeBERT outperforms other models significantly $( p < 0 . 0 1 )$ .
|
| 111 |
+
|
| 112 |
+
All models calculate inner product of code and query encodings as relevance scores to rank candidate codes. We follow Husain et al. (2019) to implement four methods as baselines in the first group to obtain the encodings, including bag-of-words, convolutional neural network, bidirectional recurrent neural network, and multi-head attention. The second group is the results of pre-trained models. Roberta (Liu et al., 2019) is a pre-trained model on text corpus with MLM learning objective, while RoBERTa (code) is pre-trained only on code. CodeBERT (Feng et al., 2020) is pre-trained on code-text pairs with MLM and replaced token detection learning objectives. As we can see, GraphCodeBERT that leverages code structure for pre-training brings a $2 \%$ gain of MRR, achieving the state-of-art performance. We also conducted t-test between our GraphCodeBERT and other baselines, and the results show the improvements are significant with $p < 0 . 0 1$ .
|
| 113 |
+
|
| 114 |
+
# 5.2 CODE CLONE DETECTION
|
| 115 |
+
|
| 116 |
+
Code clones are multiple code fragments that output similar results when given the same input. The task aims to measure the similarity between two code fragments, which can help reduce the cost of software maintenance and prevent bugs. We conduct experiments on the BigCloneBench dataset (Svajlenko et al., 2014) and report results in the Table 2.
|
| 117 |
+
|
| 118 |
+
Deckard (Jiang et al., 2007) is to compute vectors for structural information within ASTs and then a Locality Sensitive Hashing (LSH) (Datar et al., 2004) is used to cluster similar vectors for detection. RtvNN (White et al., 2016) trains a recursive autoencoder to learn representations for AST. CDLH (Wei & Li, 2017) learn representations of code fragments via AST-based LSTM and hamming distance is used to optimize the distance between the vector representation of AST pairs.
|
| 119 |
+
|
| 120 |
+
ASTNN Zhang et al. (2019) uses RNNs to encode AST subtrees for statements, then feed the encodings of all statement trees into an RNN to learn representation for a program. FA-AST-GMN (Wang et al., 2020) uses GNNs over a flow-augmented AST to leverages explicit control and data flow information for code clone detection. Results show that our GraphCodeBERT that leverages code structure information significantly outperforms other methods with $p ~ < ~ 0 . 0 1$ , which demonstrates the effectiveness of our pre-trained model for the task of code clone detection.
|
| 121 |
+
|
| 122 |
+
Table 2: Results on code clone detection. GraphCodeBERT outperforms other pre-trained methods significantly $( p < 0 . 0 1 )$ ).
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Deckard RtvNN</td><td>0.93</td><td>0.02</td><td>0.03</td></tr><tr><td>CDLH</td><td>0.95</td><td>0.01</td><td>0.01</td></tr><tr><td>ASTNN</td><td>0.92</td><td>0.74</td><td>0.82</td></tr><tr><td>FA-AST-GMN</td><td>0.92</td><td>0.94</td><td>0.93</td></tr><tr><td>RoBERTa (code)</td><td>0.96</td><td>0.94</td><td>0.95</td></tr><tr><td>CodeBERT</td><td>0.960</td><td>0.955</td><td>0.957</td></tr><tr><td></td><td>0.964</td><td>0.966</td><td>0.965</td></tr><tr><td>GraphCodeBERT</td><td>0.973</td><td>0.968</td><td>0.971</td></tr></table>
|
| 125 |
+
|
| 126 |
+
# 5.3 CODE TRANSLATION
|
| 127 |
+
|
| 128 |
+
Code translation aims to migrate legacy software from one programming language in a platform to another. Following Nguyen et al. (2015) and Chen et al. (2018), we conduct experiments on a dataset crawled from the same several open-source projects as them and report results in the Table 3.
|
| 129 |
+
|
| 130 |
+
The Naive method is directly copying the source code as the translation result. PBSMT is short for phrase-based statistical machine translation (Koehn et al., 2003), and has been exploited in previous works (Nguyen et al., 2013; Karaivanov et al., 2014). As for the Transformer, we use the
|
| 131 |
+
|
| 132 |
+
same number of layers and hidden size as pre-trained models. To leverage the pretrained models for translation, we initialize the encoder with pre-trained models and randomly initialize parameters of the decoder and the source-to-target attention. Results show that the models initialized with pretrained models (i.e the second group) significantly outperform PBSMT and Transformer models. Among them, GraphCodeBERT achieves state-of-art performance, which demonstrates the effectiveness of our model for code translation.
|
| 133 |
+
|
| 134 |
+
Table 3: Results on code translation. GraphCodeBERT outperforms other models significantly $( p < 0 . 0 5 )$ .
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Method</td><td>Java- →C#</td><td colspan="2">C#-→Java</td></tr><tr><td>BLEU</td><td>Acc BLEU</td><td>Acc</td></tr><tr><td>Naive</td><td>18.54 0.0</td><td>18.69</td><td>0.0</td></tr><tr><td>PBSMT</td><td>43.53 12.5</td><td>40.06</td><td>16.1</td></tr><tr><td>Transformer</td><td>55.84</td><td>33.0 50.47</td><td>37.9</td></tr><tr><td>RoBERTa (code)</td><td>77.46</td><td>56.1 71.99</td><td>57.9</td></tr><tr><td>CodeBERT</td><td>79.92</td><td>59.0 72.14</td><td>58.0</td></tr><tr><td>GraphCodeBERT</td><td>80.58</td><td>59.4 72.64</td><td>58.8</td></tr></table>
|
| 137 |
+
|
| 138 |
+
# 5.4 CODE REFINEMENT
|
| 139 |
+
|
| 140 |
+
Code refinement aims to automatically fix bugs in the code, which can contribute to reducing the cost of bug-fixes. We use the dataset released by Tufano et al. (2019) and report results in the Table 4.
|
| 141 |
+
|
| 142 |
+
The Naive method directly copies the buggy code as the refinement result. For the Transformer, we use the same number of layers and hidden size as the pre-trained models. Same as the Section 5.3, we initialize the encoder with pre-trained models and randomly initialize parameters of the decoder
|
| 143 |
+
|
| 144 |
+
and the source-to-target attention. Then we use the training data to fine-tune the whole model. In the table, we see that the Transformer significantly outperforms LSTM. Results in the second group shows that pre-trained models outperform Transformer models further, and GraphCodeBERT achieves better performance than other pre-trained models on both datasets, which shows leveraging code structure information are helpful to the task of code refinement.
|
| 145 |
+
|
| 146 |
+
Table 4: Results on code refinement.
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">small</td><td colspan="2">medium</td></tr><tr><td>BLEU</td><td>Acc</td><td>BLEU</td><td>Acc</td></tr><tr><td>Naive</td><td>78.06</td><td>0.0</td><td>90.91</td><td>0.0</td></tr><tr><td>LSTM Transformer</td><td>76.76</td><td>10.0</td><td>72.08</td><td>2.5</td></tr><tr><td>RoBERTa (code)</td><td>77.21 77.30</td><td>14.7</td><td>89.25</td><td>3.7</td></tr><tr><td>CodeBERT</td><td></td><td>15.9</td><td>90.07</td><td>4.1</td></tr><tr><td></td><td>77.42</td><td>16.4</td><td>91.07</td><td>5.2</td></tr><tr><td>GraphCodeBERT</td><td>80.02</td><td>17.3</td><td>91.31</td><td>9.1</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 5.5 MODEL ANALYSIS
|
| 151 |
+
|
| 152 |
+
Ablation Study We conduct ablation study on the task of natural language code search to understand various components in our approach impact overall performance. We remove two pre-training tasks and data flow, respectively, to analyze their contribution. Table 5 shows that the overall performance drops from $7 1 . 3 \%$ to $7 0 . 3 \% { \sim } 7 0 . 7 \%$ when removing Node Alignment and Edge Prediction pre-training tasks, respectively, which reveals the importance of two structure-aware pre-training tasks. After ablating the data flow totally, we can see that the performance drops from $7 1 . 3 \%$ to $6 9 . 3 \%$ , which means leveraging data flow to learn code representation could improve GraphCodeBERT.
|
| 153 |
+
|
| 154 |
+
Table 5: Ablation study on natural language code search
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Methods</td><td>Ruby</td><td>Javascript</td><td>Go</td><td>Python</td><td>Java</td><td>Php</td><td>Overall</td></tr><tr><td>GraphCodeBERT</td><td>0.703</td><td>0.644</td><td>0.897</td><td>0.692</td><td>0.691</td><td>0.649</td><td>0.713</td></tr><tr><td>-w/o EdgePred</td><td>0.701</td><td>0.632</td><td>0.894</td><td>0.687</td><td>0.688</td><td>0.640</td><td>0.707</td></tr><tr><td>-w/o NodeAlign</td><td>0.685</td><td>0.635</td><td>0.887</td><td>0.682</td><td>0.690</td><td>0.640</td><td>0.703</td></tr><tr><td>-w/o Data Flow</td><td>0.679</td><td>0.620</td><td>0.882</td><td>0.672</td><td>0.676</td><td>0.628</td><td>0.693</td></tr></table>
|
| 157 |
+
|
| 158 |
+
Node-vs. Token-level Attention Table 6 shows how frequently a special token $[ C L S ]$ that is used to calculate probability of correct candidate attends to code tokens (Codes) and variables (Nodes). We see that although the number of nodes account for $5 \% \sim 2 0 \%$ , attentions over nodes overwhelm node/code ratio (around $10 \%$ to $32 \%$ ) across all programming languages. The results indicate that data flow plays an important role in code understanding process and the model pays more attention to nodes in data flow than code tokens.
|
| 159 |
+
|
| 160 |
+
<table><tr><td></td><td>Ruby</td><td>Javascript</td><td>Go</td><td>Python</td><td>Java</td><td>Php</td></tr><tr><td>Codes/Nodes</td><td>90.1/9.9</td><td>94.6/5.4</td><td>95.0/5.03</td><td>80.6/19.4</td><td>93.2/6.8</td><td>87.5/12.5</td></tr><tr><td>[CLS] →Codes/Nodes</td><td>82.3/17.7</td><td>89.7/10.3</td><td>91.0/9.0</td><td>67.7/32.3</td><td>87.8/12.2</td><td>79.4/20.6</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 6: Attention distribution $( \% )$ between code tokens (codes) and variables (nodes) across different programming language on natural language code search test sets. The first row is the ratio of the number of code tokens to nodes, and the second row is attention distribution of $[ C L S ]$ token.
|
| 163 |
+
|
| 164 |
+
Comparison between AST and Data Flow Figure 4 shows MRR score with respect to input sequence length on the validation dataset of Ruby programming language for the task of code search. AST Pre-order Traversal regards AST as a sequence by linearizing all AST nodes using pre-order traversal algorithm. AST Subtree Masking regards AST as a tree and introduce subtree masking (Nguyen et al., 2019) for self-attention of the Transformer. In subtree masking, each node-query in AST attends only to its own subtree descendants, and each leaf-query only attends to leaves of AST. Transformer has a self-attention component with $O ( n ^ { 2 } )$ time and memory complexity where $n$ is the input sequence length, and thus is not efficient to scale to long inputs.
|
| 165 |
+
|
| 166 |
+
We observe that injecting AST even hurts the performance when the sequence length is short (e.g. shorter than 128), while GraphCodeBERT consistently brings performance boost on varying sequence length and obtains better MRR score than AST-based methods. The main reason is that data flow is less complex and the number of nodes account for $5 \% \sim$ $2 0 \%$ (see Table 6), which does not bring an unnecessarily deep hierarchy of AST and makes the model more accurate and efficient.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 4: MRR score on the validation dataset of Ruby for code search with varying length of input sequence.
|
| 170 |
+
|
| 171 |
+
Case Study We also give a case study to demonstrate that data flow would enhance the code understanding process. Given a source code and a comment, we use GraphCodeBERT with and without data flow to predict whether the comment correctly describes the source code. Results are given in Figure 5. We can see that both models make correct prediction in the original example, where the threshold is 0.5 (left panel). To study the code understanding ability of models, we change the source code (center panel) and the comment (right panel), respectively. Although we make a small change on the source code (return $a r e t u r n b$ ) and the comment $( s u m \ v a l u e m e a n \ v a l u e )$ ), the semantic of the source code and the comment are completely different and corresponding gold labels change from 1 to 0. As we can see in the figure, GraphCodeBERT without using data flow fails these tests and still outputs high probability for negative examples. After leveraging data flow, GraphCodeBERT better understands the semantic of source code and makes correct predictions on all tests, which demonstrates that data flow could improve the code understanding ability of the model.
|
| 172 |
+
|
| 173 |
+
Figure 5: We take a comment and a source code as the input (first row), and use GraphCodeBERT with and without data flow to predict the probability of the source code matching the comment (third row). The label is 1 if the comment correctly describes the source code otherwise 0 (second row).
|
| 174 |
+
|
| 175 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Unchanged</td><td rowspan=1 colspan=1>Code:return a →return b</td><td rowspan=1 colspan=1>NL: sum value →mean value</td></tr><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>NL:Return sum value of an arrayCode:import numpy as npdef f(array):a=np.sum(array)b=np.mean(array)return a</td><td rowspan=1 colspan=1>NL:Return sum value of an arrayCode:import numpy as npdef f(array):a=np.sum(array)b=np.mean(array)return b</td><td rowspan=1 colspan=1>NL:Return mean value of an arrayCode:import numpy as npdef f(array):a=np.sum(array)b=np.mean(array)return a</td></tr><tr><td rowspan=1 colspan=1>Label</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Prediction</td><td rowspan=1 colspan=1>GraphCodeBERT: 0.6563 (1)GraphCodeBERT: 0.8728 (1)(w/o Data Flow)</td><td rowspan=1 colspan=1>GraphCodeBERT: 0.4615 (0)GraphCodeBERT: 0.8608 (1)(w/o Data Flow)</td><td rowspan=1 colspan=1>GraphCodeBERT: 0.2884 (0)GraphCodeBERT: 0.9048 (1)(w/o Data Flow)</td></tr></table>
|
| 176 |
+
|
| 177 |
+
# 6 CONCLUSION
|
| 178 |
+
|
| 179 |
+
In this paper, we present GraphCodeBERT that leverages data flow to learn code representation. To the best of our knowledge, this is the first pre-trained model that considers code structure for pre-training code representations. We introduce two structure-aware pre-training tasks and show that GraphCodeBERT achieves state-of-the-art performance on four code-related downstream tasks, including code search, clone detection, code translation and code refinement. Further analysis shows that code structure and newly introduced pre-training tasks boost the performance. Additionally, case study in the task of code search shows that applying data flow in the pre-trained model improves code understanding.
|
| 180 |
+
|
| 181 |
+
# ACKNOWLEDGMENTS
|
| 182 |
+
|
| 183 |
+
Daya Guo and Jian Yin are supported by the Research Foundation of Science and Technology Plan Project in Guangdong Province (2017B030308007).
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations, 2018.
|
| 188 |
+
|
| 189 |
+
Uri Alon, Shaked Brody, Omer Levy, and Eran Yahav. code2seq: Generating sequences from structured representations of code. arXiv preprint arXiv:1808.01400, 2018.
|
| 190 |
+
|
| 191 |
+
Uri Alon, Roy Sadaka, Omer Levy, and Eran Yahav. Structural language models of code. arXiv, pp. arXiv–1910, 2019.
|
| 192 |
+
|
| 193 |
+
Marc Brockschmidt, Miltiadis Allamanis, Alexander L Gaunt, and Oleksandr Polozov. Generative code modeling with graphs. arXiv preprint arXiv:1805.08490, 2018.
|
| 194 |
+
|
| 195 |
+
Luca Buratti, Saurabh Pujar, Mihaela Bornea, Scott McCarley, Yunhui Zheng, Gaetano Rossiello, Alessandro Morari, Jim Laredo, Veronika Thost, Yufan Zhuang, et al. Exploring software naturalness throughneural language models. arXiv preprint arXiv:2006.12641, 2020.
|
| 196 |
+
|
| 197 |
+
Xinyun Chen, Chang Liu, and Dawn Song. Tree-to-tree neural networks for program translation. In Advances in neural information processing systems, pp. 2547–2557, 2018.
|
| 198 |
+
|
| 199 |
+
Mayur Datar, Nicole Immorlica, Piotr Indyk, and Vahab S Mirrokni. Locality-sensitive hashing scheme based on p-stable distributions. In Proceedings of the twentieth annual symposium on Computational geometry, pp. 253–262, 2004.
|
| 200 |
+
|
| 201 |
+
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.
|
| 202 |
+
|
| 203 |
+
Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. Codebert: A pre-trained model for programming and natural languages. arXiv preprint arXiv:2002.08155, 2020.
|
| 204 |
+
|
| 205 |
+
Daya Guo, Duyu Tang, Nan Duan, M. Zhou, and Jian Yin. Dialog-to-action: Conversational question answering over a large-scale knowledge base. In NeurIPS, 2018.
|
| 206 |
+
|
| 207 |
+
Daya Guo, Duyu Tang, Nan Duan, M. Zhou, and Jian Yin. Coupling retrieval and meta-learning for context-dependent semantic parsing. ArXiv, abs/1906.07108, 2019.
|
| 208 |
+
|
| 209 |
+
Vincent J Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis, and David Bieber. Global relational models of source code. In International Conference on Learning Representations, 2019.
|
| 210 |
+
|
| 211 |
+
Xing Hu, Ge Li, Xin Xia, David Lo, and Zhi Jin. Deep code comment generation. In 2018 IEEE/ACM 26th International Conference on Program Comprehension (ICPC), pp. 200–20010. IEEE, 2018.
|
| 212 |
+
|
| 213 |
+
Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. Codesearchnet challenge: Evaluating the state of semantic code search. arXiv preprint arXiv:1909.09436, 2019.
|
| 214 |
+
|
| 215 |
+
Lingxiao Jiang, Ghassan Misherghi, Zhendong Su, and Stephane Glondu. Deckard: Scalable and accurate tree-based detection of code clones. In 29th International Conference on Software Engineering (ICSE’07), pp. 96–105. IEEE, 2007.
|
| 216 |
+
|
| 217 |
+
Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. Pre-trained contextual embedding of source code. arXiv preprint arXiv:2001.00059, 2019.
|
| 218 |
+
|
| 219 |
+
Svetoslav Karaivanov, Veselin Raychev, and Martin Vechev. Phrase-based statistical translation of programming languages. In Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software, pp. 173–184, 2014.
|
| 220 |
+
|
| 221 |
+
Rafael-Michael Karampatsis and Charles Sutton. Scelmo: Source code embeddings from language models. arXiv preprint arXiv:2004.13214, 2020.
|
| 222 |
+
|
| 223 |
+
Seohyun Kim, Jinman Zhao, Yuchi Tian, and Satish Chandra. Code prediction by feeding trees to transformers. arXiv preprint arXiv:2003.13848, 2020.
|
| 224 |
+
|
| 225 |
+
Philipp Koehn, Franz J Och, and Daniel Marcu. Statistical phrase-based translation. Technical report, UNIVERSITY OF SOUTHERN CALIFORNIA MARINA DEL REY INFORMATION SCIENCES INST, 2003.
|
| 226 |
+
|
| 227 |
+
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
|
| 228 |
+
|
| 229 |
+
Jian Li, Yue Wang, Michael R Lyu, and Irwin King. Code completion with neural attention and pointer networks. arXiv preprint arXiv:1711.09573, 2017.
|
| 230 |
+
|
| 231 |
+
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.
|
| 232 |
+
|
| 233 |
+
Anh Tuan Nguyen and Tien N Nguyen. Graph-based statistical language model for code. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering, volume 1, pp. 858–868. IEEE, 2015.
|
| 234 |
+
|
| 235 |
+
Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. Lexical statistical machine translation for language migration. In Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, pp. 651–654, 2013.
|
| 236 |
+
|
| 237 |
+
Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. Divide-and-conquer approach for multi-phase statistical migration for source code (t). In 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 585–596. IEEE, 2015.
|
| 238 |
+
|
| 239 |
+
Xuan-Phi Nguyen, Shafiq Joty, Steven Hoi, and Richard Socher. Tree-structured attention with hierarchical accumulation. In International Conference on Learning Representations, 2019.
|
| 240 |
+
|
| 241 |
+
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.
|
| 242 |
+
|
| 243 |
+
Maxim Rabinovich, Mitchell Stern, and Dan Klein. Abstract syntax networks for code generation and semantic parsing. arXiv preprint arXiv:1704.07535, 2017.
|
| 244 |
+
|
| 245 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. URL https://s3-us-west-2. amazonaws. com/openaiassets/researchcovers/languageunsupervised/language understanding paper. pdf, 2018.
|
| 246 |
+
|
| 247 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019.
|
| 248 |
+
|
| 249 |
+
Jeffrey Svajlenko, Judith F Islam, Iman Keivanloo, Chanchal K Roy, and Mohammad Mamun Mia. Towards a big data curated benchmark of inter-project code clones. In 2014 IEEE International Conference on Software Maintenance and Evolution, pp. 476–480. IEEE, 2014.
|
| 250 |
+
|
| 251 |
+
Alexey Svyatkovskiy, Shao Kun Deng, Shengyu Fu, and Neel Sundaresan. Intellicode compose: Code generation using transformer. arXiv preprint arXiv:2005.08025, 2020.
|
| 252 |
+
|
| 253 |
+
Michele Tufano, Cody Watson, Gabriele Bavota, Massimiliano Di Penta, Martin White, and Denys Poshyvanyk. An empirical study on learning bug-fixing patches in the wild via neural machine translation. ACM Transactions on Software Engineering and Methodology (TOSEM), 28(4):1–29, 2019.
|
| 254 |
+
|
| 255 |
+
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.
|
| 256 |
+
|
| 257 |
+
Wenhan Wang, Ge Li, Bo Ma, Xin Xia, and Zhi Jin. Detecting code clones with graph neural networkand flow-augmented abstract syntax tree. arXiv preprint arXiv:2002.08653, 2020.
|
| 258 |
+
|
| 259 |
+
Huihui Wei and Ming Li. Supervised deep features for software functional clone detection by exploiting lexical and syntactical information in source code. In IJCAI, pp. 3034–3040, 2017.
|
| 260 |
+
|
| 261 |
+
Martin White, Michele Tufano, Christopher Vendome, and Denys Poshyvanyk. Deep learning code fragments for code clone detection. In 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 87–98. IEEE, 2016.
|
| 262 |
+
|
| 263 |
+
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.
|
| 264 |
+
|
| 265 |
+
Pengcheng Yin and Graham Neubig. A syntactic neural model for general-purpose code generation. In The 55th Annual Meeting of the Association for Computational Linguistics (ACL), Vancouver, Canada, July 2017. URL https://arxiv.org/abs/1704.01696.
|
| 266 |
+
|
| 267 |
+
Jian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun, Kaixuan Wang, and Xudong Liu. A novel neural source code representation based on abstract syntax tree. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), pp. 783–794. IEEE, 2019.
|
| 268 |
+
|
| 269 |
+
# A PRE-TRAINING DETAILS
|
| 270 |
+
|
| 271 |
+
GraphCodeBERT includes 12 layers Transformer with 768 dimensional hidden states and 12 attention heads. For fair comparison, we use the same dataset as CodeBERT (Feng et al., 2020) to pretrain our model. The dataset is the CodeSearchNet dataset3 (Husain et al., 2019), which includes 2.3M functions with document pairs for six programming languages. We train the model on two DGX-2 machines, each having 16 NVIDIA Tesla V100 with 32GB memory. We set the max length of sequences and nodes as 512 and 128, respectively. We use the Adam optimizer to update model parameters with 1,024 batch size and 2e-4 learning rate. To accelerate the training process, we adopt the parameters of CodeBERT released by Feng et al. (2020) to initialize the model. The model is trained with 200K batches and costs about 83 hours.
|
| 272 |
+
|
| 273 |
+
At each iteration, we alternate EdgePred and NodeAlign objectives in combination with MLM to pre-train the model. And we follow Lample & Conneau (2019) to sample each batch from the same programming language according to a multinomial distribution with probabilities $\left\{ q _ { i } \right\} _ { i = 1 \ldots N }$ , where $n _ { i }$ is number of examples for $i$ -th programming language and $\alpha { = } 0 . 7$ . Sampling with this distribution could alleviates the bias towards high-resource languages.
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
q _ { i } = \frac { p _ { i } ^ { \alpha } } { \sum _ { N } ^ { j = 1 } p _ { j } ^ { \alpha } } w i t h \ p _ { i } = \frac { n _ { i } } { \sum _ { N } ^ { k = 1 } n _ { k } }
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
# B NATURAL LANGUAGE CODE SEARCH
|
| 280 |
+
|
| 281 |
+
Given a natural language as the input, code search aims to find the most semantically related code from a collection of candidate codes. We conduct experiments on the CodeSearchNet code corpus (Husain et al., 2019) and follow Husain et al. (2019) to take the first paragraph of the documentation as the query for the corresponding function. However, we observe that some queries contain content unrelated to the code, such as a link “http://...” that refers to external resources. Therefore, we filter following examples to improve the quality of the dataset.
|
| 282 |
+
|
| 283 |
+
(1) Examples whose code could not be parsed into abstract syntax tree.
|
| 284 |
+
(2) Examples whose query tokens number is shorter than 3 or larger than 256.
|
| 285 |
+
(3) Examples whose query contains special tokens such as “http://”.
|
| 286 |
+
(4) Examples whose query is empty or not written in English.
|
| 287 |
+
|
| 288 |
+
Different from the setting of Husain et al. (2019), the answer of each query is retrieved from the whole development and testing code corpus instead of 1,000 candidate codes. We list data statistics about the filtered dataset in Table 7.
|
| 289 |
+
|
| 290 |
+
<table><tr><td>CodeSearch</td><td>Training examples</td><td>Dev queries</td><td>Testing queries</td><td>Candidate codes</td></tr><tr><td>Go</td><td>167,288</td><td>7,325</td><td>8,122</td><td>28,120</td></tr><tr><td>Java</td><td>164,923</td><td>5,183</td><td>10,955</td><td>40,347</td></tr><tr><td>JavaScript</td><td>58,025</td><td>3,885</td><td>3,291</td><td>13,981</td></tr><tr><td>PHP</td><td>241,241</td><td>12,982</td><td>14,014</td><td>52.660</td></tr><tr><td>Python</td><td>251,820</td><td>13,914</td><td>14,918</td><td>43,827</td></tr><tr><td>Ruby</td><td>24,927</td><td>1,400</td><td>1,261</td><td>4,360</td></tr></table>
|
| 291 |
+
|
| 292 |
+
Table 7: Data statistics about the filtered dataset. For each query in the development and testing sets, the answer is retrieved from the whole candidate codes (i.e. the last row).
|
| 293 |
+
|
| 294 |
+
We use GraphCodeBERT to separately encode query and source code with data flow, and calculate inner product of their representations of the special token $[ C L S ]$ as relevance scores to rank candidate codes. In the fine-turning step, we set the learning rate as 2e-5, the batch size as 32, the max sequence length of queries and codes as 128 and 256, and the max number of nodes as 64. We use the Adam optimizer to update model parameters and perform early stopping on the development set.
|
| 295 |
+
|
| 296 |
+
We also report the results using the same setting of Husain et al. (2019) in Table 8. In this setting, models are required to retrieve an answer for a query from 1000 candidates. The results show that GraphCodeBERT also achieves the state-of-the-art performance.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>model</td><td>Ruby</td><td>Javascript</td><td>Go</td><td>Python</td><td>Java</td><td>Php</td><td>Overall</td></tr><tr><td>NBow</td><td>0.429</td><td>0.461</td><td>0.641</td><td>0.581</td><td>0.514</td><td>0.484</td><td>0.518</td></tr><tr><td>CNN</td><td>0.245</td><td>0.352</td><td>0.627</td><td>0.571</td><td>0.527</td><td>0.529</td><td>0.475</td></tr><tr><td>BiRNN</td><td>0.084</td><td>0.153</td><td>0.452</td><td>0.321</td><td>0.287</td><td>0.251</td><td>0.258</td></tr><tr><td>selfAtt</td><td>0.365</td><td>0.451</td><td>0.681</td><td>0.692</td><td>0.587</td><td>0.601</td><td>0.563</td></tr><tr><td>RoBERTa</td><td>0.625</td><td>0.606</td><td>0.820</td><td>0.809</td><td>0.666</td><td>0.658</td><td>0.697</td></tr><tr><td>RoBERTa (code)</td><td>0.661</td><td>0.640</td><td>0.819</td><td>0.844</td><td>0.721</td><td>0.671</td><td>0.726</td></tr><tr><td>CodeBERT</td><td>0.693</td><td>0.706</td><td>0.840</td><td>0.869</td><td>0.748</td><td>0.706</td><td>0.760</td></tr><tr><td>GraphCodeBERT</td><td>0.732</td><td>0.711</td><td>0.841</td><td>0.879</td><td>0.757</td><td>0.725</td><td>0.774</td></tr></table>
|
| 299 |
+
|
| 300 |
+
Table 8: Results on natural language code search using the setting of Husain et al. (2019).
|
| 301 |
+
|
| 302 |
+
# C CODE CLONE DETECTION
|
| 303 |
+
|
| 304 |
+
Code clone detection aims to measure the similarity between two code fragments. We use BigCloneBench dataset (Svajlenko et al., 2014), which contains over 6,000,000 true clone pairs and 260,000 false clone pairs from 10 different functionalities. We follow the settings in Wei & Li (2017), discarding code fragments without any tagged true and false clone pairs and using 9,134 remaining code fragments. Finally, the dataset provided by Wang et al. (2020) includes 901,724/416,328/416,328 examples for training/validation/testing. We treat the task as a binary classification to fine-tune GraphCodeBERT, where we use source code and data flow as the input. The probability of true clone is calculated by dot product from the representation of $[ C L S ]$ . In the fine-turning step, we set the learning rate as 2e-5, the batch size as 16, the max sequence length as 512 the max number of nodes as 128. We use the Adam optimizer to update model parameters and tune hyper-parameters and perform early stopping on the development set.
|
| 305 |
+
|
| 306 |
+
We give a case of the GraphCodeBERT output for this task in Figure 6. In this example, two Java source codes both download content from a given URL and convert the type of the content into string type. Therefore, two codes are semantically similar since they output similar results when given the same input. As we can see, our model gives a high score for this case and the pair is classified as true clone pair.
|
| 307 |
+
|
| 308 |
+
# Input: Two source codes
|
| 309 |
+
|
| 310 |
+
# Output: Semantically similar (score: 0.983)
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 6: A case of GraphCodeBERT output for the code clone detection task.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
|
| 317 |
+
# D CODE TRANSLATION
|
| 318 |
+
|
| 319 |
+
Code translation aims to migrate legacy software from one programming language in a platform to another. We conduct experiments on a dataset crawled from the same several open-source projects as Nguyen et al. (2015) and Chen et al. (2018), i.e. Lucene4, $\mathrm { P O I } ^ { 5 }$ , JGit6 and Antlr7. We do not use Itext8 and $\mathbf { J } \mathbf { T } \mathbf { S } ^ { 9 }$ as they do because of the license problem. Those projects have both Java and $\mathbf { C } \#$ implementation. We pair the methods in the two languages based on their file names and method names. After removing duplication and methods with null function body, the total number of method pairs is 11,800, and we split 500 pairs from them as the development set and another 1,000 pairs for test. To demonstrate the effectiveness of GraphCodeBERT on the task of code translation, we adopt various pre-trained models as encoders and stay hyperparameters consistent. We set the learning rate as 1e-4, the batch size as 32, the max sequence length as 256 and the max number of nodes as 64. We use the Adam optimizer to update model parameters and tune hyper-parameters and perform early stopping on the development set.
|
| 320 |
+
|
| 321 |
+
We give a case of the GraphCodeBERT output for this task in Figure 7. In this example, the model successfully translates a piece of Java code into its C# version. The differences include the type name (from “boolean” to “bool”) and the usage of getting a string value of a bool variable (from “String.valueOf(b)” to “b.ToString()”).
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 7: A case of GraphCodeBERT output for the code translation task.
|
| 325 |
+
|
| 326 |
+
# E CODE REFINEMENT
|
| 327 |
+
|
| 328 |
+
Code refinement aims to automatically fix bugs in the code. We use the dataset released by Tufano et al. (2019). The source is buggy Java functions while the target is the according fixed ones. Almost all the names of variables and custom methods are normalized. The dataset contains two subsets based on the code length. For the small dataset, the numbers of training, development and test samples are 46,680, 5,835 and 5,835. For the medium dataset, the numbers are 52,364, 6,545 and 6,545. We also use the sequence-to-sequence Transformer model to conduct the experiments. In the fine-tuning step, we adopt various pre-trained models as encoders. We set the learning rate as 1e-4, the batch size as 32, the max sequence length as 256 and the max number of nodes as 64. We use the Adam optimizer to update model parameters and perform early stopping on the development set.
|
| 329 |
+
|
| 330 |
+
We give two cases of the GraphCodeBERT output for this task in Figure 8. In the first example, the model successfully fixes the operation bug (from “\*” to $" + "$ ) to match the function name “add”. In the second case, the source function and type names are normalized. The return type of this function is “void” but the buggy code gives a return value. Our model successfully removes the “return” word so that the return type of the function matches its declaration.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 8: Two cases of GraphCodeBERT output for the code refinement task.
|
| 334 |
+
|
| 335 |
+
# F CASE STUDY
|
| 336 |
+
|
| 337 |
+
# F.1 NATURAL LANGUAGE CODE SEARCH
|
| 338 |
+
|
| 339 |
+
We give a case study to illustrate retrieved results by GraphCodeBERT on the natural language code search task, with a comparison to CodeBERT and RoBERTa (code) models. Two examples are given in Figure 9 and we can see that GraphCodeBERT successfully retrieves correct source codes for given queries on both examples. As we can see in the first case, incorporating data flow will help Graph-CodeBERT better understand the complicated expression $^ { \bullet \circ } [ ( \mathbf { k } , \mathbf { v } )$ for k, v in self.items() if v is not self.EMPTY]” by leveraging dependency relation among variables in data flow graph. In the second case, the terminology $\mathrm { ^ { 6 4 } \% \mathrm { Y } \mathrm { - } \mathcal { P } \mathrm { m } \mathrm { - } \mathcal { P } \mathrm { d } ^ { \mathrm { 3 } } }$ in Python program language is a format of date time. GraphCodeBERT and CodeBERT both successfully search the correct function. Compared with RoBERTa (code), the second case shows that utilizing natural language descriptions for pre-training helps models do better semantic matching between source codes and queries on the code search task.
|
| 340 |
+
|
| 341 |
+
# F.2 CODE CLONE DETECTION
|
| 342 |
+
|
| 343 |
+
We give a case study to compare GraphCodeBERT with CodeBERT and RoBERTa (code) models on code clone detection task. An example is shown in Figure 10. The first source code is to return the HTML content from a given URL, while the second source code is to return the last line from a fixed URL “http://kmttg.googlecode.com/svn/trunk/version”. Their semantics are not similar due to their different outputs. Data flow could help GraphCodeBERT better understand that the return value “pageHTML” in first source code comes from “pageHTML.append(line); pageHTML.append $( ^ { 6 6 } \backslash \mathbf { r } \backslash \mathbf { n } ^ { \prime 9 } )$ ;” instead of “bufferedWriter.write(pageHTML.toString());” and the return value “version” in the second source code comes from “version $=$ inputLine” or “version $=$ null;”. Although two source codes are highly overlapped (marked in yellow), GraphCodeBERT successfully predict the gold label compared with other models without data flow.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 9: Two examples on code search task and retrieved results from different models.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 10: An examples on code clone detection task and model prediction from different models. Overlapped code snippets between two source codes are marked in yellow.
|
| 350 |
+
|
| 351 |
+
# F.3 CODE TRANSLATION AND CODE REFINEMENT
|
| 352 |
+
|
| 353 |
+
We give a case study to compare GraphCodeBERT with Transformer without using data flow on code generation tasks, including code translation and code refinement. We list three cases in Table 9 and Table 10, respectively. [src] represents the source input, [ref] represents the reference, [sys] represents Transformer without data flow and [ours] represents GraphCodeBERT. We can see that the Transformer ([sys]) baseline makes several mistakes, including repeating tokens, logic errors and syntax errors, while GraphCodeBERT ([ours]) as a encoder could improve the generation.
|
| 354 |
+
|
| 355 |
+
Table 9: Three examples that translate from Java to $\mathbf { C } \#$ programming language on code translation task. [src] represents the source input, [ref] represents the reference, [sys] represents Transformer without data flow and [ours] represents GraphCodeBERT.
|
| 356 |
+
|
| 357 |
+
<table><tr><td rowspan=1 colspan=2>Case1: Transformer outputs repeating tokens</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public static final WeightedTerm[l getTerms(Query query){return getTerms(query,false);}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public static WeightedTerm[] GetTerms(Query query){return GetTerms(query, false);}</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public static WeightedTerm[] GetTerms(Query query){return GetTerms(false, new staticstatic static static static static WeightTerms);}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public static WeightedTerm[] GetTerms(Query query){return GetTerms(query, false);}</td></tr><tr><td rowspan=1 colspan=2>Case2: Transformer outputs codes with severe logic and syntax errors</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public long skip(long n){int s = (int) Math.min(available(),Math.max(O,n);ptr += s;return s;}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public override long Skip(long n){int s = (int)Math.Min(Available(), Math.Max(0, n));ptr += s;return s;}</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public override long Skip(long n){int s = Math.Min(n) == 0 ? Math.Min(00.0 :Math.Min(n, s.Length);return s;}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public override long Skip(long n){int s = (int)Math.Min(Available(), Math.Max(O, n));ptr += s;return s;}</td></tr><tr><td rowspan=1 colspan=2>Case3: Transformer uses the wrong variable as a parameter.</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public UnbufferedCharStream(int bufferSize){n = O;data = new int[bufferSize];}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public UnbufferedCharStream(int bufferSize){n = O;data = new int[bufferSize];}</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public UnbufferedCharStream(int bufferSize){data = new int[data];}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public UnbufferedCharStream(int bufferSize){n = O;data = new int[bufferSize];}</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 10: Three examples on code refinement task. [src] represents the source input, [ref] represents the reference, [sys] represents Transformer without data flow and [ours] represents GraphCodeBERT.
|
| 360 |
+
|
| 361 |
+
<table><tr><td rowspan=1 colspan=2>Case1: Transformer adds redundant parameters (android.view.View view)</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public void METHOD_1(){android.content.Intent VAR_1= new android.content.Intent(VAR_2);METHOD_2(VAR_1,0); android.content.Intent i= new android.content.Intent(this,VAR_3class);METHOD_3(i);}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public void METHOD_1(){android.content.Intent VAR_1= new android.content.Intent(VAR_2);METHOD_2(VAR_1,0) ; }</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public void METHOD_1(android.view.View view){android.content.Intent VAR_1 =new android.content.Intent(VAR_2) ; METHOD_2(VAR_1,0);}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public void METHOD_1(){android.content.Intent VAR_1= new android.content.Intent(VAR_2);METHOD_2(VAR_1,0) ; }</td></tr><tr><td rowspan=1 colspan=2>Case2: Transformer outputs codes with severe logic or irrelevant codes</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public java.util.Date METHOD_1(){return VAR_1.METHOD_1() .METHOD_2() ; }</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public java.util.Date METHOD_1(){ if((VAR_1.METHOD_1)) != null){return VAR_1.METHOD_1().METHOD_2();} else{return null;}}</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public java.util.Date METHOD_1(){if((VAR_1)== null){ return new java.util.Date(); } return VAR_1. METHOD_1() . METHOD.2();}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public java.util.Date METHOD_1(){if((VAR_1.METHOD_1()) != null){return VAR_1.METHOD_1().METHOD_2();} else{return null ;}}</td></tr><tr><td rowspan=1 colspan=2>Case3: Transformer makes no change</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public java.lang.String METHOD_1(TYPE_1 VAR_1){if(VAR_1== null) return null;return VAR_1.METHOD_2() . getText();}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public java.lang.String METHOD_1(TYPE_1 VAR_1){return VAR_1.METHOD_2().getText();}</td></tr><tr><td rowspan=1 colspan=1>[sys]</td><td rowspan=1 colspan=1>public java.lang.String METHOD_1(TYPE_1 VAR_1) { if(VAR_1 == null) return null;return VAR_1.METHOD_2() . getText();}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public java.lang.String METHOD_1(TYPE_1 VAR_1){ return VAR_1. METHOD_2().getText() ;}</td></tr></table>
|
| 362 |
+
|
| 363 |
+
# G ERROR ANALYSIS
|
| 364 |
+
|
| 365 |
+
We also conduct error analysis and summary two main classes of errors for both code understanding and generation tasks.
|
| 366 |
+
|
| 367 |
+
Figure 11 gives three error cases of GraphCodeBERT on the natural language code search task. We observe that GraphCodeBERR mainly fails to retrieve those source code that involves functions of the library like “tf” (Tensorflow) in the first case and “ GoogleCloudStorageHook” in the second case. It’s difficult for GraphCodeBERR to understand meanings of APIs like “tf.io.read file” and “tf.image.decode image” without relevant information. A potential direction to mitigate the problem is to incorporate definitions of the library. The other major problem is that there are some terminologies like “unistr” in the query (corresponding to “decode(‘utf-8’)” in Python code) in third case. Incorporating more text-code pairs for pre-training might alleviate this problem.
|
| 368 |
+
|
| 369 |
+
As for the code generation task, Table 11 shows two cases of GraphCodeBERT on the code translation task. We find that the major problems include semantic errors like identifiers from nowhere in the first case and syntax errors like missing a “}” symbol before “return n” in the second case. This problem might be mitigated by incorporating a dedicated decoder that takes into account grammar of programming languages and different generation paradigm like generating a sequence of production rules (Yin & Neubig, 2017; Guo et al., 2018; 2019) in a context-free grammar manner.
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 11: Error cases of GraphCodeBERT on the natural language code search.
|
| 373 |
+
|
| 374 |
+
Table 11: Error cases of GraphCodeBERT on the code translation task. [src] represents the source input, [ref] represents the reference and [ours] represents GraphCodeBERT.
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan=1 colspan=2>Casel: semantic error-identifiers from nowhere.</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1> public String toString( {return getKey( +“: ” + getValue(); }</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public override string ToStringO{return GetKey( +“:”+ GetValue(;}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public override string ToStringO{return Name + “: ”+ GetValue();}</td></tr><tr><td rowspan=1 colspan=2>Case2: syntax errors -missing a“}” before “return n")</td></tr><tr><td rowspan=1 colspan=1>[src]</td><td rowspan=1 colspan=1>public static int numNonnul(Object[] data) {int n = O;if(data == null ) return n;for(Object o :data) {if(o!=null) n++;}return n;}</td></tr><tr><td rowspan=1 colspan=1>[ref]</td><td rowspan=1 colspan=1>public static int NumNonnull(object[] data){int n = O;if (data == null){return n;}foreach (object o in data){if (o != null){n++;}}return n;}</td></tr><tr><td rowspan=1 colspan=1>[ours]</td><td rowspan=1 colspan=1>public static int NumNonNull(object[] data){int n = O;if (data == null){return n;}foreach (object o in data){if (o != nul){n++;}return n;}</td></tr></table>
|
md/train/jWkw45-9AbL/jWkw45-9AbL.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/k7aeAz4Vbb/k7aeAz4Vbb.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Instance-Conditional Knowledge Distillation for Object Detection
|
| 2 |
+
|
| 3 |
+
Zijian Kang∗ Xi’an Jiaotong University kzj123@stu.xjtu.edu.cn
|
| 4 |
+
|
| 5 |
+
Peizhen Zhang∗ MEGVII Technology zhangpeizhen@megvii.com
|
| 6 |
+
|
| 7 |
+
Xiangyu Zhang MEGVII Technology zhangxiangyu@megvii.com
|
| 8 |
+
|
| 9 |
+
Jian Sun MEGVII Technology sunjian@megvii.com
|
| 10 |
+
|
| 11 |
+
Nanning Zheng Xi’an Jiaotong University nnzheng@mail.xjtu.edu.cn
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Knowledge distillation has shown great success in classification, however, it is still challenging for detection. In a typical image for detection, representations from different locations may have different contributions to detection targets, making the distillation hard to balance. In this paper, we propose a conditional distillation framework to distill the desired knowledge, namely knowledge that is beneficial in terms of both classification and localization for every instance. The framework introduces a learnable conditional decoding module, which retrieves information given each target instance as query. Specifically, we encode the condition information as query and use the teacher’s representations as key. The attention between query and key is used to measure the contribution of different features, guided by a localization-recognition-sensitive auxiliary task. Extensive experiments demonstrate the efficacy of our method: we observe impressive improvements under various settings. Notably, we boost RetinaNet with ResNet-50 backbone from 37.4 to $4 0 . 7 \mathrm { m A P }$ $\left( + 3 . 3 \right)$ under $1 \times$ schedule, that even surpasses the teacher (40.4 mAP) with ResNet-101 backbone under $3 \times$ schedule. Code has been released on https://github.com/megvii-research/ICD.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
Deep learning applications blossom in recent years with the breakthrough of Deep Neural Networks (DNNs) [17, 24, 21]. In pursuit of high performance, advanced DNNs usually stack tons of blocks with millions of parameters, which are computation and memory consuming. The heavy design hinders the deployment of many practical downstream applications like object detection in resource-limited devices. Plenty of techniques have been proposed to address this issue, like network pruning [15, 27, 18], quantization [22, 23, 35], mobile architecture design [38, 39] and knowledge distillation (KD) [19, 37, 43]. Among them, KD is one of the most popular choices, since it can boost a target network without introducing extra inference-time burden or modifications.
|
| 20 |
+
|
| 21 |
+
KD is popularized by Hinton et al. [19], where knowledge of a strong pretrained teacher network is transferred to a small target student network in the classification scenario. Many good works emerge following the classification track [50, 37, 32]. However, most methods for classification perform badly in the detection: only slight improvements are observed [28, 51]. This can be attributed to two reasons: (1) Other than category classification, another challenging goal to localize the object is seldomly considered. (2) Multiple target objects are presented in an image for detection, where objects can distribute in different locations. Due to these reasons, the knowledge becomes rather ambiguous and imbalance in detection: representations from different positions like foreground or background, borders or centers, could have different contributions, which makes distillation challenging.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Compare with different methods for knowledge distillation. (a) KD [19] for classification transfers logits. (b) Recent methods for detection KD distill intermediate features, different regionbased sampling methods are proposed. (c) Our method explicitly distill the desired knowledge.
|
| 25 |
+
|
| 26 |
+
To handle the above challenge, two strategies are usually adopted by previous methods in detection. First, the distillation is usually conducted among intermediate representations, which cover all necessary features for both classification and localization. Second, different feature selection methods are proposed to overcome the imbalance issue. Existent works could be divided into three types according to the feature selection paradigm: proposal-based, rule-based and attention-based. In proposal-based methods [28, 11, 6], proposal regions predicted by the RPN [36] or detector are sampled for distillation. In rule-based methods [14, 45], regions selected by predesigned rules like foreground or label-assigned regions are sampled. Despite their improvements, limitations still exist due to the hand-crafted designs, e.g., many methods neglect the informative context regions or involve meticulous decisions. Recently, Zhang et al. [51] propose to use attention [43], a type of intermediate activation of the network, to guide the distillation. Although attention provides inherent hints for discriminative areas, the relation between activation and knowledge for detection is still unclear. To further improve KD quality, we hope to provide an explicit solution to connect the desired knowledge with feature selection.
|
| 27 |
+
|
| 28 |
+
Towards this goal, we present Instance-Conditional knowledge Distillation (ICD), which introduces a new KD framework based-on conditional knowledge retrieval. In ICD, we propose to use a decoding network to find and distill knowledge associated with different instances, we deem such knowledge as instance-conditional knowledge. Fig. 1 shows the framework and compares it with former ones, ICD learns to find desired knowledge, which is much more flexible than previous methods, and is more consistent with detection targets. In detail, we design a conditional decoding module to locate knowledge, the correlation between knowledge and each instance is measured by the instance-aware attention via the transformer decoder [5, 43]. In which human observed instances are projected to query and the correlation is measured by scaled-product attention between query and teacher’s representations. Following this formulation, the distillation is conducted over features decomposed by the decoder and weighted by the instance-aware attention. Last but not least, to optimize the decoding module, we also introduce an auxiliary task, which teaches the decoder to find useful information for identification and localization. The task defines the goal for knowledge retrieval, it facilitates the decoder instead of the student. Overall, our contribution is summarized in three-fold:
|
| 29 |
+
|
| 30 |
+
• We introduce a novel framework to locate useful knowledge in detection KD, we formulate the knowledge retrieval explicitly by a decoding network and optimize it via an auxiliary task. • We adopt the conditional modeling paradigm to facilitate instance-wise knowledge transferring. We encode human observed instances as query and decompose teacher’s representations to key and value to locate fine-grained knowledge. To our knowledge, it is the first trial to explore instance-oriented knowledge for detection. • We perform comprehensive experiments on challenging benchmarks. Results demonstrate impressive improvements over various detectors with up to 4 AP gain in MS-COCO, including recent detectors for instance segmentation [41, 46, 16]. In some cases, students with $1 \times$ schedule are even able to outperform their teachers with larger backbones trained $3 \times$ longer.
|
| 31 |
+
|
| 32 |
+
# 2 Related Works
|
| 33 |
+
|
| 34 |
+
# 2.1 Knowledge Distillation
|
| 35 |
+
|
| 36 |
+
Knowledge distillation aims to transfer knowledge from a strong teacher to a weaker student network to facilitate supervised learning. The teacher is usually a large pretrained network, who provides smoother supervision and more hints on visual concepts, that improves the training quality and convergence speed [49, 9]. KD for image classification has been studied for years, they are usually categorized into three types [13]: response-based [19], feature-based [37, 43] and relation-based [32].
|
| 37 |
+
|
| 38 |
+
Among them, feature-based distillation over multi-scale features is adopted from most of detection KD works, to deal with knowledge among multiple instances in different regions. Most of these works can be formulated as region selection for distillation, where foreground-background unbalancing is considered as a key problem in some studies [45, 51, 14]. Under this paradigm, we divide them into three kinds: (1) proposal-based, (2) rule-based and (3) attention-based.
|
| 39 |
+
|
| 40 |
+
(1) Proposal-based methods rely on the prediction of the RPN or detection network to find foreground regions, e.g., Chen et al. [6] and Li et al. [28] propose to distilling regions predicted by RPN [36], Dai et al. [11] proposes GI scores to locate controversial predictions for distillation.
|
| 41 |
+
|
| 42 |
+
(2) Rule-based methods rely on designed rules that can be inflexible and hyper-parameters inefficient, e.g., Wang et al. [45] distill assigned regions where anchor and ground-truth have a large IoU, Guo et al. [14] distill foreground and background regions separately with different factors.
|
| 43 |
+
|
| 44 |
+
(3) Attention-based methods rely on activations to locate discriminative areas, yet they do not direct to knowledge that the student needs. Only a recent work from Zhang et al. [51] considers attention, they build the spatial-channel-wise attention to weigh the distillation.
|
| 45 |
+
|
| 46 |
+
To overcome the above limitations, we explore the instance-conditional knowledge retrieval formulated by a decoder to explicitly search for useful knowledge. Like other methods, ICD does not have extra cost during inference or use extra data (besides existing labels and a pretrained teacher).
|
| 47 |
+
|
| 48 |
+
# 2.2 Conditional Computation
|
| 49 |
+
|
| 50 |
+
Conditional computation is widely adopted to infer contents on a given condition. Our study mostly focuses on how to identify visual contents given an instance as a condition. This is usually formulated as query an instance on the image, e.g., visual question answer [1, 2] and image-text matching [26] queries information and regions specified by natural language. Besides query by language, other types of query are proposed in recent years. For example, DETR [5] queries on fixed proposal embeddings, Chen et al. [8] encodes points as queries to facilitate weakly-supervised learning. These works adopt transformer decoder to infer upon global receptive fields that cover all visual contents, yet they usually rely on cascaded decoders that are costly for training. From another perspective, CondInst [41] and SOLOv2 [46] generate queries based on network predictions and achieves great performance on instance segmentation. Different from them, this work adopts the query-based approach to retrieve knowledge and build query based on annotated instances.
|
| 51 |
+
|
| 52 |
+
# 2.3 Object Detection
|
| 53 |
+
|
| 54 |
+
Object detection has been developed rapidly. Modern detectors are roughly divided into two-stage or one-stage detectors. Two-stage detectors usually adopt Region Proposal Network (RPN) to generate initial rough predictions and refine them with detection heads, the typical example is Faster R-CNN [36]. On the contrary, one-stage detectors directly predict on the feature map, which are usually faster, they include RetinaNet [30], FCOS [42]. Besides of this rough division, many extensions are introduced in recent years, e.g., extension to instance segmentation [41, 46, 16], anchor-free models [42, 25] and end-to-end detection [5, 44, 20]. Among these works, multi-scale features are usually adopted to enhance performance, e.g., FPN [29], which is considered as a typical case for our study. To generalize to various methods, the proposed method distills the intermediate features and does not rely on detector-specific designs.
|
| 55 |
+
|
| 56 |
+
# 3 Method
|
| 57 |
+
|
| 58 |
+
# 3.1 Overview
|
| 59 |
+
|
| 60 |
+
As discussed in former studies [14, 51], useful knowledge for detection distributes unevenly in intermediate features. To facilitate KD, we propose to transfer instance-conditional knowledge between student and teacher network, termed $\kappa _ { i } ^ { S }$ and $\kappa _ { i } ^ { \mathcal { T } }$ corresponding to the $i _ { \mathrm { t h } }$ instance:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathcal { L } _ { d i s t i l l } = \sum _ { i = 1 } ^ { N } \mathcal { L } _ { d } ( \kappa _ { i } ^ { S } , \kappa _ { i } ^ { T } )
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The knowledge towards teacher’s representations $\tau$ and condition $y _ { i }$ is formulated as $\kappa _ { i } ^ { \mathcal { T } } = \mathcal { G } ( \mathcal { T } , y _ { i } )$ ${ \kappa } _ { i } ^ { S }$ similarly), where $\mathcal { G }$ is the instance-conditional decoding module, optimized by an auxiliary loss illustrated in Sec. 3.3. The overall framework is shown in Fig. 2.
|
| 67 |
+
|
| 68 |
+
In the following sections, we will introduce the instance-conditional knowledge (Sec. 3.2), describe the auxiliary task design (Sec. 3.3), and discuss the knowledge transferring (Sec. 3.4).
|
| 69 |
+
|
| 70 |
+
# 3.2 Instance-conditional Knowledge
|
| 71 |
+
|
| 72 |
+
In this section, we elaborate the instanceconditional decoding module $\mathcal { G }$ , which computes instance-conditional knowledge $\kappa _ { i } ^ { \mathcal { T } }$ from (1) unconditional knowledge given (2) instance conditions.
|
| 73 |
+
|
| 74 |
+
(1) The unconditional knowledge $\tau$ , symbolizes all available information from the teacher detector. Since modern detectors commonly involve a feature pyramid network (FPN) [29] to extract rich multi-scale representations, we present multi-scale representations as $\mathcal T ~ = ~ \bar \{ X _ { p } ~ \in ~ $ $\mathbb { R } ^ { D \times H _ { p } \times W _ { p } } \} _ { p \in \mathcal { P } }$ , where $\mathcal { P }$ signifies the spatial resolutions while $D$ is the channel dimension. By concatenating representations at different scales along the spatial dimension, we obtain $\mathbf { A } ^ { \mathcal { T } } \in \mathbb { R } ^ { L \times \mathbf { \smile } }$ , where $\begin{array} { r } { L = \sum _ { p \in \mathcal { P } } H _ { p } W _ { p } } \end{array}$ is the sum of total pixels number across scales.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: We propose a decoding module to retrieve knowledge via query-based attention, where instance annotations are encoded as a query. An auxiliary task is proposed to optimize the decoding module and the feature-based distillation loss weighted by the attention is used to update student.
|
| 78 |
+
|
| 79 |
+
(2) The instance condition, originally describing a human-observed object, is denoted by ${ \mathcal { V } } =$
|
| 80 |
+
|
| 81 |
+
$\{ \mathfrak { y } _ { i } \} _ { i = 1 } ^ { N }$ , where $N$ is the object number and $\mathsf { y } _ { i } = \left( c _ { i } , \mathbf { b } _ { i } \right)$ is the annotation for the $i$ -th instance, including category $c _ { i }$ and box location $\mathbf { b } _ { i } = \left( x _ { i } , y _ { i } , w _ { i } , h _ { i } \right)$ which specifies the localization and size information.
|
| 82 |
+
|
| 83 |
+
To produce learnable embeddings for each instance, the annotation is mapped to a query feature vector $\mathbf { q } _ { i }$ in the hidden space, which specifies a condition to collect desired knowledge:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathbf { q } _ { i } = \mathcal { F } _ { q } ( \mathcal { E } ( \mathbf { y } _ { i } ) ) , \ \mathbf { q } _ { i } \in \mathbb { R } ^ { D }
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathcal { E } ( \cdot )$ is a instance encoding function (detailed in in Sec. 3) and $\mathcal { F } _ { q }$ is a Multi-Layer Perception network (MLP).
|
| 90 |
+
|
| 91 |
+
We retrieve knowledge from $\tau$ given $\mathbf { q } _ { i }$ by measuring responses of correlation. This is formulated by dot-product attention [43] with $M$ concurrent heads in a query-key attention manner. In which each head $j$ corresponds to three linear layers $( \mathcal { F } _ { j } ^ { k } , \mathcal { F } _ { j } ^ { q } , \mathcal { F } _ { j } ^ { v } ) \mathop { w . r . t . }$ . the key, query and value construction.
|
| 92 |
+
|
| 93 |
+
The key feature $\mathrm { K } _ { j } ^ { \mathcal { T } }$ is computed by projecting teacher’s representations $\mathrm { A } ^ { \tau }$ with the positional embeddings [43, 5] $\mathrm { P } \in \mathbb { R } ^ { L \times d }$ as in Eq. 3, where $\mathcal { F } _ { p e }$ denotes a linear projection over position embeddings. The value feature $\mathrm { V } _ { j } ^ { \mathcal { T } }$ and query ${ \bf q } _ { i j }$ is projected by linear mappings to a sub-space with $d = D / M$ channels, $\mathcal { F } _ { j } ^ { v }$ on $\mathrm { A } ^ { \tau }$ and $\mathcal { F } _ { j } ^ { q }$ over $\mathbf { q } _ { i }$ respectively, as shown in Eq. 4. At last, an instance-aware attention mask $\mathbf { m } _ { i j }$ of the $i$ -th instance by the $j$ -th head is obtained by normalized dot-product between $\mathrm { K } _ { j } ^ { \mathcal { T } }$ and $\mathbf { q } _ { i j }$ :
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: The illustration of the auxiliary task. (a) The instance encoding function encodes a instance condition to a vector, it is then projected as query features. (b) The identification task learns to identify the existence the queried instance. (c) The localization task learns to predict the boundary given an uncertain position provided by the query.
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \mathrm { K } _ { j } ^ { \mathcal { T } } = \mathcal { F } _ { j } ^ { k } ( \mathrm { A } ^ { \mathcal { T } } + \mathcal { F } _ { p e } ( \mathrm { P } ) ) , \mathrm { K } _ { j } ^ { \mathcal { T } } \in \mathbb { R } ^ { L \times d } } \\ & { \mathrm { V } _ { j } ^ { \mathcal { T } } = \mathcal { F } _ { j } ^ { v } ( \mathrm { A } ^ { \mathcal { T } } ) , \mathrm { V } _ { j } ^ { \mathcal { T } } \in \mathbb { R } ^ { L \times d } } \\ & { \mathbf { q } _ { i j } = \mathcal { F } _ { j } ^ { q } ( \mathbf { q } _ { i } ) , \mathbf { q } _ { i j } \in \mathbb { R } ^ { d } } \\ & { \mathbf { m } _ { i j } = s o f t m a x ( \frac { \mathrm { K } _ { j } ^ { \mathcal { T } } \mathbf { q } _ { i j } } { \sqrt { d } } ) , \mathbf { m } _ { i j } \in \mathbb { R } ^ { L } } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Intuitively, the querying along the key features and value features describes the correlation between representations and instances. We collect $\kappa _ { i } ^ { \mathcal { T } } = \{ ( \mathbf { m } _ { i j } , \mathrm { V } _ { j } ^ { \mathcal { T } } ) \} _ { j = 1 } ^ { M }$ as the instance-conditional knowledge from $\tau$ , which encodes knowledge corresponds to the ith instance.
|
| 103 |
+
|
| 104 |
+
# 3.3 Auxiliary Task
|
| 105 |
+
|
| 106 |
+
In this section, we introduce the auxiliary task to optimize the decoding module $\mathcal { G }$ . First, we aggregate instance-level information to identify and localize objects. This could be obtained by aggregating the instance-conditional knowledge by the function $\mathcal { F } _ { a g g }$ , which includes sum-product aggregation over attention $\mathbf { m } _ { i j }$ and $\mathrm { V } _ { j } ^ { \mathcal { T } }$ , concatenate features from each head, add residuals and project with a feed-forward network as proposed in [43, 5]:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\mathbf { g } _ { i } ^ { T } = \mathcal { F } _ { a g g } ( \kappa _ { i } ^ { T } , \mathbf { q } _ { i } ) , \ \mathbf { g } _ { i } ^ { T } \in \mathbb { R } ^ { D }
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
To let the instance-level aggregated information $\mathbf { g } _ { i } ^ { \mathcal { T } }$ retain sufficient instance cues, one could design an instance-sensitive task to optimize it as below:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\mathcal { L } _ { a u x } = \mathcal { L } _ { i n s } ( \mathbf { g } _ { i } ^ { T } , \mathcal { H } ( \mathbf { y } _ { i } ) )
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\mathcal { H }$ encodes the instance information as targets. However, directly adopt Eq. 8 might lead to trivial solution, since ${ \tt y } _ { i }$ is accessible from both $\mathbf { g } _ { i } ^ { \top }$ (through $\mathbf { q } _ { i }$ , see Eq. 2) and $\mathcal { H } ( \mathtt { y } _ { i } )$ . It is possible that parameters will learn a shortcut, that ignore the teacher representations $\tau$ . To resolve this issue, we propose to drop information on encoding function $\mathcal { E } ( \cdot )$ , to force the aggregation function $\mathcal { F } _ { a g g }$ to excavate hints from $\tau$ .
|
| 119 |
+
|
| 120 |
+
The information dropping is adopted by replacing the accurate annotation for instance conditions to uncertain ones. For bounding box annotations, we relieve them to rough box centers with rough scales indicators. The rough box center $( x _ { i } ^ { \prime } , y _ { i } ^ { \prime } )$ is obtained by random jittering as shown below:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\left\{ \begin{array} { l l } { x _ { i } ^ { \prime } = x _ { i } + \phi _ { x } w _ { i } , } \\ { y _ { i } ^ { \prime } = y _ { i } + \phi _ { y } h _ { i } , } \end{array} \right.
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $( w _ { i } , h _ { i } )$ is the width and height of the bounding box and $\phi _ { x } , \phi _ { y }$ are sampled from a uniform distribution $\begin{array} { r } { \dot { \Phi } \sim U [ - a , a ] } \end{array}$ , where we set $\mathrm { a } { = } 0 . 3$ empirically. The scales indicators are obtained by rounding the box sizes in the logarithmic space, i.e., $\textcircled { l o g _ { 2 } ( w _ { i } ) } $ , $\lfloor l o g _ { 2 } ( h _ { i } ) \rfloor$ . In addition, to let the decoder learn to identify instances and be aware of the uncertainty, we generate fake instances for the identification task according to dataset distributions, this is detailed in Appendix A. As a result, it collect coarse information and obtain instance encoding through $\mathcal { E } ( \cdot )$ as depicted in Fig. 3a. where $c _ { i }$ is the category, $\mathcal { F } _ { o h }$ is the one hot vectorization, concat is the concatenation operator and $\mathcal { F } _ { p e }$ is the position embedding function.
|
| 127 |
+
|
| 128 |
+
Finally, the aggregated representation $\mathbf { g } _ { i } ^ { T }$ are optimized by the auxiliary task. We introduces two predictors denoted by $\mathcal { F } _ { o b j }$ and $\mathcal { F } _ { r e g }$ respectively to predict identification and localization results. We adopt binary cross entropy loss (BCE) to optimize the real-fake identification and $L 1$ loss to optimize the regression.
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\mathcal { L } _ { a u x } = \mathcal { L } _ { B C E } ( \mathcal { F } _ { o b j } ( \mathbf { g } _ { i } ^ { T } ) , \delta _ { o b j } ( \mathbf { y } _ { i } ) ) + \mathcal { L } _ { 1 } ( \mathcal { F } _ { r e g } ( \mathbf { g } _ { i } ^ { T } ) , \delta _ { r e g } ( \mathbf { y } _ { i } ) )
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\delta _ { o b j } ( \cdot )$ is an indicator, it yields 1 if $\mathtt { y } _ { i }$ is real and 0 otherwise. Following common practice, the localization loss for fake examples is ignored. $\delta _ { r e g }$ is the preparing function for regression targets, following [42]. Appendix A provides more implementation details.
|
| 135 |
+
|
| 136 |
+
# 3.4 Instance-Conditional Distillation
|
| 137 |
+
|
| 138 |
+
Lastly, we present the formulation for conditional knowledge distillation. We obtain the projected value features $\mathrm { V } _ { j } ^ { S } \in \mathbb { R } ^ { L \times d }$ of the student representations analogous to Eq. 4 in Sec. 3.2. By adopting the instance-aware attention mask as a measurement of correlations between feature and each instance, we formulate the distillation loss as value features mimicking guided by the attention:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\mathcal { L } _ { d i s t i l l } = \frac { 1 } { M N _ { r } } \sum _ { j = 1 } ^ { M } \sum _ { i = 1 } ^ { N } \delta _ { o b j } ( \mathrm { y } _ { i } ) \cdot < \mathbf { m } _ { i j } , \mathcal { L } _ { M S E } ( \mathrm { V } _ { j } ^ { S } , \mathrm { V } _ { j } ^ { \mathcal { T } } ) >
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $\begin{array} { r } { N _ { r } = \sum _ { i = 1 } ^ { N } \delta _ { o b j } ( \mathbf { y } _ { i } ) } \end{array}$ , $( N _ { r } \leq N )$ is the real instances number, $\mathcal { L } _ { M S E } ( \mathrm { V } _ { j } ^ { S } , \mathrm { V } _ { j } ^ { T } ) \in \mathbb { R } ^ { L }$ is the pixel-wise mean-square error along the hidden dimension2 and $< \cdot , \cdot >$ is the Dirac notation for inner product. For stability, the learnable variable $\mathbf { m } _ { i j }$ and $\mathrm { V } _ { j } ^ { \mathcal { T } } .$ are detached during distillation. Combine with the supervised learning loss $\mathcal { L } _ { d e t }$ , the overall loss with a coefficient $\lambda$ is summarized below:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathcal { L } _ { t o t a l } = \mathcal { L } _ { d e t } + \mathcal { L } _ { a u x } + \lambda \mathcal { L } _ { d i s t i l l }
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
It is worth noticing, only the gradients w.r.t. $\mathcal { L } _ { d i s t i l l }$ and $\mathcal { L } _ { d e t }$ back-propagate to the student network (from representations $s$ ). The gradients of $\mathcal { L } _ { a u x }$ only update the instance-conditional decoding function $\mathcal { G }$ and auxiliary task related modules.
|
| 151 |
+
|
| 152 |
+
# 4 Experiments
|
| 153 |
+
|
| 154 |
+
# 4.1 Experiment Settings
|
| 155 |
+
|
| 156 |
+
We conduct experiments on Pytorch [34] with the widely used Detectron2 library [47] and AdelaiDet library 3 [40]. All experiments are running on eight 2080ti GPUs with 2 images in each. We adopt the $1 \times$ scheduler, which denotes 9k iterations of training, following the standard protocols in Detectron2 unless otherwise specified. Scale jittering with random flip is adopted as data augmentation.
|
| 157 |
+
|
| 158 |
+
For distillation, the hyper-parameter $\lambda$ is set to 8 for one-stage detectors and 3 for two-stage detectors respectively. To optimize the transformer decoder, we adopt AdamW optimizer [33] for the decoder and MLPs following common settings for transformer [43, 5]. Corresponding hyper-parameters follows [5], where the initial learning rate and weight decay are set to 1e-4. We adopt the 256 hidden dimension for our decoder and all MLPs, the decoder has 8 heads in parallel. The projection layer $\mathcal { F } _ { q }$ is a 3 layer MLP, $F _ { r e g }$ and $F _ { o b j }$ share another 3 layer MLP. In addition, we notice some newly initialized modules of the student share the same size of the teacher, e.g., the detection head, FPN.
|
| 159 |
+
|
| 160 |
+
Table 1: Comparison with previous methods on challenging benchmark MS-COCO. The method proposed by Li et al. [28] does not apply to RetinaNet. $\dagger$ denotes the inheriting strategy.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Faster R-CNN [36] APs</td><td colspan="4">RetinaNet [30]</td></tr><tr><td>AP</td><td>APM</td><td>APL</td><td>AP</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>Teacher w. ResNet-101 (3×)</td><td>42.0</td><td>25.2 45.6</td><td>54.6</td><td>40.4</td><td>24.0</td><td>44.3</td><td>52.2</td></tr><tr><td>Student w. ResNet-50 (1×)</td><td>37.9</td><td>22.4 41.1</td><td>49.1</td><td>37.4</td><td>23.1</td><td>41.6</td><td>48.3</td></tr><tr><td>+ FitNet [37]</td><td>39.3 (+1.4)</td><td>22.7 42.3</td><td>51.7</td><td>38.2(+0.8)</td><td>21.8</td><td>42.6</td><td>48.8</td></tr><tr><td>+ Li et al. [28]</td><td>39.5 (+1.5)</td><td>23.3 43.0</td><td>51.4</td><td></td><td>1</td><td>-</td><td>-</td></tr><tr><td>+ Wang et al. [45]</td><td>39.2 (+1.3)</td><td>23.2 42.8</td><td>50.4</td><td>38.4 (+1.0)</td><td>23.3</td><td>42.6</td><td>49.1</td></tr><tr><td>+ Zhang et al. [51]</td><td>40.0 (+2.1)</td><td>23.2 43.3</td><td>52.5</td><td>39.3 (+1.9)</td><td>23.4</td><td>43.6</td><td>50.6</td></tr><tr><td>+ Ours</td><td>40.4 (+2.5)</td><td>23.4 44.0</td><td>52.0</td><td>39.9 (+2.5)</td><td>25.0</td><td>43.9</td><td>51.0</td></tr><tr><td>+Ours+</td><td>40.9 (+3.0)</td><td>24.5</td><td>44.2 53.5</td><td>40.7 (+3.3)</td><td>24.2</td><td>45.0</td><td>52.7</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 2: Experiments on more detectors with ICD. Type denotes the AP score is evaluated on bounding box (BBox) or instance mask $( \tt M a s k )$ . $\dagger$ denotes using the inheriting strategy.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Detector</td><td>Setting</td><td>Type</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>FCOS [42]</td><td>Teacher (3×) Student (1×)</td><td rowspan="4">BBox</td><td>42.6</td><td>61.6</td><td>45.8</td><td>26.2</td><td>46.3</td><td>53.8</td></tr><tr><td></td><td></td><td>39.4</td><td>58.2</td><td>42.4</td><td>24.2</td><td>43.4</td><td>49.4</td></tr><tr><td>Teacher: 18.8 FPS /51.2M</td><td>+ Ours + Ours †</td><td>41.7(+2.3)</td><td>60.3</td><td>45.4</td><td>26.9</td><td>45.9</td><td>52.6</td></tr><tr><td>Student: 25.0 FPS /32.2M</td><td></td><td>42.9(+3.5)</td><td>61.6</td><td>46.6</td><td>27.8 46.8</td><td></td><td>54.6</td></tr><tr><td rowspan="6">Mask R-CNN [16] Teacher: 17.5 FPS /63.3M Student: 22.9 FPS /44.3M</td><td>Teacher(3×) Student (1×)</td><td rowspan="4">BBox</td><td>42.9</td><td>63.3</td><td>46.8</td><td>26.4</td><td>46.6</td><td>56.1</td></tr><tr><td></td><td>38.6</td><td>59.5</td><td>42.1</td><td>22.5</td><td>42.0</td><td>49.9</td></tr><tr><td>+ Ours</td><td>40.4 (+1.8)</td><td>60.9</td><td>44.2</td><td>24.4</td><td>43.7</td><td>52.0</td></tr><tr><td>+ Ours †</td><td>41.2 (+2.6)</td><td>62.0</td><td>45.0</td><td>25.1</td><td>44.5</td><td>53.6</td></tr><tr><td>Teacher(3×) Student (1×)</td><td>38.6 35.2</td><td>60.4 56.3</td><td>41.3</td><td>19.5</td><td>41.3</td><td>55.3</td></tr><tr><td rowspan="4">SOLOv2 [46]</td><td>+ Ours</td><td>Mask</td><td>36.7 (+1.5)</td><td></td><td>37.5</td><td>17.2</td><td>37.7</td><td>50.3</td></tr><tr><td></td><td>37.4 (+2.2)</td><td>58.0 58.7</td><td>39.2</td><td>18.4</td><td>38.9</td><td></td><td>52.5</td></tr><tr><td>+ Ours † Teacher (3×)</td><td>39.0</td><td></td><td></td><td>40.1</td><td>19.1</td><td>39.8</td><td>53.7</td></tr><tr><td>Student</td><td>34.6</td><td>59.4 54.7</td><td>41.9 36.9</td><td>16.2 13.2</td><td></td><td>43.1</td><td>58.2 53.3</td></tr><tr><td>Teacher: 16.6 FPS/65.5M Student: 21.4 FPS /46.5M</td><td>+ Ours + Ours †</td><td>Mask</td><td>37.2 (+2.6)</td><td>57.6</td><td>39.8</td><td>14.8</td><td>37.9 40.7</td><td>57.0</td></tr><tr><td rowspan="6">CondInst [41]</td><td>Teacher(3×)</td><td rowspan="3">BBox</td><td>38.5 (+3.9)</td><td>59.0</td><td>41.2</td><td>15.9</td><td>42.3</td><td>58.9</td></tr><tr><td></td><td>44.6</td><td>63.7</td><td></td><td></td><td></td><td></td></tr><tr><td>Student (1×)</td><td>39.7</td><td></td><td>48.4</td><td>27.5</td><td>47.8</td><td>58.4</td></tr><tr><td>+ Ours</td><td rowspan="3"></td><td></td><td>58.8</td><td>43.1</td><td>23.9</td><td>43.3</td><td>50.1</td></tr><tr><td>+ Ours †</td><td>42.4 (+2.7) 43.7 (+4.0)</td><td>61.5 62.9</td><td>46.1 47.2</td><td>25.3 27.1</td><td>46.0</td><td>54.3</td></tr><tr><td>Teacher(3×)</td><td>39.8</td><td></td><td></td><td></td><td>47.3</td><td>56.6</td></tr><tr><td rowspan="4">Teacher: 16.8FPS/53.5M Student: 21.3 FPS /34.1M</td><td></td><td rowspan="4">Mask</td><td></td><td>61.4</td><td>42.6</td><td>19.4</td><td>43.5</td><td>58.3</td></tr><tr><td>Student (1×)</td><td>35.7</td><td>56.7</td><td>37.7</td><td>16.8</td><td>39.1</td><td>50.3</td></tr><tr><td>+ Ours</td><td>37.8 (+2.1)</td><td>59.1</td><td>40.4</td><td>17.5</td><td>41.4</td><td>54.7</td></tr><tr><td>+ Ours †</td><td>39.1 (+3.4)</td><td>60.5</td><td>42.0</td><td>19.1</td><td>42.6</td><td>57.0</td></tr></table>
|
| 167 |
+
|
| 168 |
+
We find initialize these modules with teacher’s parameters will lead to faster convergence, we call it the inheriting strategy in experiments.
|
| 169 |
+
|
| 170 |
+
Most experiments are conducted on a large scale object detection benchmark MS-COCO 4[31] with 80 classes. We train models on MS-COCO 2017 trainval115k subset and validate on minival subset. Following common protocols, we report mean Average Precision (AP) as an evaluation metric, together with AP under different thresholds and scales, i.e., $\mathrm { { A P } _ { 5 0 } }$ , $\mathsf { A P } _ { 7 5 }$ , $\mathsf { A P } _ { \mathrm { S } }$ , $\mathsf { A P _ { M } }$ , $\mathsf { A P } _ { \mathrm { L } }$ . Other experiments are listed in Appendix B, e.g., on VOC [12] and Cityscapes [10], more ablations.
|
| 171 |
+
|
| 172 |
+
# 4.2 Main Results
|
| 173 |
+
|
| 174 |
+
Compare with state-of-the-art methods. We compare our method (ICD) with previous stateof-the-arts (SOTAs), including a classic distillation method FitNet [37], two typical detection KD methods [28, 45], and a very recent work with strong performance from Zhang et al. [51]. The comparison is conducted on two classic detectors: Faster R-CNN [36] and RetinaNet [30]. We adopt detectron2 official released models with ResNet-101 backbone trained on $3 \times$ scheduler as teacher networks, the student is trained on $1 \times$ with ResNet-50 backbone following the above settings.
|
| 175 |
+
|
| 176 |
+
Table 3: Experiments on mobile backbones. $\dagger$ denotes using the inheriting strategy.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Detector</td><td>Setting</td><td>Backbone</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td rowspan="4">RetinaNet [30]</td><td>Teacher (3×)</td><td>ResNet-101[17]</td><td>40.4</td><td>60.3</td><td>43.2</td><td>24.0</td><td>44.3</td><td>52.2</td></tr><tr><td>Student (1×)</td><td></td><td>26.4</td><td>42.0</td><td>27.8</td><td>13.8</td><td>28.8</td><td>34.1</td></tr><tr><td>+ Ours</td><td>MBV2 [38]</td><td>29.5 (+3.1)</td><td>45.5</td><td>31.2</td><td>16.2</td><td>32.2</td><td>38.3</td></tr><tr><td>+ Ours †</td><td></td><td>31.6(+5.2)</td><td>48.5</td><td>33.4</td><td>17.6</td><td>34.7</td><td>41.3</td></tr><tr><td rowspan="4">RetinaNet [30]</td><td>Teacher (3×)</td><td>ResNet-101[17]</td><td>40.4</td><td>60.3</td><td>43.2</td><td>24.0</td><td>44.3</td><td>52.2</td></tr><tr><td>Student (1×)</td><td></td><td>34.9</td><td>54.8</td><td>37.0</td><td>20.9</td><td>38.9</td><td>44.8</td></tr><tr><td>+ Ours</td><td>Eff-B0 [39]</td><td>36.7 (+1.8)</td><td>56.0</td><td>38.7</td><td>21.1</td><td>40.6</td><td>48.1</td></tr><tr><td>+ Ours †</td><td></td><td>38.0 (+3.1)</td><td>57.5</td><td>40.2</td><td>22.4</td><td>41.6</td><td>50.3</td></tr><tr><td rowspan="4">FRCNN [36]</td><td>Teacher(3×)</td><td>ResNet-101[17]</td><td>42.0</td><td>62.5</td><td>45.9</td><td>25.2</td><td>45.6</td><td>54.6</td></tr><tr><td>Student (1×)</td><td></td><td>27.2</td><td>44.7</td><td>28.8</td><td>14.6</td><td>29.6</td><td>35.6</td></tr><tr><td>+ Ours</td><td>MBV2 [38]</td><td>30.2 (+3.0)</td><td>48.0</td><td>32.5</td><td>17.0</td><td>32.2</td><td>39.1</td></tr><tr><td>+ Ours †</td><td></td><td>31.4 (+4.2)</td><td>49.4</td><td>33.6</td><td>17.6</td><td>33.5</td><td>41.3</td></tr><tr><td rowspan="4">FRCNN [36]</td><td>Teacher (3×)</td><td>ResNet-101[17]</td><td>42.0</td><td>62.5</td><td>45.9</td><td>25.2</td><td>45.6</td><td>54.6</td></tr><tr><td>Student (1×)</td><td></td><td>35.3</td><td>56.8</td><td>37.8</td><td>20.8</td><td>38.2</td><td>45.1</td></tr><tr><td>+ Ours</td><td>Eff-B0 [39]</td><td>37.0 (+1.7)</td><td>58.0</td><td>39.6</td><td>21.1</td><td>40.0</td><td>48.3</td></tr><tr><td>+ Ours †</td><td></td><td>37.9 (+2.6)</td><td>58.7</td><td>40.8</td><td>21.4</td><td>40.9</td><td>49.5</td></tr></table>
|
| 179 |
+
|
| 180 |
+
As shown in Table 1, ICD brings about $2 . 5 \mathrm { A P }$ and 3.0 AP improvement for plain training and training with the inheriting strategy respectively. Especially for RetinaNet, the student with distillation even outperforms a strong teacher trained on $3 \times$ scheduler. Compare with previous SOTAs, the proposed method leads to a considerable margin for about 0.5 AP without the inheriting strategy.
|
| 181 |
+
|
| 182 |
+
Results on other settings. We further evaluate ICD under various detectors, e.g., a commonly used anchor-free detector FCOS [42], and three detectors that have been extended to instance segmentation: Mask R-CNN [16], SOLOv2 [46] and CondInst [41]. We adopt networks with ResNet-101 on $3 \times$ scheduler as teachers and networks with ResNet-50 on $1 \times$ scheduler as students following the above settings. As shown in Table 2, we observe consistent improvements for both detection and instance segmentation. There are at most around 4 AP improvement on CondInst [41] on object detection and SOLOv2 [46] on instance segmentation. Moreover, students with weaker backbone (ResNet-50 v.s. ResNet-101) and less training images $( 1 / 3 )$ even outperform (FCOS) or perform on par (SOLOv2, CondInst) with teachers. Note that ICD does not introduce extra burden during inference, our method improves about $2 5 \%$ of $\mathrm { F P S ^ { 5 } }$ and reduces $40 \%$ of parameters compared with teachers.
|
| 183 |
+
|
| 184 |
+
Mobile backbones. Aside from main experiments on commonly used ResNet [17], we also conduct experiments on mobile backbones, which are frequently used in low-power devices. We evaluate our method on two prevalent architectures: MobileNet V2 (MBV2) [38] and EfficientNet-B0 (Eff-B0) [39]. The latter one adopts the MobileNet V2 as basis, and further extends it with advanced designs like stronger data augmentation and better activations.
|
| 185 |
+
|
| 186 |
+
Experiments are conducted on Faster R-CNN (abbr., FRCNN) [36] and RetinaNet [30] following the above settings. As shown in Table 3, our method also significantly improves the performance on smaller backbones. For instance, we improve the RetinaNet with MobileNet V2 backbone with 5.2 AP gain and 3.1 AP gain with and without inheriting strategy respectively, and up to 3.1 AP gain for EfficientNet-B0. We also observe consistent improvements over Faster R-CNN, with up to 4.2 AP gain for MobileNet-V2 and 2.6 AP gain for EfficientNet-B0.
|
| 187 |
+
|
| 188 |
+
# 4.3 Ablation Studies
|
| 189 |
+
|
| 190 |
+
To verify the design options and the effectiveness of each component, we conduct ablation studies with the classic RetinaNet detector on MS-COCO following the above settings.
|
| 191 |
+
|
| 192 |
+
Design of the auxiliary task. To better understand the role of our auxiliary task, we conduct experiments to evaluate the contribution of each sub-task. Specifically, our auxiliary task is composed of an identification task with binary cross-entropy loss and a localization task with regression loss, the localization task is further augmented with a hint on bounding box scales. As shown in Table 4, the identification task itself leads to $2 . 2 \ : \mathrm { A P }$ gain compare with the baseline, this high-light the importance of knowledge on object perception. The regression task itself leads to $1 . 8 \mathrm { A P }$ gain, and the scale information boosts it for extra 0.2 AP gain. Combine two of them, we achieve $2 . 5 \mathrm { \ A P }$ overall improvement, which indicates the fusion of two knowledge brings extra benefits. Note the auxiliary task only update the decoder and does not introduce extra data, which is very different from multitask learning, e.g., Mask R-CNN[16].
|
| 193 |
+
|
| 194 |
+
Table 4: Comparison with different auxiliary task designs.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Identification</td><td>Localization</td><td>+ Scale</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td rowspan="4">√</td><td></td><td></td><td>37.4</td><td>56.7</td><td>40.3</td><td>23.1</td><td>41.6</td><td>48.3</td></tr><tr><td></td><td></td><td>39.6</td><td>59.2</td><td>42.8</td><td>23.4</td><td>44.0</td><td>50.4</td></tr><tr><td>√</td><td></td><td>39.2</td><td>58.6</td><td>42.4</td><td>23.1</td><td>43.5</td><td>50.3</td></tr><tr><td>√</td><td>√</td><td>39.4</td><td>58.8</td><td>42.4</td><td>23.2</td><td>43.8</td><td>50.5</td></tr><tr><td>√</td><td>√</td><td>√</td><td>39.9</td><td>59.4</td><td>43.1</td><td>25.0</td><td>43.9</td><td>51.0</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Impact of the instance-aware attention. To verify the effectiveness of instance-aware attention learned by conditional computation, we directly replace it with different variations: the fine-grained mask in [45], pixel-wise attention activation [51, 43], foreground mask analog to [14] and no attention mask. The result in Fig. 5 shows our instance-aware mask leads to about 0.9 AP gain over the baseline and $0 . 4 \ : \mathrm { A P }$ gain compare with the best replacement.
|
| 199 |
+
|
| 200 |
+
Table 5: Comparison with different types of attention.
|
| 201 |
+
|
| 202 |
+
<table><tr><td>Attention Type</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APm</td><td>APL</td></tr><tr><td>No Attention</td><td>39.0</td><td>58.4</td><td>42.1</td><td>23.5</td><td>43.2</td><td>49.9</td></tr><tr><td>Foreground Mask</td><td>39.4</td><td>58.9</td><td>42.4</td><td>23.5</td><td>43.6</td><td>50.0</td></tr><tr><td>Fine-grained Mask [45]</td><td>39.5</td><td>59.0</td><td>42.4</td><td>23.4</td><td>43.8</td><td>50.2</td></tr><tr><td>Attention Activation [43]</td><td>39.3</td><td>58.6</td><td>42.3</td><td>22.6</td><td>43.6</td><td>50.1</td></tr><tr><td>Instance-conditional Attention</td><td>39.9</td><td>59.4</td><td>43.1</td><td>25.0</td><td>43.9</td><td>51.0</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Design of the decoder. We mainly verify two properties of the decoder design, as shown in Table 6. First, we find a proper number of heads is important for the best performance. The head number balances the dimension for each sub-space and the number of spaces. The best number lies around 8, which is consistent with former studies [5]. Second, we evaluate the effectiveness of cascaded decoders, as it is widely adopted in former studies [43, 5, 8]. However, we do not find significant differences between different cascade levels, it might because we use a fixed teacher to provide knowledge, that limited the learning ability.
|
| 205 |
+
|
| 206 |
+
(a) Number of heads.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Heads</td><td>AP</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>1</td><td>39.4</td><td>23.7</td><td>43.8</td><td>50.5</td></tr><tr><td>4</td><td>39.7</td><td>24.0</td><td>43.9</td><td>51.2</td></tr><tr><td>8</td><td>39.9</td><td>25.0</td><td>43.9</td><td>51.0</td></tr><tr><td>16</td><td>39.7</td><td>23.6</td><td>44.2</td><td>50.5</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 6: Ablation on the number of heads and cascade levels.
|
| 211 |
+
(b) Number of cascade levels.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Levels</td><td>AP</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>1</td><td>39.9</td><td>25.0</td><td>43.9</td><td>51.0</td></tr><tr><td>2</td><td>39.9</td><td>24.1</td><td>44.0</td><td>51.4</td></tr><tr><td>4</td><td>39.8</td><td>24.3</td><td>44.0</td><td>50.9</td></tr></table>
|
| 214 |
+
|
| 215 |
+
# 5 Discussion
|
| 216 |
+
|
| 217 |
+
Qualitative analysis. We present a visualization of our learned instance-aware attention in Fig. 4. We find different heads attend to different components related to each instance, e.g., salient parts, boundaries. This might suggest that salient parts are important and knowledge for regression mostly lies around boundaries, instead of averaged on the foreground as assumed in former studies. The head (vi) and (vii) are smoother around key regions, which may relate to context. The head (iv) mainly attends on image corners, which might be a degenerated case or relate to some implicit descriptors.
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 4: Visualization of our learned instance-aware attention over each head. Red denotes weak areas and pink denotes strong areas.
|
| 221 |
+
|
| 222 |
+
Resource consumption. We benchmark the training speed for our distillation method. As shown in Fig. 5, training the decoder introduces negligible cost. Specifically, we benchmark on $1 \times$ scheduler on RetinaNet [30] with eight 2080ti, following the same configuration in Section 4.2. The major time consumption is spent on training the teacher $( 3 \times )$ , which takes about 33 hours. Training (forward and backward) the student takes about 8 hours, while training decoder and distillation only take 1.3 hours. Besides the training time, memory consumption of our method is also limited. One can update the decoder part and the student part in consecutive iterations, leaving only intermediate features for distillation in memory across iterations.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 5: Time consumption.
|
| 226 |
+
|
| 227 |
+
Real-world impact. The proposed method provides a convenient approach to enhance a detector under a certain setting, resulting in that a small model can perform on par with a larger one. On the positive side, it allows users to replace a big model with a smaller one, which reduces energy consumption. On the potentially negative side, the teacher could be costly in training, also the student might inherit biases from the teacher, which is hard for tracing.
|
| 228 |
+
|
| 229 |
+
# 6 Conclusion
|
| 230 |
+
|
| 231 |
+
We introduce a novel framework for knowledge distillation. The proposed Instance-Conditional knowledge Distillation (ICD) method utilizes instance-feature cross attention to select and locate knowledge that correlates with human observed instances, which provides a new framework for KD. Our formulation encodes instance as query and teacher’s representation as key. To teach the decoder how to find knowledge, we design an auxiliary task that relies on knowledge for recognition and localization. The proposed method consistently improves various detectors, leading to impressive performance gain, some student networks even surpass their teachers. In addition to our design of the auxiliary task, we believe there are other alternations that can cover different situations or provide a theoretical formulation of knowledge, which will be a potential direction for further researches.
|
| 232 |
+
|
| 233 |
+
# Acknowledgments and Disclosure of Funding
|
| 234 |
+
|
| 235 |
+
This paper is supported by the National Key R&D Plan of the Ministry of Science and Technology (Project No. 2020AAA0104400) and Beijing Academy of Artificial Intelligence (BAAI).
|
| 236 |
+
|
| 237 |
+
# References
|
| 238 |
+
|
| 239 |
+
[1] Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In CVPR, 2018.
|
| 240 |
+
[2] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. VQA: visual question answering. In ICCV, 2015.
|
| 241 |
+
[3] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. ArXiv preprint, 2016.
|
| 242 |
+
[4] Zhaowei Cai and Nuno Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR, 2018.
|
| 243 |
+
[5] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020.
|
| 244 |
+
[6] Guobin Chen, Wongun Choi, Xiang Yu, Tony X. Han, and Manmohan Chandraker. Learning efficient object detection models with knowledge distillation. In NeurIPS, 2017.
|
| 245 |
+
[7] Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li, Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, Zheng Zhang, Dazhi Cheng, Chenchen Zhu, Tianheng Cheng, Qijie Zhao, Buyu Li, Xin Lu, Rui Zhu, Yue Wu, Jifeng Dai, Jingdong Wang, Jianping Shi, Wanli Ouyang, Chen Change Loy, and Dahua Lin. MMDetection: Open mmlab detection toolbox and benchmark. arXiv preprint arXiv:1906.07155, 2019.
|
| 246 |
+
[8] Liangyu Chen, Tong Yang, Xiangyu Zhang, Wei Zhang, and Jian Sun. Points as queries: Weakly semi-supervised object detection by points. In CVPR, 2021.
|
| 247 |
+
[9] Xu Cheng, Zhefan Rao, Yilan Chen, and Quanshi Zhang. Explaining knowledge distillation by quantifying the knowledge. In CVPR, 2020.
|
| 248 |
+
[10] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In CVPR, 2016.
|
| 249 |
+
[11] Xing Dai, Zeren Jiang, Zhao Wu, Yiping Bao, Zhicheng Wang, Si Liu, and Erjin Zhou. General instance distillation for object detection. In CVPR, 2021.
|
| 250 |
+
[12] M. Everingham, S. M. A. Eslami, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The pascal visual object classes challenge: A retrospective. IJCV, 2015.
|
| 251 |
+
[13] Jianping Gou, Baosheng Yu, Stephen J Maybank, and Dacheng Tao. Knowledge distillation: A survey. IJCV, 2021.
|
| 252 |
+
[14] Jianyuan Guo, Kai Han, Yunhe Wang, Han Wu, Xinghao Chen, Chunjing Xu, and Chang Xu. Distilling object detectors via decoupled features. In CVPR, 2021.
|
| 253 |
+
[15] Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural networks. In NeurIPS, 2015.
|
| 254 |
+
[16] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross B. Girshick. Mask R-CNN. In ICCV, 2017.
|
| 255 |
+
[17] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 256 |
+
[18] Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In ICCV, 2017.
|
| 257 |
+
[19] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. In NeurIPS, 2014.
|
| 258 |
+
[20] Han Hu, Jiayuan Gu, Zheng Zhang, Jifeng Dai, and Yichen Wei. Relation networks for object detection. In CVPR, 2018.
|
| 259 |
+
[21] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 260 |
+
[22] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In NeurIPS, 2016.
|
| 261 |
+
[23] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. JMLR, 2017.
|
| 262 |
+
[24] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, 2012.
|
| 263 |
+
[25] Hei Law and Jia Deng. Cornernet: Detecting objects as paired keypoints. In ECCV, 2018.
|
| 264 |
+
[26] Kuang-Huei Lee, Xi Chen, Gang Hua, Houdong Hu, and Xiaodong He. Stacked cross attention for image-text matching. In ECCV, 2018.
|
| 265 |
+
[27] Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In ICLR, 2017.
|
| 266 |
+
[28] Quanquan Li, Shengying Jin, and Junjie Yan. Mimicking very efficient network for object detection. In CVPR, 2017.
|
| 267 |
+
[29] Tsung-Yi Lin, Piotr Dollár, Ross B. Girshick, Kaiming He, Bharath Hariharan, and Serge J. Belongie. Feature pyramid networks for object detection. In CVPR, 2017.
|
| 268 |
+
[30] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In ICCV, 2017.
|
| 269 |
+
[31] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
|
| 270 |
+
[32] Yufan Liu, Jiajiong Cao, Bing Li, Chunfeng Yuan, Weiming Hu, Yangxi Li, and Yunqiang Duan. Knowledge distillation via instance relationship graph. In CVPR, 2019.
|
| 271 |
+
[33] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019.
|
| 272 |
+
[34] 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 NeurIPS, 2019.
|
| 273 |
+
[35] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In ECCV, 2016.
|
| 274 |
+
[36] Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NeurIPS, 2015.
|
| 275 |
+
[37] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. Fitnets: Hints for thin deep nets. In ICLR, 2015.
|
| 276 |
+
[38] Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In CVPR, 2018.
|
| 277 |
+
[39] Mingxing Tan and Quoc V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In ICML, Proceedings of Machine Learning Research, 2019.
|
| 278 |
+
[40] Zhi Tian, Hao Chen, Xinlong Wang, Yuliang Liu, and Chunhua Shen. AdelaiDet: A toolbox for instance-level recognition tasks. https://git.io/adelaidet, 2019.
|
| 279 |
+
[41] Zhi Tian, Chunhua Shen, and Hao Chen. Conditional convolutions for instance segmentation. In Proc. Eur. Conf. Computer Vision (ECCV), 2020.
|
| 280 |
+
[42] Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. FCOS: fully convolutional one-stage object detection. In ICCV, 2019.
|
| 281 |
+
[43] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 282 |
+
[44] Jianfeng Wang, Lin Song, Zeming Li, Hongbin Sun, Jian Sun, and Nanning Zheng. End-to-end object detection with fully convolutional network. In CVPR, 2021.
|
| 283 |
+
[45] Tao Wang, Li Yuan, Xiaopeng Zhang, and Jiashi Feng. Distilling object detectors with finegrained feature imitation. In CVPR, 2019.
|
| 284 |
+
[46] Xinlong Wang, Rufeng Zhang, Tao Kong, Lei Li, and Chunhua Shen. SOLOv2: Dynamic and fast instance segmentation. In NeurIPS, 2020.
|
| 285 |
+
[47] Yuxin Wu, Alexander Kirillov, Francisco Massa, Wan-Yen Lo, and Ross Girshick. Detectron2. https://github.com/facebookresearch/detectron2, 2019.
|
| 286 |
+
[48] Jianwei Yang, Jiasen Lu, Dhruv Batra, and Devi Parikh. A faster pytorch implementation of faster r-cnn. https://github.com/jwyang/faster-rcnn.pytorch, 2017.
|
| 287 |
+
[49] Li Yuan, Francis E. H. Tay, Guilin Li, Tao Wang, and Jiashi Feng. Revisiting knowledge distillation via label smoothing regularization. In CVPR, 2020.
|
| 288 |
+
[50] Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. In ICLR, 2017.
|
| 289 |
+
[51] Linfeng Zhang and Kaisheng Ma. Improve object detection with feature-based knowledge distillation: Towards accurate and efficient detectors. In ICLR, 2021.
|
md/train/qG4ZVCCyCB0/qG4ZVCCyCB0.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/r1l4eQW0Z/r1l4eQW0Z.md
ADDED
|
@@ -0,0 +1,591 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# KERNEL IMPLICIT VARIATIONAL INFERENCE
|
| 2 |
+
|
| 3 |
+
Jiaxin $\mathbf { S h i ^ { * \dagger } }$ , Shengyang $\mathbf { S u n } ^ { * \dagger }$ , $\mathbf { J u n \ : Z h u } ^ { \dagger }$
|
| 4 |
+
†Department of Computer Science & Technology, THU Lab for Brain and AI, Tsinghua University
|
| 5 |
+
‡Department of Computer Science, University of Toronto
|
| 6 |
+
shijx15@mails.tsinghua.edu.cn, ssy@cs.toronto.edu, dcszj@tsinghua.edu.cn
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Recent progress in variational inference has paid much attention to the flexibility of variational posteriors. One promising direction is to use implicit distributions, i.e., distributions without tractable densities as the variational posterior. However, existing methods on implicit posteriors still face challenges of noisy estimation and computational infeasibility when applied to models with high-dimensional latent variables. In this paper, we present a new approach named Kernel Implicit Variational Inference that addresses these challenges. As far as we know, for the first time implicit variational inference is successfully applied to Bayesian neural networks, which shows promising results on both regression and classification tasks.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Bayesian methods have been playing vital roles in machine learning by providing a principled approach for generative modeling, posterior inference and preventing over-fitting (Ghahramani, 2015). As it becomes a common practice to build deep models that have many parameters (LeCun et al., 2015), it is even more important to have a Bayesian formulation to capture the uncertainty in these models. For example, Bayesian Neural Networks (BNNs) (Neal, 2012; Blundell et al., 2015) have shown promise in reasoning about model confidence and learning with few labeled data. Another recent trend is to incorporate deep neural networks as a powerful function mapping between random variables in a Bayesian network, such as deep generative models like variational autoencoders (VAE) (Kingma & Welling, 2013).
|
| 15 |
+
|
| 16 |
+
Except a few simple examples, Bayesian inference is typically challenging, for which variational inference (VI) has been a standard workhorse to approximate the true posterior (Zhu et al., 2017). Traditional VI focuses on factorized variational posteriors to get analytical updates (known as Meanfield VI). While recent progress in this field drives VI into stochastic, differentiable and amortized (Hoffman et al., 2013; Paisley et al., 2012; Mnih & Gregor, 2014; Kingma & Welling, 2013), which does not rely on analytical updates anymore, factorized posteriors are still commonly used as the variational family. This greatly restricts the flexibility of the variational posterior, especially in highdimensional spaces, which often leads to biased solutions as the true posterior is usually not factorized, thus not in the family. There have been some works that try to improve the flexibility of variational posteriors, borrowing ideas from invertible transformation of probability distributions (Rezende & Mohamed, 2015; Kingma et al., 2016). In their works, it is important for the transformation to be invertible to ensure that the transformed distribution has a tractable density.
|
| 17 |
+
|
| 18 |
+
Although utilizing invertible transformation is a promising direction to increase the expressiveness of the variational posterior, we argue that a more flexible variational family can be constructed by using general deterministic or stochastic transformations, which are not necessarily invertible. As a common result, the variational posterior we get in this way does not have a tractable density, despite that there is a way to sample from it. This kind of distribution is called implicit distributions, and for variational methods that use an implicit variational posterior (also known as variational programs (Ranganath et al., 2016) or wild variational approximations (Liu & Feng, 2016)), we refer to them as Implicit Variational Inference (implicit VI). Most of the existing implicit VI methods (Mescheder et al., 2017; Huszar, 2017; Tran et al., 2017) rely on a discriminator to produce estimates of the ´ variational objective and its gradients. As pointed out by many of them, the estimates are often noisy and can lead to unstable training. Besides, discriminator-based approaches are computationally infeasible when applied to nontrivial BNNs.
|
| 19 |
+
|
| 20 |
+
In this paper we present an approach named Kernel Implicit Variational Inference (KIVI), which addresses the noisy estimation problem in previous works by providing a principled way of tuning the bias-variance tradeoff. Furthermore, KIVI does not rely on a discriminator and thus is computationally feasible for models with high-dimensional latent variables (e.g., BNNs). KIVI is applicable to both global and local latent variable models, which is demonstrated by experiments on BNNs and VAEs. As far as we know, this is the first time that implicit VI is successfully applied to BNNs, which shows promising results on both regression and classification tasks.
|
| 21 |
+
|
| 22 |
+
# 2 BACKGROUND
|
| 23 |
+
|
| 24 |
+
Consider a generative model $p ( \mathbf { z } , \mathbf { x } ) \ : = \ : p ( \mathbf { z } ) p ( \mathbf { x } | \mathbf { z } )$ , where $\mathbf { x }$ and $\mathbf { z }$ denote observed and latent variables, respectively. In VI, a variational distribution $q _ { \phi } ( \mathbf { z } )$ in some parametric family is chosen to approximate the true posterior $p ( \mathbf { z } | \mathbf { x } )$ by optimizing the evidence lower bound (ELBO):
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
\mathcal { L } ( \mathbf { x } ; \phi ) = \mathbb { E } _ { q _ { \phi } ( \mathbf { z } ) } \left[ \log p ( \mathbf { x } | \mathbf { z } ) \right] - \mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) | | p ( \mathbf { z } ) ) ,
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
where KL denotes the Kullback-Leibler divergence $\begin{array} { r } { \mathrm { K L } ( q \| p ) \ = \ \mathbb { E } _ { q } [ \log \frac { q } { p } ] } \end{array}$ . This objective is a lower bound of the log-likelihood $\log p ( \mathbf { x } )$ since it can be written as $\hat { \mathcal { L } } ( \mathbf { x } ; \boldsymbol { \phi } ) = \log p ( \mathbf { x } ) -$ $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) | | p ( \mathbf { z } | \mathbf { x } ) )$ . The maximum of this objective is achieved when $q _ { \phi } ( \mathbf { z } ) = p ( \mathbf { z } | \mathbf { x } )$ . From Eq. (1), we can see that the challenge of using an implicit $q _ { \phi }$ is that calculating $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ requires evaluating the density of $q _ { \phi }$ , which is intractable for an implicit distribution.
|
| 31 |
+
|
| 32 |
+
Recently, inspired by the probabilistic interpretation of Generative Adversarial Networks (GAN) (Goodfellow et al., 2014; Mohamed & Lakshminarayanan, 2016), there have been some works that extend the GAN approach to the posterior inference of latent variable models (LVMs) (Mescheder et al., 2017; Huszar, 2017; Tran et al., 2017). These methods all use an implicit variational family and ´ thus can be categorized into implicit VI methods. One of their key observations is that the density ratio $\frac { q _ { \phi } ( \mathbf { z } ) } { p ( \mathbf { z } ) }$ can be estimated from samples of the two distributions by a probabilistic classifier called the discriminator. They first assign class labels $( y )$ to $q$ and $p$ : Let samples from $q _ { \phi } ( \mathbf { z } )$ be of class $y = 1$ , and samples from $p ( \mathbf { z } )$ be of class $y = 0$ . Given an equal class prior, the density ratio at a given point can be calculated as $q _ { \phi } ( \mathbf { z } ) / p ( \mathbf { \bar { z } } ) = p ( \mathbf { z } | y = 1 ) / p ( \mathbf { \bar { z } } | y = 0 ) \overset { \cdot } { = } p ( y = 1 | \mathbf { z } ) / p ( y = 0 | \mathbf { z } ) .$ , which is the ratio between the class probabilities given the data point. To estimate this, a discriminator $D$ is trained to classify between the two classes, with a logistic loss:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\operatorname* { m a x } _ { D } \mathbb { E } _ { q _ { \phi } ( \mathbf { z } ) } \left[ \log \left( D ( \mathbf { z } ) \right) \right] + \mathbb { E } _ { p ( \mathbf { z } ) } \left[ \log \left( 1 - D ( \mathbf { z } ) \right) \right] ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $D ( \mathbf { z } )$ outputs the probability of $\mathbf { z }$ ’s being from class $y = 1$ . Given that $D$ is sufficiently flexible, the optimal solution of Eq. (2) is $\dot { D } ( \mathbf { z } ) = q _ { \phi } ( \bar { \mathbf { z } } ) / ( q _ { \phi } ( \mathbf { z } ) + \overset { \cdot } { p } ( \mathbf { z } ) )$ . Therefore, the KL divergence term in the ELBO of Eq. (1) can be approximated as $\begin{array} { r } { \mathrm { K L } ( q _ { \phi } | | p ) \approx \mathbb { E } _ { q _ { \phi } ( \mathbf { z } ) } \left[ \log D ( \mathbf { z } ) - \log ( 1 - D ( \mathbf { z } ) ) \right] . } \end{array}$ . This is called prior-contrastive forms of VI in Huszar (2017). Note that the ratio approximation does ´ not change the gradients once the approximation is accurate, as we shall see later in Eq. (7). Though incorporating the discriminative power in a probabilistic model has shown great success in GANs, this method still suffers from challenging problems when applied to VI:
|
| 39 |
+
|
| 40 |
+
• Noisy density ratio estimation (DRE) In VI, the variational posterior gets updated in each iteration. As shown in Eq. (2), the discriminator should be trained to optimum after each update. However, in practice the inner loop for training the discriminator is often truncated to one or several iterations. At the beginning of the inference procedure, it is hard for the discriminator to catch up with the variational posterior. The noisy signal produced by the discriminator leads to noisy gradients and thus unstable training. Besides, even if the discriminator quickly achieves the optimum in a small number of iterations, there is still another issue. Notice that the training loss in Eq. (2) is with expectations. But in practice we are using samples from the two distributions to approximate it. When the support of the distributions is high-dimensional, given the limited number of samples we use, the variance of this estimate is considerable, i.e., the discriminator tends to overfit the samples. The phenomenon is that the discriminator arrives at a state where samples are easily distinguished and the probabilities given by the discriminator are near 0 or 1, which is commonly observed in experiments (Mescheder et al., 2017).
|
| 41 |
+
|
| 42 |
+
• Computationally infeasible for high dimensional latent variables As the density ratio is estimated by a discriminator, the samples from the two distributions of latent variables should be fed into it. However, the typically used neural network discriminator cannot afford very high-dimensional inputs (e.g., parameters in a moderate-size Bayesian neural network).
|
| 43 |
+
|
| 44 |
+
# 3 KERNEL IMPLICIT VARIATIONAL INFERENCE
|
| 45 |
+
|
| 46 |
+
To address the above challenges for implicit VI, we propose to replace the discriminator with a kernel method for DRE. The advantages of this method are that it has a closed-form solution and that it allows us to explicitly tradeoff between bias and variance by tuning a regularization coefficient.
|
| 47 |
+
|
| 48 |
+
# 3.1 ESTIMATING THE KL TERM
|
| 49 |
+
|
| 50 |
+
Specifically, let $\textbf { z } \in \mathbb { R } ^ { d }$ be the latent variable, and the true density ratio is $r ( { \bf z } ) = q _ { \phi } ( { \bf z } ) / p ( { \bf z } )$ . Consider modeling it with a function $\hat { r } \in \mathcal H$ , where $\mathcal { H }$ is a Reproducing Kernel Hilbert Space (RKHS) induced by a positive definite kernel $k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } \stackrel { - } { } \mathbb { R }$ . Similar to kernel ridge regression, we use an objective composed of a squared loss for regression plus a penalty for the complexity of the function. For the squared loss we choose the form used by the unconstrained Least Square Importance Fitting (uLSIF) (Kanamori et al., 2009):
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathcal { I } ( \hat { r } ) = \frac { 1 } { 2 } \int ( \hat { r } ( \mathbf { z } ) - r ( \mathbf { z } ) ) ^ { 2 } p ( \mathbf { z } ) ~ d \mathbf { z } = \frac { 1 } { 2 } \mathbb { E } _ { p } \hat { r } ( \mathbf { z } ) ^ { 2 } - \mathbb { E } _ { q } \hat { r } ( \mathbf { z } ) + C ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $C$ is a constant, and approximate the expectation in $\mathcal { I } ( \hat { r } )$ by Monte Carlo estimates:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\hat { \mathcal { I } } ( \hat { r } ) = \frac { 1 } { 2 n _ { p } } \sum _ { i = 1 } ^ { n _ { p } } \hat { r } ( { \bf z } _ { i } ^ { p } ) ^ { 2 } - \frac { 1 } { n _ { q } } \sum _ { j = 1 } ^ { n _ { q } } \hat { r } ( { \bf z } _ { j } ^ { q } ) + C , \quad { \bf z } _ { i } ^ { p } \sim p ( { \bf z } ) , ~ { \bf z } _ { j } ^ { q } \sim q _ { \phi } ( { \bf z } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $n _ { p }$ and $n _ { q }$ are the number of samples from $p$ and $q$ , respectively. Note that in Eq. (3), the expectation of the squared loss is taken w.r.t. $p$ so that the resulting form can be estimated without evaluating the density of both distributions. For the penalty term, the complexity of $\hat { r }$ is measured by its RKHS norm $\| \hat { r } \| _ { \mathcal { H } } ^ { 2 } )$ . Putting them together, we get the final objective:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\operatorname* { m i n } _ { \hat { r } \in \mathcal { H } } \hat { \mathcal { I } } ( \hat { r } ) + \frac { \lambda } { 2 } \| \hat { r } \| _ { \mathcal { H } } ^ { 2 } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Here $\lambda$ is the regularization coefficient.
|
| 69 |
+
|
| 70 |
+
Proposition 1. The optimal solufunctions centered at the samples $( \{ \mathbf { z } _ { i } ^ { p } \} _ { i = 1 } ^ { n _ { p } } , \{ \mathbf { z } _ { j } ^ { q } \} _ { j = 1 } ^ { n _ { q } } )$ in th, i.e., $\hat { r }$ inear subspace spanned by the kernel has the form:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\hat { r } = \sum _ { i = 1 } ^ { n _ { p } } \alpha _ { i } k ( \mathbf { z } _ { i } ^ { p } , \cdot ) + \sum _ { j = 1 } ^ { n _ { q } } \beta _ { j } k ( \mathbf { z } _ { j } ^ { q } , \cdot ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Proof. This can be seen as the generalization of the representer theorem (Scholkopf et al., 2001) to ¨ the density ratio problem. So the proof follows the same procedure. See Appendix A. □
|
| 77 |
+
|
| 78 |
+
Substituting Eq. (5) into Eq. (4) and setting the derivatives w.r.t. $_ \alpha$ and $\beta$ to zeros, we get the optimal solution (a detailed derivation is given in Appendix B):
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\beta = \frac { 1 } { \lambda n _ { q } } { \bf 1 } , \quad \alpha = - \frac { 1 } { \lambda n _ { p } n _ { q } } \left( \frac { 1 } { n _ { p } } { \bf K } _ { p } + \lambda { \bf I } \right) ^ { - 1 } { \bf K } _ { p q } { \bf 1 } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $( \mathbf { K } _ { p } ) _ { i , j } = k ( \mathbf { z } _ { i } ^ { p } , \mathbf { z } _ { j } ^ { p } )$ and $( \mathbf { K } _ { p q } ) _ { i , j } = k ( \mathbf { z } _ { i } ^ { p } , \mathbf { z } _ { j } ^ { q } )$ . We use the common RBF kernels $k ( { \bf z } , { \bf z } ^ { \prime } ) =$ $\exp \left( - \| \mathbf { z } - \mathbf { z } ^ { \prime } \| _ { 2 } ^ { 2 } / 2 \sigma ^ { 2 } \right)$ . $\sigma$ is the kernel bandwidth, which is determined by the commonly used median heuristic (the median of pairwise distances of the sample points).
|
| 85 |
+
|
| 86 |
+
Once we have the approximate density ratio function $\hat { r }$ , a Monte Carlo estimate of $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ can be constructed by $\textstyle { \frac { 1 } { n _ { q } } } \sum _ { i = 1 } ^ { n _ { q } } \log { \hat { r } } ( \mathbf { z } _ { i } ^ { q } )$ . Note that there is a constraint that the estimated density ratio should be non-negative. However, we do not involve it in the optimization objective in order to get a closed-form solution, which indicates that some post-processing is needed to ensure this property. We solve the issue by clipping the estimated density ratio. The clipping values are searched from $\{ 1 0 ^ { - 8 } , 1 0 ^ { - 1 6 } , 1 0 ^ { - 3 2 } \}$ . In experiments we found that the algorithm is not sensitive to the clipping value. This is due to the accurate estimation guaranteed by the global optimum in the RKHS, which is a universal family when RBF kernels are used (Carmeli et al., 2010).
|
| 87 |
+
|
| 88 |
+
The reverse ratio trick Another technique is essential to improve the estimation of the KL term, which we call the reverse ratio trick. The key observation is that the expectation in the squared loss $\mathcal { I } ( \hat { r } )$ in Eq. (3) is taken w.r.t. $p$ , whereas the expectation in the KL term $( \mathrm { K L } ( q \| p ) )$ is taken w.r.t. $q$ . Unless $p$ and $q$ match very well in where they put most probabilities, a small squared loss does not always mean a good KL estimate. The solution is by a simple trick. Instead of estimating $\frac { q } { p }$ , we choose to estimate $\begin{array} { r } { r _ { p q } = \frac { p } { q } } \end{array}$ and compute the KL term as $- \mathbb { E } _ { q } \log { \frac { p } { q } }$ . We denote the estimated reverse density ratio as $\hat { r } _ { p q }$ , then the corresponding KL estimate is $- \mathbb { E } _ { q } \operatorname { l o g } \hat { r } _ { p q }$ . Note that in this way the squared loss changes to $\begin{array} { r } { \mathcal { I } ( \hat { r } _ { p q } ) = \frac { 1 } { 2 } \int ( \hat { r } _ { p q } ( \mathbf { z } ) - r _ { p q } ( \mathbf { z } ) ) ^ { 2 } q _ { \phi } ( \mathbf { z } ) ~ \dot { d } \mathbf { z } , } \end{array}$ whose expectation is taken w.r.t. the same probability measure $( q )$ as the KL term’s. As we shall see in experiments (Appendix F.1), the trick is essential to make the estimation sufficiently accurate for VI.
|
| 89 |
+
|
| 90 |
+
Gradient computation We now consider how to estimate the gradients of the KL term w.r.t. variational parameters $\phi$ . First it is easy to prove as in Huszar (2017) that ´
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\nabla _ { \phi } \mathrm { K L } ( q _ { \phi } \| p ) = - \nabla _ { \phi } \mathbb { E } _ { q _ { \phi } } \log \frac { p } { q _ { \phi } } = - \nabla _ { \phi } \mathbb { E } _ { q _ { \phi } } \log \frac { p } { q } .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
A detailed proof is in Appendix C. Eq. (7) indicates that the true gradients of the KL term w.r.t. $\phi$ do not flow through the density ratio function. We now replace the ratio on the right side with $\hat { r } _ { p q }$ : $\nabla _ { \phi } \mathrm { K L } ( q _ { \phi } | | p ) \approx \dot { - } \nabla _ { \phi } \mathbb { E } _ { q _ { \phi } } \log \dot { r } _ { p q }$ . Note that without Eq. (7) we cannot do the approximation since $\hat { r } _ { p q }$ has zero gradients w.r.t. $\phi$ . Then, the reparameterization trick (Kingma & Welling, 2013) can be used:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
- \nabla _ { \phi } \mathbb { E } _ { q _ { \phi } } \log \hat { r } _ { p q } = - \mathbb { E } _ { \epsilon \sim N ( 0 , I ) } \nabla _ { \phi } \log \hat { r } _ { p q } \big ( { \mathbf { z } ^ { q } } ( \epsilon ; \phi ) \big ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
# 3.2 THE ALGORITHM
|
| 103 |
+
|
| 104 |
+
We have constructed a closed-form estimate for the KL term and show its gradients can be estimated by the reparameterization trick. Note that the reparameterization trick can also be used to compute the gradients of the reconstruction term in Eq. (1) and thus can be applied to the ELBO. See Algo. 1 for the complete algorithm. Note that the number of samples $( M )$ used in the reconstruction term can be different from that required for the KL estimation, which can be reduced when the model is expensive (e.g., we set $M = 1$ in the experiments of VAEs). Thus compared to normal reparameterized VI, the extra computational cost is mainly in calculating the inverse of the $n _ { p } \times n _ { p }$ matrix in Eq. (6). As we shall see in experiments, tens or a hundred samples are sufficient to obtain a stable KL estimate, so the added cost is not high.
|
| 105 |
+
|
| 106 |
+
# Algorithm 1 Kernel Implicit Variational Inference (KIVI)
|
| 107 |
+
|
| 108 |
+
Require: Observed data $\mathbf { x }$ , model $p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } )$
|
| 109 |
+
|
| 110 |
+
Require: Implicit variational posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ , $n _ { p } , n _ { q } , M$
|
| 111 |
+
|
| 112 |
+
1: repeat
|
| 113 |
+
2: Sample from the prior: $\mathbf { z } _ { i } ^ { p } \sim p ( \mathbf { z } ) , i = 1 , \ldots , n _ { p }$ .
|
| 114 |
+
3: Sample from the variational posterior: $\mathbf { z } _ { j } ^ { q } \sim q _ { \phi } ( \mathbf { \bar { z } } | \mathbf { x } ) , j = 1 , \ldots , n _ { q } .$ .
|
| 115 |
+
4: Compute the density ratio $\hat { r } _ { p q }$ by Eq. (5), (6) and clip $\hat { r } _ { p q }$ to be positive at $\mathbf { z } ^ { q } \mathbf { s }$ .
|
| 116 |
+
5: Compute $\begin{array} { r } { \hat { \mathrm { K L } } = - \frac { 1 } { n _ { q } } \sum _ { j = 1 } ^ { n _ { q } } \log \hat { r } _ { p q } ( \mathbf { z } _ { j } ^ { q } ) } \end{array}$ and $\begin{array} { r } { \hat { \mathcal { L } } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \log p ( \mathbf { x } | \mathbf { z } _ { m } ^ { q } ) - \hat { \mathrm { K L } } . } \end{array}$
|
| 117 |
+
6: Estimate $\nabla _ { \phi } \mathcal { L }$ with the reparameterization trick.
|
| 118 |
+
7: Do gradient ascent with $\nabla _ { \phi } \mathcal { L }$ .
|
| 119 |
+
8: (Optional) For parameter learning, do gradient ascent with $\nabla _ { \boldsymbol { \theta } } \mathcal { L }$ .
|
| 120 |
+
9: until Convergence
|
| 121 |
+
|
| 122 |
+
KIVI addresses the two challenges stated in Sec. 2. First, the ratio estimates are given in closed-forms, thus not having the problem of not catching up. Second, the bias-variance trade-off of the estimation can be controlled by the regularization coefficient $\lambda$ . When $\lambda$ is set smaller, the estimation is more aggressive to match the samples. When $\lambda$ is set larger, the estimated ratio function is smoother.
|
| 123 |
+
|
| 124 |
+
Choosing an appropriate $\lambda$ , the variance of the gradients can be controlled, compared to the extreme ratio estimates given by discriminators when their output probabilities are near 0 or 1. Moreover, KIVI is directly applicable to both global and local latent variable models (LVMs), which is an advantage over nonparametric VI methods like particle mirror descent (Dai et al., 2015) and Stein variational gradient descent (SVGD) (Liu & Wang, 2016). For the task of training local LVMs like VAEs, we additionally use the adaptive contrast (AC) technique (Mescheder et al., 2017), whose details are summarized in Appendix D.
|
| 125 |
+
|
| 126 |
+
# 4 EXAMPLE: IMPLICIT VARIATIONAL BAYESIAN NEURAL NETWORKS
|
| 127 |
+
|
| 128 |
+
Now we present an example for using KIVI in Bayesian neural networks (BNNs), which have received increasing attention due to their ability to model uncertainty, an important factor in many tasks such as adversarial defense and reinforcement learning. However, despite that we have removed the need for a discriminator, it is still nontrivial to apply KIVI to BNNs because we need to design an implicit posterior that outputs very high-dimensional samples of latent variables (weights). Existing implicit posteriors (Mescheder et al., 2017; Song et al., 2017) based on traditional fully-connected neural networks cannot handle such a high-dimensional output space. We present Matrix Multiplication Neural Network (MMNN), an efficient architecture for sampling large matrices. Deploying MMNN, KIVI can easily scale up to large BNNs.
|
| 129 |
+
|
| 130 |
+
In BNNs, a prior is specified over the neural network parameters $\mathbf { W } = \{ \mathbf { W } _ { l } \} _ { l = 1 } ^ { L }$ , where $\mathbf { W } _ { l }$ indicates weights in the $l$ -th layer. Given an input $\mathbf { x }$ , the output $y$ is modeled with
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r } { \mathbf { W } \sim N ( \mathbf { 0 } , \mathbf { I } ) , \quad \hat { y } = f _ { \mathrm { N N } } ( \mathbf { x } , \mathbf { W } ) , \quad y \sim \mathcal { P } ( \hat { y } ; \theta ) , } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $\hat { y }$ is the output of the feed-forward network $f _ { \mathrm { N N } }$ , and $y$ is of a distribution $\mathcal { P }$ parameterized by $\hat { y }$ and $\theta$ . For regression, $\mathcal { P }$ is usually a Gaussian with $\hat { y }$ as the mean. For classification, $\mathcal { P }$ is usually a discrete distribution with $\hat { y }$ as the unnormalized log probabilities.
|
| 137 |
+
|
| 138 |
+
The true posterior of W in BNNs is intractable. Thus we turn to VI and use a variational posterior $q$ to approximate it. Denoting the dataset with $\mathbf { X } = \{ \mathbf { x } _ { i } \} _ { i = 1 } ^ { N }$ , $\mathbf { Y } = \{ y _ { i } \} _ { i = 1 } ^ { N }$ , we have the ELBO:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
{ \mathcal { L } } ( \mathbf { Y } , \mathbf { X } ; \phi ) = \mathbb { E } _ { q _ { \phi } ( \mathbf { W } ) } \log p ( \mathbf { Y } | \mathbf { X } , \mathbf { W } ) - \mathrm { K L } ( q _ { \phi } ( \mathbf { W } ) \| p ( \mathbf { W } ) ) .
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
The variational posterior is usually set to be factorized by layer: $\begin{array} { r } { q _ { \phi } ( \mathbf { W } ) = \prod _ { l = 1 } ^ { L } q _ { \phi _ { l } } ( \mathbf { W } _ { l } ) } \end{array}$ . However, previous methods used variational posteriors with a limited capacity for each $q _ { \phi _ { l } } ( \mathbf { W } _ { l } )$ , including factorized Gaussian (Hernandez-Lobato & Adams, 2015), matrix variate Gaussian (Louizos $\&$ Welling, 2016; Sun et al., 2017) and normalizing flows (Louizos $\&$ Welling, 2017). Enabled to learn implicit variational posteriors, we propose to adopt a general distribution without an explicit density function, which has a form of
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathbf { W } _ { l } ^ { 0 } \sim N ( \mathbf { 0 } , \mathbf { I } ) , \quad \mathbf { W } _ { l } ^ { q } = g _ { \phi _ { l } } ( \mathbf { W } _ { l } ^ { 0 } ) .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
# Algorithm 2 MMNN
|
| 151 |
+
|
| 152 |
+
Here $g$ is a transformation parameterized by $\phi _ { l }$ , and $\mathbf { W } _ { l } ^ { q }$ are treated as samples from $q$ . The key challenge is that $\mathbf { W } _ { l }$ are very high dimensional for moderate size neural networks. Thus, we often cannot use a fully connected neural network (MLP) as $g$ . Inspired by low-rank matrix factorization (Koren et al., 2009), we propose a new kind of network called Matrix Multiplication Neural Network (MMNN) to serve as $g$ , as shown in Alg. 2. In each layer of an MMNN, an input matrix $\mathbf { X } _ { i }$ $( M _ { i n } \times N _ { i n } )$ is left multiplied with a pa
|
| 153 |
+
|
| 154 |
+
0Require: Network parameters Require: Input matrix $\mathbf { X } _ { 0 }$ $\{ \mathbf { A } _ { i } ^ { l } , \mathbf { B } _ { i } ^ { l } , \mathbf { A } _ { i } ^ { r } , \mathbf { B } _ { i } ^ { r } \} _ { i = 1 } ^ { L }$
|
| 155 |
+
1: for $i = 1 , \ldots , L$ do
|
| 156 |
+
2: Left multiplication: $\mathbf { X } _ { i } = \mathbf { A } _ { i } ^ { l } \mathbf { X } _ { i - 1 } + \mathbf { B } _ { i } ^ { l }$
|
| 157 |
+
3: Right multiplication: $\mathbf { X } _ { i } = \mathbf { X } _ { i } \mathbf { A } _ { i } ^ { r } + \mathbf { B } _ { i } ^ { r }$
|
| 158 |
+
4: if $i \le L - 1$ then
|
| 159 |
+
5: $\mathbf { X } _ { i } = \operatorname { R e l u } \left( \mathbf { X } _ { i } \right)$
|
| 160 |
+
6: end if
|
| 161 |
+
7: end for
|
| 162 |
+
8: Output $\mathbf { X } _ { L }$
|
| 163 |
+
|
| 164 |
+
To model the implicit posterior of $\mathbf { W } _ { l }$ , we only need to randomly sample a matrix $\mathbf { W } _ { l } ^ { 0 }$ of smaller size, and propagate it through the MMNN to get the output variational samples $( \mathbf { W } _ { l } ^ { q } )$ :
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\mathbf { W } _ { l } ^ { 0 } \sim N ( \mathbf { 0 } , \mathbf { I } ) , \quad \mathbf { W } _ { l } ^ { q } = \mathrm { M M N N } _ { \phi _ { l } } ( \mathbf { W } _ { l } ^ { 0 } ) .
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
When modeling a matrix, MMNN has significant computational advantages over MLPs, due to its low-rank property. For example, to model an $M \times N$ weight matrix, consider a single-layer MMNN with the input matrix $\mathbf { W } _ { 0 }$ of size $M _ { 0 } \times N _ { 0 }$ , the parameters needed are $\mathbf { A } _ { 1 } ^ { l } , \mathbf { B } _ { 1 } ^ { l } , \mathbf { \bar { A } } _ { 1 } ^ { r } , \mathbf { \bar { B } } _ { 1 } ^ { r }$ and they are in total of size $M M _ { 0 } + M N _ { 0 } + N _ { 0 } N + M N$ , while if a single fully-connected layer is used, the parameter size is $M _ { 0 } N _ { 0 } M N$ , which is much larger. Thus, we can use an MMNN as $g$ in the variational posterior for normal-size neural networks. In tasks with very small networks, we still use an MLP as $g$ .
|
| 171 |
+
|
| 172 |
+
# 5 RELATED WORK
|
| 173 |
+
|
| 174 |
+
Our work closely relates to the works on implicit generative models (IGMs, generative models that define implicit distributions) and density ratio estimation (DRE). IGMs have drawn much attention due to the popularity of GANs. General learning algorithms of implicit models have been surveyed in Mohamed & Lakshminarayanan (2016), where DRE plays a central role. The connection between DRE and GANs is also discussed in Uehara et al. (2016). For a comprehensive review of DRE, we refer the readers to the survey (Hido et al., 2011). We also refer the readers to many other works by Sugiyama and his collaborators on DRE, such as KLIEP (Sugiyama et al., 2008), LSIF (Kanamori et al., 2009), and DRE based on Bregman divergence (Sugiyama et al., 2012).
|
| 175 |
+
|
| 176 |
+
Our work also builds upon the recent VI methods, including stochastic approximation by mini-batches (Hoffman et al., 2013), direct gradient optimization of variational lower bounds (Paisley et al., 2012; Mnih & Gregor, 2014), and the reparameterization trick for training continuous LVMs (Kingma & Welling, 2013). Following the success of learning with IGMs, implicit distributions are applied to VI. Many of them are based on discriminators, which can be divided into two categories: prior-contrastive (PC) and joint-contrastive (JC) (Huszar, 2017). In PC methods discriminators distinguish between ´ samples from the prior and those from the variational posterior, while in JC methods they distinguish between the model joint distribution and the joint distribution composed of the data distribution and the variational posterior. Concurrent with Huszar (2017), Mescheder et al. (2017) proposed ´ Adversarial Variational Bayes (AVB), which is an amortized version of PC methods for training local LVMs like VAEs. Prior to Huszar (2017), similar ideas with JC methods have been proposed in ´ ALI (Dumoulin et al., 2016) and Bi-GAN (Donahue et al., 2016). Nonparametric VI methods such as PMD (Dai et al., 2015) and SVGD (Liu & Wang, 2016) that adapt a set of particles towards the true posterior are also closely related to implicit VI. They share the similar advantage of flexible approximations. More recently, the amortized version of SVGD has been developed (Liu & Feng, 2016) and the same idea has been applied to MCMC (Li et al., 2017). It was further shown in Li & Turner (2017) that the core identity in SVGD (Stein’s identity) could also be employed to approximate the gradients of implicit distributions.
|
| 177 |
+
|
| 178 |
+
# 6 EXPERIMENTS
|
| 179 |
+
|
| 180 |
+
We present empirical results on both synthetic and real datasets to demonstrate the benefits of KIVI. All implementations are based on ZhuSuan (Shi et al., 2017).
|
| 181 |
+
|
| 182 |
+
# 6.1 TOY 1-D GAUSSIAN MIXTURES
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 1: Fitting Gaussian Mixture distribution
|
| 186 |
+
|
| 187 |
+
We firstly conduct a toy experiment to approximate a 1-D Gaussian mixture distribution with VI. The Gaussian mixture distribution has two equally distributed unit-variance components
|
| 188 |
+
|
| 189 |
+
whose means are -3 and 3. We compare KIVI with VI using a single Gaussian posterior (Fig. 1). The variational distribution used by KIVI generates samples by propagating a standard normal distribution through a two-layer MLP with 10 hidden units in each layer and one output unit. As shown, the Gaussian posterior converges to a single mode. In contrast, KIVI can accurately approximate the two modes with an expressive variational posterior. We defer another toy experiment on 2-D Bayesian logistic regression to Appendix F.1, where the importance of the reverse ratio trick is illustrated.
|
| 190 |
+
|
| 191 |
+
Table 1: Average test set RMSE, predictive log-likelihood for the regression datasets.
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">Avg. Test RMSE</td><td colspan="3">Avg. Test LL</td></tr><tr><td>SVGD</td><td>Dropout</td><td>KIVI</td><td>SVGD</td><td>Dropout</td><td>KIVI</td></tr><tr><td>Boston</td><td>2.957±0.099</td><td>2.97±0.19</td><td>2.798±0.173</td><td>-2.504±0.029</td><td>-2.46±0.06</td><td>-2.527±0.102</td></tr><tr><td>Concrete</td><td>5.324±0.104</td><td>5.23±0.12</td><td>4.702±0.116</td><td>-3.082±0.018</td><td>-3.04±0.02</td><td>-3.054±0.043</td></tr><tr><td>Energy</td><td>1.374±0.045</td><td>1.66±0.04</td><td>0.467±0.015</td><td>-1.767±0.024</td><td>-1.99±0.02</td><td>-1.298±0.005</td></tr><tr><td>Kin8nm</td><td>0.090±0.001</td><td>0.10±0.00</td><td>0.075±0.001</td><td>0.984±0.008</td><td>0.95±0.01</td><td>1.162±0.008</td></tr><tr><td>Naval</td><td>0.004±0.000</td><td>0.01±0.00</td><td>0.001±0.000</td><td>4.089±0.012</td><td>3.80±0.01</td><td>5.501±0.121</td></tr><tr><td>Combined</td><td>4.033±0.033</td><td>4.02±0.04</td><td>3.976±0.037</td><td>-2.815±0.008</td><td>-2.80±0.01</td><td>-2.794±0.009</td></tr><tr><td>Protein</td><td>4.606±0.013</td><td>4.36±0.01</td><td>4.255±0.019</td><td>-2.947±0.003</td><td>-2.89±0.00</td><td>-2.868±0.005</td></tr><tr><td>Wine</td><td>0.609±0.010</td><td>0.62±0.01</td><td>0.629±0.008</td><td>-0.925±0.014</td><td>-0.93±0.01</td><td>-0.958±0.015</td></tr><tr><td>Yacht</td><td>0.864±0.052</td><td>1.11±0.09</td><td>0.737±0.068</td><td>-1.225±0.042</td><td>-1.55±0.03</td><td>-2.123±0.010</td></tr><tr><td>Year</td><td>8.684±NA</td><td>8.849±NA</td><td>8.950±NA</td><td>-3.580±NA</td><td>-3.588±NA</td><td>-3.615±NA</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 6.2 BAYESIAN NEURAL NETWORKS (BNNS)
|
| 196 |
+
|
| 197 |
+
As stated in Sec. 4, the latent variables in BNNs are global to all data points and are usually very high-dimensional, for which a flexible variational family is essential. We compare KIVI with state-of-the-art VI methods by doing regression and classification on standard benchmarks.
|
| 198 |
+
|
| 199 |
+
# 6.2.1 REGRESSION
|
| 200 |
+
|
| 201 |
+
To quantitatively measure the predictive ability of BNNs with KIVI as the inference method, we use standard multivariate regression benchmarks from recent works (Table 1), such as probabilistic backpropagation (PBP) (Hernandez-Lobato & Adams, 2015). We compare with state-of-the-art methods: the Bayesian interpretation of dropout (Gal & Ghahramani, 2016) and stein variational gradient descent (SVGD) (Liu & Wang, 2016) 1. Following the setup in PBP, we use BNNs with one 50-unit hidden layer except in the two large datasets, i.e., Protein Structure and Year Predication MSD, where 100 units are used. We randomly select $9 0 \%$ of the whole dataset for training and leave the rest for testing. We also put a Gamma prior on the precision of the observation noise to adaptively learn it (see Appendix E). For all datasets, we set $n _ { p } = n _ { q } = M = 1 0 0 , \lambda = 0 . 0 0 1$ and set the batch size to 100 and the learning rate to 0.001. The model is trained for 3000 epochs for the small datasets with less than 1000 data points, and 500 epochs for the others. We report the mean errors and standard deviations averaged over 20 runs, except 5 runs for Protein Structure and 1 run for Year Predication MSD. As networks used in these tasks are of a small scale, we use MLPs with one hidden layer in the implicit variational posterior (see Appendix G.2.1 for details).
|
| 202 |
+
|
| 203 |
+
Table 1 shows the results with the best ones marked in bold. Results of SVGD and dropout are cited from their papers, which have the same setting as ours. We can see that KIVI consistently outperforms SVGD and dropout on both RMSE and test-LL for most datasets. Especially on RMSE, KIVI has significant improvements over them except on Wine and Year Predication MSD. It suggests that KIVI enables the implicit variational posterior to capture the predictive uncertainty in network parameters, which is hard to be fully described by a mixture of two delta distributions (dropout) and a fixed set of particles (SVGD). We emphasize that although the nonparametric nature of SVGD has also made the approximation more flexible, it uses the same set of particles throughout the inference procedure, while each iteration of KIVI generates a new set of particles. Thus the implicit posterior learned by KIVI is smoothed by the parametric model. Recently, normalizing flows have shown good performance on BNNs (Louizos & Welling, 2017). So we also experiment with directly applying normalizing flows to this task. The results are reported in Appendix F.2.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
|
| 207 |
+
Figure 2: Results for MNIST classification. The left table shows the test error rates. $\star$ indicates results that are not directly comparable to ours: Wan et al. (2013) used an ensemble of 5 networks, and the second part of Blundell et al. (2015) changed the prior to a scale mixture. The plot on the right shows training lower bound in MNIST classification with prior-contrastive and KIVI.
|
| 208 |
+
|
| 209 |
+
<table><tr><td colspan="3">Method # Hidden # Weights Test err.</td></tr><tr><td>SGD (Simard et al., 2003) 800</td><td>1.3m</td><td>1.6%</td></tr><tr><td rowspan="2">Dropout (Srivastava et al.,2014) Dropconnect (Wan et al., 2013) 800</td><td></td><td>~1.3%</td></tr><tr><td>1.3m</td><td>1.2%*</td></tr><tr><td rowspan="3">Bayes B. (Blundellet al.,2015), 400 with Gaussian posterior</td><td>500k</td><td>1.82%</td></tr><tr><td>800 1.3m</td><td>1.99%</td></tr><tr><td>1200 2.4m</td><td>2.04%</td></tr><tr><td rowspan="3">Bayes B. (Blundellet al.,2015), with scale mixture prior</td><td>400 500k</td><td>1.36%*</td></tr><tr><td>800 1200</td><td>1.3m 1.34%*</td></tr><tr><td>2.4m</td><td>1.32%*</td></tr><tr><td>KIVI</td><td>400 500k</td><td>1.29%</td></tr><tr><td>800</td><td>1.3m</td><td>1.22%</td></tr><tr><td>1200</td><td>2.4m</td><td>1.27%</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 6.2.2 CLASSIFICATION
|
| 212 |
+
|
| 213 |
+
For classification, we present the results on MNIST, which consists of 60,000 training images and 10,000 test images of handwriting digits. Compared to the above datasets in regression, MNIST has a much higher feature dimension, introducing millions of parameters even in moderate-size networks, which brings big challenges for BNNs. As a standard benchmark, the performance on MNIST can be improved by many other techniques, such as convolution, generative pre-training, data augmentation, etc. To ensure a fair comparison, we follow the settings from Bayes-By-Backprop (Blundell et al., 2015) and focus on improving the performance of ordinary MLPs without using any of these techniques. The network structures used are three MLPs, all with two ReLU hidden layers, and the layer sizes are 400, 800 and 1200, respectively. For KIVI, we used MMNNs with two hidden matrix multiplication layers in the implicit posterior (see Appendix G.2.2 for details). We set $n _ { p } = n _ { q } = M = 1 0 , \lambda = 0 . 0 0 1$ , and train for 300 epochs with the batch size as 100. The initial learning rate is 0.001 and is annealed every 100 epochs by ratio 0.5. We used the last 10,000 samples of the training set as the validation set for model selection.
|
| 214 |
+
|
| 215 |
+
Fig. 2 summarizes the results. We can see that KIVI achieves better accuracy compared to plain SGD (Simard et al., 2003), dropout (Srivastava et al., 2014) and Bayes-By-Backprop (Blundell et al., 2015) on all three types of MLPs. KIVI even performs better than Bayes-By-Backprop with a changed prior (scale mixture), which makes the model itself more flexible than ours. When the layer size is 800, our result is comparable to that of an ensemble of 5 networks with dropconnect (Wan et al., 2013), which demonstrates that the implicit posterior has been learned to account for most model uncertainty.
|
| 216 |
+
|
| 217 |
+
We also conduct experiments with the prior-contrastive (PC) method (the counterpart of AVB for global latent variables, see Sec. 2). The key challenge for applying PC here is that the posterior samples are extremely high-dimensional, and if fed into discriminators like neural networks, they will cause unaffordable computation cost. To get around this, we use a logistic regression as the discriminator in PC. The experiment settings of PC are reported in Appendix G.2.2. The training lower bounds of the two methods are plotted in Fig. 2. We can see that in the beginning they increase at the same pace, then PC fails to converge with lower bound explosion while KIVI improves consistently. The explosion is mainly because the input to the discriminator is of hundreds of thousands of dimensions, and plain logistic regression cannot produce reliable density ratio estimates. We also experiment with PC for layer size 800 and 1200. They both fail to converge in the end.
|
| 218 |
+
|
| 219 |
+
# 6.3 VARIATIONAL AUTOENCODERS
|
| 220 |
+
|
| 221 |
+
As stated in Sec. 3.2, KIVI is applicable to both global and local LVMs, and the latter can be learned using an amortized scheme (i.e., use $q _ { \phi } ( { \bf z } | { \bf x } )$ instead of $q _ { \phi } ( \mathbf { z } ) .$ ). Here we present an application on
|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
Figure 3: Variational Autoencoders: (a) Gaussian posterior vs. implicit posterior, where fc denotes a fully-connected layer. They are used by the plain VAE and KIVI, respectively; (b) Training and evaluation curves of the lower bounds on statically binarized MNIST.
|
| 225 |
+
|
| 226 |
+
training variational autoencoders (VAE) with implicit posteriors to demonstrate this. The generative process of VAEs proceeds as
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
\mathbf { z } \sim N ( \mathbf { 0 } , \mathbf { I } ) , \quad \mathbf { x } \sim \mathcal { P } ( f _ { \mathrm { N N } } ( \mathbf { z } ) ) ,
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
where $\mathbf { z }$ are latent features, $\mathbf { x }$ are observations, and $\mathcal { P }$ is the output distribution for modeling the observations, which takes the outputs of the neural network $\left( f _ { \mathrm { N N } } ( \mathbf { z } ) \right)$ as parameters. We conduct experiments on two widely used datasets for generative modeling: binarized MNIST and CelebA (Liu et al., 2015). $\mathcal { P }$ is a Bernoulli distribution for binarized MNIST, while a normal distribution for CelebA. For VAE the variational lower bound has the same form as Eq. (1), except that $q _ { \phi } ( \mathbf { z } )$ is replaced by $q _ { \phi } ( { \bf z } | { \bf x } )$ . The original VAE parameterizes $q _ { \phi } ( { \bf z } | { \bf x } )$ as
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\mathbf { z } = \mu _ { \phi } ( \mathbf { x } ) + { \boldsymbol { \epsilon } } \cdot { \boldsymbol { \sigma } } _ { \phi } ( \mathbf { x } ) , \quad \mu _ { \phi } ( \mathbf { x } ) , \sigma _ { \phi } ( \mathbf { x } ) = g _ { \mathrm { N N } } ( \mathbf { x } ; \phi ) , \quad { \boldsymbol { \epsilon } } \sim N ( \mathbf { 0 } , \mathbf { I } ) ,
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
where $g _ { \mathrm { N N } }$ is a neural network that outputs the parameters of the normal distribution. In the MNIST case, $g _ { \mathrm { N N } }$ is an MLP with two hidden layers, which is illustrated in Fig. 3a (left). To form an implicit posterior, a direct choice is to move the stochastic noise from the output layer to the penultimate hidden layer, as illustrated by Fig. 3a (right).
|
| 239 |
+
|
| 240 |
+
Before applying KIVI, a crucial question is what we expect to get by using implicit posteriors for training VAEs. One target could be that we may get tighter lower bounds of the data log-likelihood (LL) because the algorithm searches in a larger variational family for the optimal lower bound. This suggests, however in a very weak way, that doing optimization in the larger space will lead to better test LL, given the optimization always arrives at local optima. Previously Adversarial Variational Bayes (AVB) has shown some results on MNIST, by comparing the test LL of the plain VAE and the VAE trained by AVB, using golden truths estimated by annealed importance sampling (AIS) (Wu et al., 2016). However, for the results reported in AVB, the model architectures used by the plain VAE and AVB are very different, which leads to concerns about which part of the change contributes to the improved likelihoods.
|
| 241 |
+
|
| 242 |
+
Here we adopt another setting to better demonstrate the gain from implicit posteriors. We observe that the key improvement of implicit posteriors is that objectives with them average over a much broader range of posterior configurations. This effect not only contributes to a larger search space that contains tighter lower bound values, but also makes the VAE model better prevent overfitting. To verify that KIVI keeps this property, we conduct experiments on a statically binarized MNIST dataset and use models with no prior knowledge of the problem (MLPs instead of convnets), which is a typical setting that leads to overfitting. The latent dimension of the VAE model is 8, and $f _ { \mathrm { N N } } ( \mathbf { z } )$ is an MLP with two hidden layers of size 500. The parameters for KIVI are $n _ { p } = n _ { q } = 1 0 0 , M = 1$ More details can be found in Appendix G.3. Fig 3b shows the training and testing curves of VAEs with or without KIVI. It can be seen that the lower bound gap between the training and testing curves of the plain VAE are much larger than that of KIVI, which indicates that the VAE trained by KIVI is less prone to overfitting. After 3k epochs we evaluate the test LL on 2048 test images using AIS and get -97.3 for the plain VAE, while -94.8 for the VAE trained by KIVI.
|
| 243 |
+
|
| 244 |
+
To demonstrate that KIVI scales to larger models, we trained a VAE with the same network structure used by DCGAN (Radford et al., 2015) on CelebA using KIVI. The latent dimension in this case is
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 4: Interpolation experiments for CelebA: AVB (left); KIVI (right).
|
| 248 |
+
|
| 249 |
+
32. The implicit posterior is constructed in a way similar to the one shown in Fig. 3a, with the bottom hidden layers symmetric to the decoder network (See Appendix G.3 for details). To visually check the latent space learned by KIVI, we show the reconstruction results of linearly interpolating between the latent z vectors of two real images after 25 epochs (Fig. 4), when the model has converged. Compared to the latent space learned by AVB after the same epochs (we use the public code from AVB and set the same decoder structure), we find ours are smoother, and the interpolated images are much sharper. More interpolation results through the training process are presented and compared in Appendix F.5. We also use the learned model to generate 10,000 images and evaluate the sample quality using Frechet Inception Distance (FID) (Heusel et al., 2017). The FID scores achieved at ´ epoch 25 by AVB and KIVI are 160 and 41, respectively (smaller is better). In fact many efforts are required to make AVB successfully train a model for CelebA to produce results shown in the figure. As reported in Mescheder et al. (2017), the log prior $\log p ( \mathbf { z } )$ is explicitly added to the discriminator $( T ( \mathbf { x } , \mathbf { z } ) )$ , while KIVI does not need much tuning: there is no need to carefully design a discriminator, and the only two hyper-parameters (i.e., $\lambda$ and the clipping value) both have clear meanings.
|
| 250 |
+
|
| 251 |
+
# 7 CONCLUSIONS
|
| 252 |
+
|
| 253 |
+
We present an implicit VI method named Kernel Implicit Variational Inference (KIVI), which provides a principled way of tuning bias-variance tradeoff and makes implicit VI computationally feasible for models with high-dimensional latent variables. We successfully applied this approach to Bayesian neural networks and achieved superior performance on both regression and classification tasks. We also demonstrate that KIVI can be applied to learn local latent variable models like VAEs. Future work may include applying this method to larger-scale networks and improving the kernel estimator further.
|
| 254 |
+
|
| 255 |
+
# ACKNOWLEDGMENTS
|
| 256 |
+
|
| 257 |
+
The work was supported by the National Natural Science Foundation of China (NSFC) Projects (Nos. 61620106010, 61621136008), Beijing Natural Science Foundation No. L172037, Tsinghua Tiangong Institute for Intelligent Computing, the NVIDIA NVAIL Program and a Project from Siemens.
|
| 258 |
+
|
| 259 |
+
# REFERENCES
|
| 260 |
+
|
| 261 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 262 |
+
|
| 263 |
+
Claudio Carmeli, Ernesto De Vito, Alessandro Toigo, and Veronica Umanita. Vector valued repro- ´ ducing kernel hilbert spaces and universality. Analysis and Applications, 8(01):19–61, 2010.
|
| 264 |
+
|
| 265 |
+
Bo Dai, Niao He, Hanjun Dai, and Le Song. Provable bayesian inference via particle mirror descent. arXiv preprint arXiv:1506.03101, 2015.
|
| 266 |
+
|
| 267 |
+
Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. ¨ arXiv preprint arXiv:1605.09782, 2016.
|
| 268 |
+
|
| 269 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
|
| 270 |
+
|
| 271 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In International Conference on Machine Learning, pp. 1050–1059, 2016.
|
| 272 |
+
|
| 273 |
+
Zoubin Ghahramani. Probabilistic machine learning and artificial intelligence. Nature, 521(7553): 452–459, 2015.
|
| 274 |
+
|
| 275 |
+
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.
|
| 276 |
+
|
| 277 |
+
Jose Miguel Hernandez-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning of bayesian neural networks. In Proceedings of The 32nd International Conference on Machine Learning, pp. 1861–1869, 2015.
|
| 278 |
+
|
| 279 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Gunter Klambauer, and ¨ Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
|
| 280 |
+
|
| 281 |
+
Shohei Hido, Yuta Tsuboi, Hisashi Kashima, Masashi Sugiyama, and Takafumi Kanamori. Statistical outlier detection using direct density ratio estimation. Knowledge and information systems, 26(2): 309–336, 2011.
|
| 282 |
+
|
| 283 |
+
Matthew D Hoffman. Learning deep latent gaussian models with markov chain monte carlo. In International Conference on Machine Learning, pp. 1510–1519, 2017.
|
| 284 |
+
|
| 285 |
+
Matthew D Hoffman, David M Blei, Chong Wang, and John William Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(1):1303–1347, 2013.
|
| 286 |
+
|
| 287 |
+
Ferenc Huszar. Variational inference using implicit distributions. ´ arXiv preprint arXiv:1702.08235, 2017.
|
| 288 |
+
|
| 289 |
+
Alfred Inselberg and Bernard Dimsdale. Parallel coordinates for visualizing multi-dimensional geometry. In Computer Graphics 1987, pp. 25–44. Springer, 1987.
|
| 290 |
+
|
| 291 |
+
Takafumi Kanamori, Shohei Hido, and Masashi Sugiyama. A least-squares approach to direct importance estimation. Journal of Machine Learning Research, 10(Jul):1391–1445, 2009.
|
| 292 |
+
|
| 293 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 294 |
+
|
| 295 |
+
Diederik P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in Neural Information Processing Systems, pp. 4743–4751, 2016.
|
| 296 |
+
|
| 297 |
+
Yehuda Koren, Robert Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8), 2009.
|
| 298 |
+
|
| 299 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 300 |
+
|
| 301 |
+
Yingzhen Li and Richard E Turner. Gradient estimators for implicit models. arXiv preprint arXiv:1705.07107, 2017.
|
| 302 |
+
|
| 303 |
+
Yingzhen Li, Richard E Turner, and Qiang Liu. Approximate inference with amortised mcmc. arXiv preprint arXiv:1702.08343, 2017.
|
| 304 |
+
|
| 305 |
+
Qiang Liu and Yihao Feng. Two methods for wild variational inference. arXiv preprint arXiv:1612.00081, 2016.
|
| 306 |
+
|
| 307 |
+
Qiang Liu and Dilin Wang. Stein variational gradient descent: A general purpose bayesian inference algorithm. In Advances In Neural Information Processing Systems, pp. 2370–2378, 2016.
|
| 308 |
+
|
| 309 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015.
|
| 310 |
+
|
| 311 |
+
Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix gaussian posteriors. arXiv preprint arXiv:1603.04733, 2016.
|
| 312 |
+
|
| 313 |
+
Christos Louizos and Max Welling. Multiplicative normalizing flows for variational bayesian neural networks. arXiv preprint arXiv:1703.01961, 2017.
|
| 314 |
+
|
| 315 |
+
Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Adversarial variational bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017.
|
| 316 |
+
|
| 317 |
+
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In Proceedings of the 31st International Conference on Machine Learning, 2014.
|
| 318 |
+
|
| 319 |
+
Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016.
|
| 320 |
+
|
| 321 |
+
Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 322 |
+
|
| 323 |
+
John Paisley, David Blei, and Michael Jordan. Variational bayesian inference with stochastic search. arXiv preprint arXiv:1206.6430, 2012.
|
| 324 |
+
|
| 325 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 326 |
+
|
| 327 |
+
Rajesh Ranganath, Dustin Tran, Jaan Altosaar, and David Blei. Operator variational inference. In Advances in Neural Information Processing Systems, pp. 496–504, 2016.
|
| 328 |
+
|
| 329 |
+
Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015.
|
| 330 |
+
|
| 331 |
+
Bernhard Scholkopf, Ralf Herbrich, and Alex Smola. A generalized representer theorem. In ¨ Computational learning theory, pp. 416–426. Springer, 2001.
|
| 332 |
+
|
| 333 |
+
Jiaxin Shi, Jianfei Chen, Jun Zhu, Shengyang Sun, Yucen Luo, Yihong Gu, and Yuhao Zhou. ZhuSuan: A library for Bayesian deep learning. arXiv preprint arXiv:1709.05870, 2017.
|
| 334 |
+
|
| 335 |
+
P. Y. Simard, D. Steinkraus, and J. C. Platt. Best practices for convolutional neural networks applied to visual document analysis. In Seventh International Conference on Document Analysis and Recognition, 2003. Proceedings., pp. 958–963, Aug 2003. doi: 10.1109/ICDAR.2003.1227801.
|
| 336 |
+
|
| 337 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in Neural Information Processing Systems, pp. 3738–3746, 2016.
|
| 338 |
+
|
| 339 |
+
Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-nice-mc: Adversarial training for mcmc. arXiv preprint arXiv:1706.07561, 2017.
|
| 340 |
+
|
| 341 |
+
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.
|
| 342 |
+
|
| 343 |
+
Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul V Buenau, and Motoaki Kawanabe. Direct importance estimation with model selection and its application to covariate shift adaptation. In Advances in neural information processing systems, pp. 1433–1440, 2008.
|
| 344 |
+
|
| 345 |
+
Masashi Sugiyama, Taiji Suzuki, and Takafumi Kanamori. Density-ratio matching under the bregman divergence: a unified framework of density-ratio estimation. Annals of the Institute of Statistical Mathematics, 64(5):1009–1044, 2012.
|
| 346 |
+
|
| 347 |
+
Shengyang Sun, Changyou Chen, and Lawrence Carin. Learning structured weight uncertainty in bayesian neural networks. In Artificial Intelligence and Statistics, pp. 1283–1292, 2017.
|
| 348 |
+
|
| 349 |
+
Dustin Tran, Rajesh Ranganath, and David M Blei. Deep and hierarchical implicit models. arXiv preprint arXiv:1702.08896, 2017.
|
| 350 |
+
|
| 351 |
+
Brian L. Trippe and Richard E. Turner. Overpruning in variational bayesian neural networks. In Advances in Approximate Bayesian Inference workshop, NIPS, 2017.
|
| 352 |
+
|
| 353 |
+
Masatoshi Uehara, Issei Sato, Masahiro Suzuki, Kotaro Nakayama, and Yutaka Matsuo. Generative adversarial nets from a density ratio estimation perspective. arXiv preprint arXiv:1610.02920, 2016.
|
| 354 |
+
|
| 355 |
+
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.
|
| 356 |
+
|
| 357 |
+
Yuhuai Wu, Yuri Burda, Ruslan Salakhutdinov, and Roger Grosse. On the quantitative analysis of decoder-based generative models. arXiv preprint arXiv:1611.04273, 2016.
|
| 358 |
+
|
| 359 |
+
Jun Zhu, Jianfei Chen, Wenbo Hu, and Bo Zhang. Big learning with bayesian methods. National Science Review (NSR), 2017.
|
| 360 |
+
|
| 361 |
+
# A PROOF OF PROPOSITION 1
|
| 362 |
+
|
| 363 |
+
Proof. Let $V$ denote the span of the representers of the sample points:
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
V = \mathrm { s p a n } ( \{ k ( \mathbf { z } _ { i } , \cdot ) : i = 1 , \dots , n _ { p } + n _ { q } \} = \left\{ \sum _ { i = 1 } ^ { n _ { p } } \alpha _ { i } k ( \mathbf { z } _ { i } ^ { p } , \cdot ) + \sum _ { j = 1 } ^ { n _ { q } } \beta _ { j } k ( \mathbf { z } _ { j } ^ { q } , \cdot ) \right\} ,
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
where we label $\mathbf { z } _ { 1 : n _ { p } } ^ { p }$ as $\mathbf { z } _ { 1 : n _ { p } }$ and $\mathbf { z } _ { 1 : n _ { q } } ^ { q }$ as ${ \bf z } _ { n _ { p } + 1 : n _ { p } + n _ { q } }$ . Define the orthogonal complement $V _ { \perp }$ to be
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
V _ { \perp } = \{ f \in \mathcal { H } : \langle f , g \rangle = 0 , \forall g \in V \} .
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
Because $\hat { r } \in \mathcal H$ , it can be decomposed into two parts:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\hat { r } = \hat { r } _ { \parallel } + \hat { r } _ { \perp } ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
where $\hat { r } _ { \parallel } \in V$ , and $\hat { r } _ { \perp } \in V _ { \perp }$ . Note that the squared loss is not changed by the orthogonal component $\hat { r } _ { \perp }$ :
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r } { \hat { r } ( \mathbf { z } _ { i } ) = ( \hat { r } _ { \parallel } + \hat { r } _ { \perp } ) ( \mathbf { z } _ { i } ) = \hat { r } _ { \parallel } ( \mathbf { z } _ { i } ) + \langle \hat { r } _ { \perp } , k ( \mathbf { z } _ { i } , \cdot ) \rangle = \hat { r } _ { \parallel } ( \mathbf { z } _ { i } ) . } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Meanwhile the regularization term can be decomposed into $\| \hat { r } _ { \| } \| _ { \mathcal { H } } ^ { 2 } + \| \hat { r } _ { \perp } \| _ { \mathcal { H } } ^ { 2 }$ . So the optimal solution will have $\hat { r } _ { \perp } ^ { * } = 0$ , which indicates that $\hat { r } ^ { * } \in V$ .
|
| 388 |
+
|
| 389 |
+
# B DERIVATION OF THE OPTIMAL DENSITY RATIO FUNCTION
|
| 390 |
+
|
| 391 |
+
Substituting Eq. (5) into Eq. (4) and removing the constant, we get
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \alpha , \beta ) = \frac { 1 } { 2 n _ { p } } \left( | | \mathbf { K } _ { p } \alpha | | _ { 2 } ^ { 2 } + | | \mathbf { K } _ { p q } \beta | | _ { 2 } ^ { 2 } + 2 \alpha ^ { \top } \mathbf { K } _ { p } \mathbf { K } _ { p q } \beta \right) - \frac { 1 } { n _ { q } } \left( \alpha ^ { \top } \mathbf { K } _ { p q } \mathbf { 1 } + \beta ^ { \top } \mathbf { K } _ { q } \mathbf { 1 } \right) } \\ { \displaystyle ~ + \frac { \lambda } { 2 } ( \alpha ^ { \top } \mathbf { K } _ { p } \alpha + \beta ^ { \top } \mathbf { K } _ { q } \beta + 2 \alpha ^ { \top } \mathbf { K } _ { p q } \beta ) , } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
where $( \mathbf { K } _ { p } ) _ { i , j } = k ( \mathbf { z } _ { i } ^ { p } , \mathbf { z } _ { j } ^ { p } )$ , $( \mathbf { K } _ { p q } ) _ { i , j } = k ( \mathbf { z } _ { i } ^ { p } , \mathbf { z } _ { j } ^ { q } )$ , and $( \mathbf { K } _ { q } ) _ { i , j } = k ( \mathbf { z } _ { i } ^ { q } , \mathbf { z } _ { j } ^ { q } )$ . Taking derivatives w.r.t. $_ { \pmb { \alpha } }$ and $\beta$ and setting them to zeros:
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { l } { \displaystyle \frac { \partial \mathcal { L } } { \partial \alpha } = \frac { 1 } { n _ { p } } \mathbf { K } _ { p } ( \mathbf { K } _ { p } \alpha + \mathbf { K } _ { p q } \beta ) - \frac { 1 } { n _ { q } } \mathbf { K } _ { p q } \mathbf { 1 } + \lambda \mathbf { K } _ { p } \alpha + \lambda \mathbf { K } _ { p q } \beta = \mathbf { 0 } , } \\ { \displaystyle \frac { \partial \mathcal { L } } { \partial \beta } = \frac { 1 } { n _ { p } } \mathbf { K } _ { p q } ^ { \top } ( \mathbf { K } _ { p q } \beta + \mathbf { K } _ { p } \alpha ) - \frac { 1 } { n _ { q } } \mathbf { K } _ { q } \mathbf { 1 } + \lambda \mathbf { K } _ { q } \beta + \lambda \mathbf { K } _ { p q } ^ { \top } \alpha = \mathbf { 0 } . } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Rearranging the terms, we have
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\begin{array} { r } { \left( \frac { 1 } { n _ { p } } \mathbf { K } _ { p } \mathbf { K } _ { p q } + \lambda \mathbf { K } _ { p q } \right) \boldsymbol { \beta } + \mathbf { K } _ { p } \left( \frac { 1 } { n _ { p } } \mathbf { K } _ { p } + \lambda \mathbf { I } \right) \boldsymbol { \alpha } = \frac { 1 } { n _ { q } } \mathbf { K } _ { p q } \mathbf { 1 } , } \\ { \left( \frac { 1 } { n _ { p } } \mathbf { K } _ { p q } ^ { \top } \mathbf { K } _ { p q } + \lambda \mathbf { K } _ { q } \right) \boldsymbol { \beta } + \mathbf { K } _ { p q } ^ { \top } \left( \frac { 1 } { n _ { p } } \mathbf { K } _ { p } + \lambda \mathbf { I } \right) \boldsymbol { \alpha } = \frac { 1 } { n _ { q } } \mathbf { K } _ { q } \mathbf { 1 } . } \end{array}
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
Left multiplying Eq. (8) with $\mathbf { K } _ { p q } ^ { \top } \mathbf { K } _ { p } ^ { - 1 }$ and then subtracting Eq. (9) yields
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\beta = \frac { 1 } { \lambda n _ { q } } { \bf 1 } .
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
Substituting the optimal $\beta$ into Eq. (8), we get
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\pmb { \alpha } = - \frac { 1 } { \lambda n _ { p } n _ { q } } ( \frac { 1 } { n _ { p } } \mathbf { K } _ { p } + \lambda \mathbf { I } ) ^ { - 1 } \mathbf { K } _ { p q } \mathbf { 1 } .
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
Note that although $\mathbf { K } _ { p } ^ { - 1 }$ is used in the derivation, the forms of the solution do not require $\mathbf { K } _ { p }$ to be invertible. In fact, if $\mathbf { K } _ { p }$ has zero eigenvalues (not invertible), the objective $\mathcal { L } ( \alpha , \beta )$ is not bounded below since one can always choose an $_ { \pmb { \alpha } }$ in the null space of $\mathbf { K } _ { p }$ to decrease it. In other words, the form of the solution is well defined in any condition and is optimal when the objective is well defined.
|
| 422 |
+
|
| 423 |
+
C GRADIENTS OF THE KL TERM
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\begin{array} { l } { \nabla _ { \phi } \mathrm { K L } ( q _ { \phi } | | p ) = \nabla _ { \phi } \mathrm { E } _ { q _ { \phi } } \log \frac { q _ { \phi } } { p } } \\ { = \displaystyle \int \left[ \nabla _ { \phi } q _ { \phi } ( z ) \log \frac { q _ { \phi } ( z ) } { p ( z ) } + q _ { \phi } ( z ) \nabla _ { \phi } \log \frac { q _ { \phi } ( z ) } { p ( z ) } \right] \mathrm { d } z } \\ { = \nabla _ { \phi } \mathrm { E } _ { q _ { \phi } } \log \frac { q } { p } + \displaystyle \int \nabla _ { \phi } q _ { \phi } ( z ) \mathrm { d } z } \\ { = \nabla _ { \phi } \mathrm { E } _ { q _ { \phi } } \log \frac { q } { p } . } \end{array}
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
The formula above shows that a good density ratio estimator gives accurate gradient estimation of $\phi$ .
|
| 430 |
+
|
| 431 |
+
# D KIVI WITH ADAPTIVE CONTRAST
|
| 432 |
+
|
| 433 |
+
Although KIVI gives rather good estimation of the density ratio, the estimation accuracy still degrades with larger discrepancy between $p$ and $q$ . The problem is very critical for local latent variable models like VAEs because the same variational model is required to infer posteriors of all local latent variables. In order to mitigate that, AVB (Mescheder et al., 2017) adopted a technique called Adaptive Contrast (AC), which can easily be integrated with KIVI. AC introduces an auxiliary tractable distribution $r _ { \alpha } ( { \bf z } | { \bf x } )$ that resembles $q$ . With $r _ { \alpha } ( { \bf z } | { \bf x } )$ , the ELBO can be rewritten as
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\mathscr { L } ( \mathbf { x } ; \phi ) = \mathrm { E } _ { q \phi } ( - \log r _ { \alpha } ( \mathbf { z } | \mathbf { x } ) + \log p ( \mathbf { x } , \mathbf { z } ) ) - \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | r _ { \alpha } ( \mathbf { z } | \mathbf { x } ) ) .
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Gradients of the first term w.r.t. $\phi$ can be easily computed using Monte Carlo, and gradients of the second term can be estimated using KIVI. Adaptive contrast gives better estimates if $r _ { \alpha } ( { \bf z } | { \bf x } )$ approximates $q$ well. Because $r$ is required to have a tractable density, a commonly used adaptive distribution is a Gaussian distribution whose mean $\mu _ { r }$ and standard derivation $\sigma _ { r }$ match with $q$ . In practice $\mu _ { r }$ and $\sigma _ { r }$ are estimated from the samples of $q$ . According to the invariance of KL divergence under reparameterization, we have
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | r _ { \alpha } ( \mathbf { z } | \mathbf { x } ) ) = \mathrm { K L } ( \hat { q } _ { \phi } ( \hat { \mathbf { z } } | \mathbf { x } ) | | \hat { r } _ { 0 } ( \hat { \mathbf { z } } ) ) ,
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
where $\hat { q } _ { \phi } ( { \bf z } | { \bf x } )$ denotes the distribution of $\hat { { \textbf z } } = \frac { { \textbf z } - \mu _ { r } } { \sigma _ { r } }$ and $\hat { r } _ { 0 } ( \hat { \mathbf { z } } )$ denotes the standard normal distribution. Under this reparameterization, we only need to estimate the density ratio between two distributions with zero means and unit variances.
|
| 446 |
+
|
| 447 |
+
# E LOWER BOUND WITH GAMMA-PRIOR PRECISION
|
| 448 |
+
|
| 449 |
+
In the multivariate regression task, the output is sampled from a normal distribution with $\hat { y } \left( x , \mathbf { W } \right)$ as the mean and a parameter as the variance. The variance controls the likelihood of the model, therefore, choosing an appropriate variance is essential. We place a Gamma prior Gamma $( 6 , 6 )$ on its reciprocal (i.e., the precision of the normal distribution). The variational posterior we used is $q ( \mathbf { W } , \bar { \lambda } ) = q ( \mathbf { W } ) q ( \lambda ) , \bar { q } ( \lambda ) \sim \mathrm { G a m m a } ( \alpha , \beta )$ . Then the ELBO can be calculated as
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r l } & { \mathcal { L } = \mathbb { E } _ { q ( \mathbf { W } ) } \mathbb { E } _ { q ( \lambda ) } \log p \left( y | \mathbf { x } , \mathbf { W } , \lambda \right) - \mathrm { K L } \left( q \left( \mathbf { W } \right) \| p \left( \mathbf { W } \right) \right) - \mathrm { K L } \left( q \left( \lambda \right) \| p \left( \lambda \right) \right) } \\ & { \quad = \mathbb { E } _ { q ( \mathbf { W } ) } \mathbb { E } _ { q ( \lambda ) } \log \mathcal { N } ( y \left( \pmb { \hat { y } } \left( \mathbf { x } , \mathbf { W } \right) , \frac { 1 } { \lambda } \right) - \mathrm { K L } \left( q \left( \mathbf { W } \right) \| p \left( \mathbf { W } \right) \right) - \mathrm { K L } \left( q \left( \lambda \right) \| p \left( \lambda \right) \right) } \\ & { \quad = \displaystyle \frac { 1 } { 2 } \mathbb { E } _ { q ( \mathbf { W } ) } \mathbb { E } _ { q ( \lambda ) } \left[ \log \lambda - \lambda \left( y - \pmb { \hat { y } } \left( \mathbf { x } , \mathbf { W } \right) \right) ^ { 2 } - \log 2 \pi \right] - \mathrm { K L } \left( q \left( \mathbf { W } \right) \| p \left( \mathbf { W } \right) \right) } \\ & { \quad \quad - \mathrm { K L } \left( q \left( \lambda \right) \| p \left( \lambda \right) \right) } \\ & { \quad = \displaystyle \frac { 1 } { 2 } \mathbb { E } _ { q ( \mathbf { W } ) } \left[ \psi \left( \alpha \right) - \log \beta - \frac { \alpha } { \beta } \left( y - \pmb { \hat { y } } \left( \mathbf { x } , \mathbf { W } \right) \right) ^ { 2 } - \log 2 \pi \right] - \mathrm { K L } \left( q \left( \mathbf { W } \right) \| p \left( \mathbf { W } \right) \right) } \\ & { \quad \quad \quad - \mathrm { K L } \left( q \left( \lambda \right) \| p \left( \lambda \right) \right) , } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where $\psi \left( x \right)$ is the digamma function and $\mathrm { K L } \left( q ( \lambda ) \| p ( \lambda ) \right)$ can be calculated in closed-form.
|
| 456 |
+
|
| 457 |
+
# F ADDITIONAL EXPERIMENT RESULTS
|
| 458 |
+
|
| 459 |
+
# F.1 2-D BAYESIAN LOGISTIC REGRESSION
|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
Figure 5: 2-D Bayesian logistic regression
|
| 463 |
+
|
| 464 |
+
We also conduct experiments on a 2-D Bayesian logistic regression example, which has an intractable posterior. The model is
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array} { r } { { \bf w } \sim N ( { \bf 0 } , { \bf I } ) , \quad y _ { i } \sim \mathrm { B e r n o u l l i } ( \sigma ( { \bf w } ^ { \top } { \bf x } _ { i } ) ) , \quad i = 1 , \ldots , N , } \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
where $\mathbf { v } , \mathbf { x } _ { i } \in \mathbb { R } ^ { 2 }$ ; $\sigma$ is the sigmoid function. $N = 2 0 0$ data points $( \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N } )$ are generated from the true model as the training data (Fig. 5a). The unnormalized true posterior is plotted in Fig. 5b. As a baseline, we first run VI with a factorized normal distribution. The result is shown in Fig. 5c. It can be clearly seen that the factorized normal can capture the position and the scale of the true posterior but cannot fit well to the shape due to its independence across dimensions.
|
| 471 |
+
|
| 472 |
+
We then apply KIVI. The implicit posterior we use is a simple stochastic neural network (see Appendix G.1). To demonstrate how good the result is, we also run Hamiltonian Monte Carlo (HMC) to get posterior samples. The results are plotted in Fig. 5d and 5e. We can see that the implicit posterior is learned to capture the strong correlation between the two dimensions and can produce posterior samples that have a similar shape with the samples drawn by HMC.
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 6: Variational distributions produced by only optimizing $\mathrm { K L } ( q ( \mathbf { w } ) \| p ( \mathbf { w } ) )$ : (a) With the reverse ratio trick; (b) Without the reverse ratio trick.
|
| 476 |
+
|
| 477 |
+
We also use this experiment to illustrate the importance of the reverse ratio trick. See Figure 6 for the implicit variational distribution learned by only optimizing $\mathrm { K L } ( q _ { \phi } ( \mathbf { w } ) \| p ( \mathbf { w } ) )$ . In this way we expect the learned $q$ to be close to the prior ${ \cal N } ( { \bf 0 } , { \bf I } )$ . The result produced by using the trick is compared to the result without it. We can see that the latter fails to work well.
|
| 478 |
+
|
| 479 |
+
# F.2 COMPARISON WITH MORE METHODS
|
| 480 |
+
|
| 481 |
+
In this section we present comparisons with two more methods towards flexible posteriors, namely, normalizing flow (Rezende & Mohamed, 2015) and KSD variational inference (KSD VI) (Liu & Feng, 2016). We also include the results by HMC as the ground truth.
|
| 482 |
+
|
| 483 |
+
Normalizing flow The basic idea of normalizing flow has been introduced in Section 1. Specifically, given a random variable $\mathbf { z } \in \mathbb { R } ^ { d }$ following a simple distribution $q ( \mathbf { z } )$ , and an invertible mapping $\breve { T } : \mathbb { R } ^ { d } \to \mathbb { R } ^ { d }$ so that ${ \bf z } ^ { \prime } = T ( { \bf z } )$ , the probability density of the transformed variable $\mathbf { z } ^ { \prime }$ can be calculated as
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
q _ { T } ( \mathbf { z } ^ { \prime } ) = q ( \mathbf { z } ) \left| \operatorname* { d e t } \left( \frac { \partial T ( \mathbf { z } ) } { \partial \mathbf { z } } \right) \right| ^ { - 1 } .
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
Thus we can construct complex distributions by composing invertible mappings $( T )$ , while keeping the probability density of the result distribution tractable by successively applying Eq. (10). For
|
| 490 |
+
|
| 491 |
+
Table 2: Test RMSE, log-likelihood for the regression datasets. Factorized and NF represent VI with factorized normal posteriors and normalizing flow, respectively.
|
| 492 |
+
|
| 493 |
+
<table><tr><td>RMSE</td><td>Factorized</td><td>NF</td><td>KSD VI</td><td>KIVI</td><td>HMC</td></tr><tr><td>boston</td><td>3.42±0.19</td><td>3.43±0.19</td><td>4.10±0.25</td><td>2.80±0.17</td><td>2.20±0.05</td></tr><tr><td>concrete</td><td>6.00±0.10</td><td>6.04±0.10</td><td>12.49±0.19</td><td>4.70±0.12</td><td>4.27±0.13</td></tr><tr><td>energy</td><td>2.42±0.06</td><td>2.48±0.09</td><td>5.54±0.14</td><td>0.47±0.02</td><td>0.47±0.01</td></tr><tr><td>kin8nm</td><td>0.09±0.00</td><td>0.09±0.00</td><td>0.26±0.00</td><td>0.08±0.00</td><td>0.07±0.00</td></tr><tr><td>naval</td><td>0.01±0.00</td><td>0.01±0.00</td><td>0.01±0.01</td><td>0.00±0.00</td><td>0.00±0.00</td></tr><tr><td>LL</td><td>Factorized</td><td>NF</td><td>KSD VI</td><td>KIVI</td><td>HMC</td></tr><tr><td>boston</td><td>-2.66±0.04</td><td>-2.66±0.04</td><td>-3.32±0.01</td><td>-2.53±0.10</td><td>-2.29±0.01</td></tr><tr><td>concrete</td><td>-3.22±0.06</td><td>-3.24±0.06</td><td>-4.13±0.01</td><td>-3.05±0.04</td><td>-2.81±0.02</td></tr><tr><td>energy</td><td>-2.34±0.02</td><td>-2.36±0.03</td><td>-3.61±0.00</td><td>-1.30±0.01</td><td>-1.43±0.01</td></tr><tr><td>kin8nm</td><td>0.96±0.01</td><td>1.01±0.01</td><td>-0.18±0.01</td><td>1.16±0.01</td><td>1.22±0.01</td></tr><tr><td>naval</td><td>4.00±0.11</td><td>4.04±0.12</td><td>3.28±0.13</td><td>5.50±0.12</td><td>7.31±0.00</td></tr></table>
|
| 494 |
+
|
| 495 |
+
example, Rezende & Mohamed (2015) proposed the planar normalizing flow:
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
\begin{array} { r } { T ( \mathbf { z } ) = \mathbf { z } + \mathbf { u } h ( \mathbf { w } ^ { \top } \mathbf { z } + b ) , } \end{array}
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
where u $\mathbf { \mu } _ { ! , \mathbf { \ w } } \in \mathbb { R } ^ { d } , b \in \mathbb { R }$ are free parameters, and $h$ is a smooth element-wise nonlinearty, chosen as Tanh in the following experiments. A simple variational posterior can be made more expressive when this parametric transformation is employed.
|
| 502 |
+
|
| 503 |
+
KSD VI KSD variational inference (Liu & Feng, 2016) is a method that directly minimizes the kernelized Stein discrepancy (KSD) between the true posterior $( p )$ and the variational posterior $( q )$ :
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\begin{array} { r l } & { \mathbb { S } ( q , p ) = \underset { f \in \mathcal { H } ^ { d } } { \operatorname* { m a x } } \left( \mathbb { E } _ { q } [ s _ { p } ( \mathbf { z } ) ^ { \top } f ( \mathbf { z } ) + \nabla _ { \mathbf { z } } \cdot f ( \mathbf { z } ) ] \right) } \\ & { \quad \quad \quad = \mathbb { E } _ { \mathbf { z } , \mathbf { z } ^ { \prime } \sim q } \left[ s _ { p } ( \mathbf { z } ) ^ { \top } k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) s _ { p } ( \mathbf { z } ^ { \prime } ) + s _ { p } ( \mathbf { z } ) ^ { \top } \nabla _ { \mathbf { z } ^ { \prime } } k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) \right. } \\ & { \quad \quad \quad \quad \left. + \nabla _ { \mathbf { z } } k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) ^ { \top } s _ { p } ( \mathbf { z } ^ { \prime } ) + \nabla _ { \mathbf { z } } \cdot \nabla _ { \mathbf { z } ^ { \prime } } k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) \right] , } \end{array}
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
where $\mathcal { H } ^ { d }$ is a unit ball in the vector-valued RKHS induced by the RBF kernel $\begin{array} { r } { k ( \mathbf { z } , \mathbf { z } ^ { \prime } ) = \frac { \| \mathbf { z } - \mathbf { z } ^ { \prime } \| _ { 2 } ^ { 2 } } { 2 \sigma ^ { 2 } } } \end{array}$ and $s _ { q } ( \mathbf { z } ) = \nabla _ { \mathbf { z } } \log p ( \mathbf { z } | \mathbf { x } )$ . Note that the objective in Eq. (11) only requires samples from $q$ , so KSD VI also belongs to implicit VI methods.
|
| 510 |
+
|
| 511 |
+
We conduct the regression experiments in Section 6.2.1. The results are shown in Table 2. For normalizing flow, we apply 10 planar flows on the weights to match the running time of our implicit posteriors. To see whether flows help the inference, we also present results of VI using factorized normal distributions on the weights (with their means and standard deviations optimized by the reparameterization trick). For KSD VI, we use the same implicit posteriors as those we used for KIVI in Section 6.2.1. For VI with factorized normal distributions and normalizing flow, we use 100 samples, batch size 10 except that for kin8nm and naval we use batch size 100. We set the learning rate to 0.01 and run 500 epochs for 20 times. For KSD VI, we set all the training parameters (number of samples, number of epochs, batch size, and learning rate) the same as KIVI’s. We also run HMC to produce the ground truths. For HMC, we use 20 chains, 150000 iterations and set the target acceptance rate to $9 7 \%$ to adapt the step size. As the HMC experiment is time-consuming, we only perform 10 runs.
|
| 512 |
+
|
| 513 |
+
From Table 2 we can see that normalizing flow does not show improvements over VI with factorized normal distributions. This is probably due to optimization challenges caused by the limited form of planar flows, thus the inference procedure takes little benefit from the flexibility introduced by the flow. For KSD VI, we found it is very sensitive to the initialization of implicit posteriors. We had to set the variance of the input Gaussian noise larger so that KSD VI would not diverge at the very beginning of training. KSD VI also soon converges to unsatisfying local optima after the optimization process starts. These two findings are well explained by the conclusion that KSD is the magnitude of a functional gradient of KL divergence (Liu & Wang, 2016), then all saddle points in the original problem of optimizing the KL divergence become local optima when optimizing KSD.
|
| 514 |
+
|
| 515 |
+
# F.3 VISUALIZATION OF INFERRED POSTERIORS
|
| 516 |
+
|
| 517 |
+
In order to visually check the quality of the uncertainty estimated by KIVI, we use a visualization technique named parallel coordinates (Inselberg & Dimsdale, 1987) to plot the posterior over weights. We compare the posteriors inferred in the regression experiment on Boston housing (Table 2) by VI with factorized normal approximation, HMC, and KIVI.
|
| 518 |
+
|
| 519 |
+
The feature dimension of the Boston housing data is 13. And the BNN used is an MLP with a hidden layer of size 50. So the network has two weight matrices: $\mathbf { W } _ { 0 } \in \mathbb { R } ^ { 1 4 \times 5 0 }$ and $\mathbf { W } _ { 1 } \in \mathbb { R } ^ { 5 1 \times 1 }$ (The bias parameters are included). Since $\mathbf { W } _ { 0 }$ has 700 dimensions, we only plot the posterior samples of $\mathbf { W } _ { 1 }$ to avoid visual clutter. Specifically, we draw 100 samples from the posterior: $\mathbf { W } _ { 1 } ^ { ( 1 : 1 0 0 ) } \sim q ( \mathbf { W } _ { 1 } )$ and the goal is to show these 51-dimensional samples. In parallel coordinates each sample is plotted as a polyline (see Figure 7). The vertices on the polyline represent each single dimension. Their positions on the horizontal axis are the indices of the dimension (from 0 to 50). And the vertical coordinates represent the weight values. Note that an important fact about hidden neurons in neural networks is that they are non-identifiable (any two hidden nodes can be exchanged without affecting the output distribution). This indicates that all dimensions of $\mathbf { W } _ { 1 }$ are non-identifiable. Different inference algorithms may converge to different local modes caused by this symmetry. To make the visualizations comparable, we sort the dimensions of $\mathbf { W } _ { 1 }$ for each algorithm by the mean value of posterior samples in each dimension.
|
| 520 |
+
|
| 521 |
+
From the visualization we could see that BNNs with factorized normal approximation have significant over-pruning problems. A large proportion of hidden nodes are turned off during the inference and the information is mainly carried by several others. These pruned weights can be identified by their low signal-to-noise ratio $\frac { | \mu | } { \sigma }$ , where $\mu$ is the mean, and $\sigma$ is the standard deviation. This problem has been pointed out previously, both in VAE works (Sønderby et al., 2016; Hoffman, 2017) and BNN works (Blundell et al., 2015), and can be explained by the looseness of the variational bound when factorized approximation is used (Trippe & Turner, 2017). In contrast, the ground truth by HMC does not have the pruning problems. And there are very strong correlations captured if we observe the neighboring dimensions.2 KIVI also does not have the pruning problems and could capture the strong correlations across the dimensions. And with the gain in accuracy, there is still a good amount of uncertainty in the implicit posterior. Despite the weight dimensions are non-identifiable, we could still see that the two VI methods arrive at biased solutions compared to the ground truth by HMC in terms of scales. Note that this is not necessarily problematic since VI is typically known to produce biased solutions.
|
| 522 |
+
|
| 523 |
+
# F.4 ACCURACY OF KL ESTIMATION
|
| 524 |
+
|
| 525 |
+
From Section 3.1 we know that the approximate gradients of the ELBO are directly related to the KL estimates. So we would like to assess the accuracy of the KL estimator. We adopt the settings from the VAE experiment on MNIST (Section 6.3). For comparison, we must also be able to compute a ground truth of the KL term. To achieve this, we use normalizing flow in $q ( \mathbf { z } | \mathbf { x } )$ , which has a complicated but tractable density. Thus we can get a good Monte Carlo estimate of the true KL term: $\begin{array} { r } { \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) ) \simeq \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \log \frac { q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } ) } { p ( \mathbf { z } _ { i } ) } , \mathbf { z } _ { i } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) . } \end{array}$ . In Figure 8a we compare the KL term estimated using KIVI with the ground truth. Note that since we use adaptive-contrast (AC) (see Appendix D) in the VAE experiments, where the KL term is broken down into two parts, it should make more sense to look at the only part that uses the density ratio estimator (the KL divergence between the standardized $q$ and a standard normal distribution), which is plotted in Figure 8b. We can see that the KL estimates closely track the ground truth, and are more accurate as the variational approximation improves over time.
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
Figure 7: Visualization of learned posteriors for regression on Boston housing.
|
| 529 |
+
|
| 530 |
+

|
| 531 |
+
Figure 8: True KL term vs. estimated KL term for posteriors with normalizing flows.
|
| 532 |
+
|
| 533 |
+
# F.5 CHANGE OF INTERPOLATION RESULTS ON CELEBA THROUGH TRAINING
|
| 534 |
+
|
| 535 |
+
In Figures 9 to 14 we present the generated images for the interpolation experiments on CelebA through the training process. The images are generated after 1, 5, 10, 15, 20, and 25 epochs. Results on the left are produced by AVB, and on the right by KIVI. It can be clearly seen that AVB’s training process is of very high variance, as we have mentioned in Section 2.
|
| 536 |
+
|
| 537 |
+

|
| 538 |
+
Figure 9: Epoch 1
|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
Figure 10: Epoch 5
|
| 542 |
+
|
| 543 |
+
# G DETAILS OF EXPERIMENTS
|
| 544 |
+
|
| 545 |
+
# G.1 TOY EXPERIMENTS
|
| 546 |
+
|
| 547 |
+
1-D Gaussian Mixture The implicit posterior generates samples by propagating samples from a standard normal distribution through a two-layer MLP with 10 hidden units and one output unit. We set the regularization coefficient $\lambda$ to 0.003 and the density ratio clipping threshold to $1 \dot { 0 } ^ { - 8 }$ .
|
| 548 |
+
|
| 549 |
+
2-D Bayesian Logistic Regression The inputs $\mathbf { X }$ are 200 points randomly sampled from $\mathrm { U } [ - 5 , 5 ] \times$ $\mathrm { U } [ - 5 , 5 ]$ . The outputs $\mathbf { Y }$ are the predictions of $\mathbf { X }$ with randomly sampled weights from the prior. For HMC, we run 100 chains, 200 iterations each, and use 10 leapfrog steps. The step size is automatically adapted using dual averaging, starting from 0.001. We discard the first 100 samples generated. For factorized VI, the training is run for 100 epochs and 100 samples are used. In the training, we anneal the learning rate linearly according to 100100+epoch−1 . For KIVI we follow the same setting, except that we use 1k samples. The regularization coefficient $\lambda$ and the minimal density ratio are set to 0.1 and $1 0 ^ { - 8 }$ , respectively. Below we describe the sample generation process of the implicit variational posterior used in KIVI. First, some 2-D random normal samples are propagated through two fully-connected layers of size 20, producing h (we do not use activation functions for the second layer), and then h is added with another random normal noise with trainable variances, producing z. Finally, we propagate z through a fully-connected layer of size 20 and then a linear output layer, getting the variational samples.
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
Figure 11: Epoch 10
|
| 553 |
+
|
| 554 |
+

|
| 555 |
+
Figure 12: Epoch 15
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
Figure 13: Epoch 20
|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
Figure 14: Epoch 25
|
| 562 |
+
|
| 563 |
+
# G.2 BAYESIAN NEURAL NETWORKS
|
| 564 |
+
|
| 565 |
+
# G.2.1 REGRESSION
|
| 566 |
+
|
| 567 |
+
As the regression datasets have small feature dimensions (all less than 15, except 90 for Year), using BNNs of one hidden layer (50 units) does not produce very high-dimensional weights. Therefore, we still use MLPs in the implicit variational posterior, of which the samples are generated by propagating samples from a standard normal distribution through an MLP. For all datasets, we use ReLU as the activation function. The MLP has one hidden layer except that for Yacht it has two hidden layers.
|
| 568 |
+
|
| 569 |
+
We list the details in Table 3, which consist of 10 datasets and 2 weight matrices each. Taking Layer 1 for Boston as an example, (20, 30, N1) represents that 20 random normal samples are generated and propagated through an MLP with a hidden layer of size 30 and an output layer of size $\mathrm { N } 1 { = } 1 4 \times 5 0$ . Note that N1 corresponds to the number of weights in the first layer of the BNN.
|
| 570 |
+
|
| 571 |
+
Table 3: Implicit variational posteriors for regression experiments
|
| 572 |
+
|
| 573 |
+
<table><tr><td></td><td>Boston</td><td>Concrete</td><td>Energy</td><td>Kin8nm</td><td>Naval</td></tr><tr><td>Layer1</td><td>(20,30, N1)</td><td>(30,50,N1)</td><td>(100,500,N1)</td><td>(100,500, N1)</td><td>(100,500, N1)</td></tr><tr><td>Layer 2</td><td>(20,30,N2)</td><td>(30,50,N2)</td><td>(50,100,N2)</td><td>(50,100, N2)</td><td>(50,100,N2)</td></tr><tr><td></td><td>Combined</td><td>Protein</td><td>Wine</td><td>Yacht</td><td>Year</td></tr><tr><td>Layer 1</td><td>(100,500, N1)</td><td>(100,500,N1)</td><td>(20,10, N1)</td><td>(100, 800, N1, N1)</td><td>(100,500, N1)</td></tr><tr><td>Layer 2</td><td>(100,500,N2)</td><td>(100,500, N2)</td><td>(5,20, N2)</td><td>(50,200,51, N2)</td><td>(100,500, N2)</td></tr></table>
|
| 574 |
+
|
| 575 |
+
# G.2.2 CLASSIFICATION
|
| 576 |
+
|
| 577 |
+
MNIST classification needs a larger scale network than the one used in multivariate regression. Therefore, we adopt an MMNN in the implicit variational posterior. We denote the hidden-layer size of the BNN as $L$ (In our experiments $L = 4 0 0$ , 800 or 1200). Below we set $N = 5 0 0$ when $L = 4 0 0$ , otherwise we set $N = 8 0 0$ . In the MMNN, we use two matrix multiplication layers.
|
| 578 |
+
|
| 579 |
+
For the first-layer weights $( 7 8 5 \times L )$ , the two hidden matrix multiplication layers are both of size $N \times N$ and are with ReLU activations. The output layer of the MMNN is of size $L \times 7 8 5$ and is with linear activations. The input matrices are random samples of size $3 0 \times 3 0$ drawn from a standard normal distribution.
|
| 580 |
+
|
| 581 |
+
For the second-layer weights $( L \times ( L + 1 ) )$ , the two hidden matrix multiplication layers are both of size $N \times N$ and are with ReLU activations. The output layer of the MMNN is of size $L \times ( L + 1 )$ and is with linear activations. The input matrices are random samples of size $3 0 \times 3 0$ drawn from a standard normal distribution.
|
| 582 |
+
|
| 583 |
+
For the third-layer weights $( 1 0 \times ( L + 1 ) )$ , the two hidden matrix multiplication layers are both of size $3 0 \times N$ and are with ReLU activations. The output layer of the MMNN is of size $1 0 \times ( L + 1 )$ and is with linear activations. The input matrices are random samples of size $3 0 \times 3 0$ drawn from a standard normal distribution.
|
| 584 |
+
|
| 585 |
+
We use the above variational posterior settings in both KIVI and PC. For PC, a logistic regression serves as the discriminator. We set the regularization coefficient $\lambda$ to 0.001 and the minimal density ratio to $1 0 ^ { - 8 }$ for KIVI. Both two methods use 10 samples, and we set the batch size to 100 and the learning rate to 0.001 in training.
|
| 586 |
+
|
| 587 |
+
# G.3 VARIATIONAL AUTOENCODERS
|
| 588 |
+
|
| 589 |
+
The decoders used in the MNIST experiment are MLPs with two hidden ReLU layers. The latent dimension is 8. Each hidden layer is of size 500. The implicit posterior is also an MLP with two hidden ReLU layers, with Gaussian noises of 500 dimensions added to the first hidden layer. The noise has zero means and 500-dimensional trainable variances. Training is with the batch size 128. The learning rate is 0.001, which is annealed by a factor of 0.5 every 200 epochs. The parameters for KIVI in this case are $n _ { p } = n _ { q } = 1 0 0 , M = 1 , \lambda = 0 . 0 0 1$ , and the clipping value is set to $1 0 ^ { - 8 }$ .
|
| 590 |
+
|
| 591 |
+
The decoders used in the CelebA experiment have exactly the same structure with the one used for $6 4 \times 6 4$ images in the DCGAN paper (Radford et al., 2015). The latent dimension is 32. The implicit variational posterior is a deep convolutional neural network with a symmetric structure to the decoder, except that the output of the last convolutional layer is flattened and is added a Gaussian noise of the same shape as the last dimension. The noise has zero means and trainable variances. The last hidden layer is fully-connected and has 500 ReLU units. For AVB we use the same decoder. For both KIVI and AVB, we use batch size 64. The other training parameters of AVB follow from its original code for CelebA. The parameters for KIVI in this case are $n _ { p } = n _ { q } = 1 0 0 , M = 1 , \lambda = 0 . 0 0 1$ , and the clipping value is set to $1 0 ^ { - 8 }$ . The learning rate for KIVI is 0.0003.
|
md/train/rkFBJv9gg/rkFBJv9gg.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING FEATURES OF MUSIC FROM SCRATCH
|
| 2 |
+
|
| 3 |
+
John Thickstun1, Zaid Harchaoui2 & Sham M. Kakade1,2
|
| 4 |
+
1 Department of Computer Science and Engineering, 2 Department of Statistics
|
| 5 |
+
University of Washington
|
| 6 |
+
Seattle, WA 98195, USA
|
| 7 |
+
{thickstn,sham}@cs.washington.edu, name@uw.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
This paper introduces a new large-scale music dataset, MusicNet, to serve as a source of supervision and evaluation of machine learning methods for music research. MusicNet consists of hundreds of freely-licensed classical music recordings by 10 composers, written for 11 instruments, together with instrument/note annotations resulting in over 1 million temporal labels on 34 hours of chamber music performances under various studio and microphone conditions.
|
| 12 |
+
|
| 13 |
+
The paper defines a multi-label classification task to predict notes in musical recordings, along with an evaluation protocol, and benchmarks several machine learning architectures for this task: i) learning from spectrogram features; ii) endto-end learning with a neural net; iii) end-to-end learning with a convolutional neural net. These experiments show that end-to-end models trained for note prediction learn frequency selective filters as a low-level representation of audio.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Music research has benefited recently from the effectiveness of machine learning methods on a wide range of problems from music recommendation (van den Oord et al., 2013; McFee & Lanckriet, 2011) to music generation (Hadjeres & Pachet, 2016); see also the recent demos of the Google Magenta project1. As of today, there is no large publicly available labeled dataset for the simple yet challenging task of note prediction for classical music. The MIREX MultiF0 Development Set (Benetos & Dixon, 2011) and the Bach10 dataset (Duan et al., 2011) together contain less than 7 minutes of labeled music. These datasets were designed for method evaluation, not for training supervised learning methods.
|
| 18 |
+
|
| 19 |
+
This situation stands in contrast to other application domains of machine learning. For instance, in computer vision large labeled datasets such as ImageNet (Russakovsky et al., 2015) are fruitfully used to train end-to-end learning architectures. Learned feature representations have outperformed traditional hand-crafted low-level visual features and lead to tremendous progress for image classification. In (Humphrey et al., 2012), Humphrey, Bello, and LeCun issued a call to action: “Deep architectures often require a large amount of labeled data for supervised training, a luxury music informatics has never really enjoyed. Given the proven success of supervised methods, MIR would likely benefit a good deal from a concentrated effort in the curation of sharable data in a sustainable manner.”
|
| 20 |
+
|
| 21 |
+
This paper introduces a new large labeled dataset, MusicNet, which is publicly available2 as a resource for learning feature representations of music. MusicNet is a corpus of aligned labels on freely-licensed classical music recordings, made possible by licensing initiatives of the European Archive, the Isabella Stewart Gardner Museum, Musopen, and various individual artists. The dataset consists of 34 hours of human-verified aligned recordings, containing a total of 1, 299, 329 individual labels on segments of these recordings. Table 1 summarizes statistics of MusicNet.
|
| 22 |
+
|
| 23 |
+
The focus of this paper’s experiments is to learn low-level features of music from raw audio data. In Sect. 4, we will construct a multi-label classification task to predict notes in musical recordings, along with an evaluation protocol. We will consider a variety of machine learning architectures for this task: i) learning from spectrogram features; ii) end-to-end learning with a neural net; iii) endto-end learning with a convolutional neural net. Each of the proposed end-to-end models learns a set of frequency selective filters as low-level features of musical audio, which are similar in spirit to a spectrogram. The learned low-level features are visualized in Figure 1. The learned features modestly outperform spectrogram features; we will explore possible reasons for this in Sect. 5.
|
| 24 |
+
|
| 25 |
+
MusicNet
|
| 26 |
+
Table 1: Summary statistics of the MusicNet dataset. See Sect. 2 for further discussion of MusicNet and Sect. 3 for a description of the labelling process. Appendix A discusses the methodology for computing error rate of this process.
|
| 27 |
+
|
| 28 |
+
<table><tr><td> Minutes</td><td>Labels</td><td>Recordings</td><td>Error Rate</td><td></td><td>Composer</td><td> Minutes</td><td>Labels</td></tr><tr><td>2,048</td><td>1,299,329</td><td>330</td><td colspan="2">4.0%</td><td>Beethoven Schubert</td><td>1,085 253</td><td>736,072</td></tr><tr><td colspan="6">Labels</td><td>192</td><td>133,109</td><td>146,648</td></tr><tr><td colspan="6">Ensemble Minutes Solo Piano 917</td><td>Brahms Mozart Bach</td><td>156</td><td>99,641</td></tr><tr><td colspan="6"> String Quartet</td><td>Dvorak</td><td>184</td><td>62,782</td></tr><tr><td colspan="6"> Accompanied Violin</td><td></td><td>56</td><td>46,261</td></tr><tr><td colspan="6"> Piano Quartet</td><td>Cambini</td><td>43</td><td>24,820</td></tr><tr><td colspan="6"> Accompanied Cello</td><td>Faure</td><td></td><td>22,349</td></tr><tr><td colspan="6"> String Sextet</td><td>Ravel</td><td>27</td><td>21,243</td></tr><tr><td colspan="6">Piano Trio</td><td>Haydn</td><td></td><td>6,404</td></tr><tr><td colspan="6">Piano Quintet</td><td></td><td></td><td></td></tr><tr><td colspan="6">25 Wind Quintet 43</td><td> Instrument</td><td> Minutes</td><td>Labels</td></tr><tr><td colspan="6">Horn Piano Trio 30</td><td>Piano</td><td>1346</td><td>794,532</td></tr><tr><td colspan="6">Wind Octet 23</td><td>Violin</td><td>874</td><td>230,484</td></tr><tr><td colspan="6">Clarinet-Cello-Piano Trio</td><td>Viola</td><td>621</td><td>99,407</td></tr><tr><td colspan="6">2524 Pairs Clarinet-Horn-Bassoon</td><td>Cello</td><td>800</td><td>99,132</td></tr><tr><td colspan="6">Clarinet Quintet 26</td><td>Clarinet</td><td>173</td><td>24,426</td></tr><tr><td colspan="6">Solo Cello 49</td><td>Bassoon</td><td>102</td><td>14,954</td></tr><tr><td colspan="6">Accompanied Clarinet 20</td><td>Horn</td><td>132</td><td>11,468</td></tr><tr><td colspan="6">10,049 Solo Violin 30</td><td>Oboe</td><td>66</td><td></td></tr><tr><td colspan="6">Violin and Harpsichord 16</td><td>Flute</td><td>69</td><td>8,696</td></tr><tr><td colspan="6">Viola Quintet 15</td><td></td><td></td><td>8,310</td></tr><tr><td colspan="6"> Solo Flute</td><td>Harpsichord</td><td>16</td><td>4,914</td></tr><tr><td colspan="6"></td><td> String Bass</td><td>38</td><td>3,006</td></tr><tr><td>Piano</td><td>Violin</td><td>Cello</td><td>Viola</td><td>Clarinet Bassoon</td><td>Horn</td><td>Oboe</td><td></td><td></td><td></td></tr><tr><td colspan="6"></td><td></td><td>Flute</td><td>Bass Harpsichord</td><td></td></tr><tr><td>Notes</td><td>83</td><td>51</td><td>51 51</td><td>41</td><td>36</td><td>41 28</td><td>37</td><td>43</td><td>51</td></tr></table>
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
Figure 1: (Left) Bottom-level weights learned by a two-layer ReLU network trained on 16,384- samples windows $( \approx 1 / 3$ seconds) of raw audio with $\ell _ { 2 }$ regularized $\lambda = 1$ ) square loss for multilabel note classification on raw audio recordings. (Middle) Magnified view of the center of each set of weights. (Right) The truncated frequency spectrum of each set of weights.
|
| 32 |
+
|
| 33 |
+
# 2 MUSICNET
|
| 34 |
+
|
| 35 |
+
Related Works. The experiments in this paper suggest that large amounts of data are necessary to recovering useful features from music; see Sect. 4.5 for details. The Lakh dataset, released this summer based on the work of Raffel & Ellis (2015), offers note-level annotations for many 30- second clips of pop music in the Million Song Dataset (McFee et al., 2012). The syncRWC dataset is a subset of the RWC dataset (Goto et al., 2003) consisting of 61 recordings aligned to scores using the protocol described in Ewert et al. (2009). The MAPS dataset (Emiya et al., 2010) is a mixture of acoustic and synthesized data, which expressive models could overfit. The Mazurka project3 consists of commercial music. Access to the RWC and Mazurka datasets comes at both a cost and inconvenience. Both the MAPS and Mazurka datasets are comprised entirely of piano music.
|
| 36 |
+
|
| 37 |
+
The MusicNet Dataset. MusicNet is a public collection of labels (exemplified in Table 2) for 330 freely-licensed classical music recordings of a variety of instruments arranged in small chamber ensembles under various studio and microphone conditions. The recordings average 6 minutes in length. The shortest recording in the dataset is 55 seconds and the longest is almost 18 minutes. Table 1 summarizes the statistics of MusicNet with breakdowns into various types of labels. Table 2 demonstrates examples of labels from the MusicNet dataset.
|
| 38 |
+
|
| 39 |
+
<table><tr><td>Start</td><td>End</td><td>Instrument</td><td>Note</td><td>Measure</td><td>Beat</td><td>Note Value</td></tr><tr><td>45.29</td><td>45.49</td><td>Violin</td><td>G5</td><td>21</td><td>3</td><td>Eighth</td></tr><tr><td>48.99</td><td>50.13</td><td>Cello</td><td>A#3</td><td>24</td><td>2</td><td>Dotted Half</td></tr><tr><td>82.91</td><td>83.12</td><td>Viola</td><td>C5</td><td>51</td><td>2.5</td><td>Eighth</td></tr></table>
|
| 40 |
+
|
| 41 |
+
Table 2: MusicNet labels on the Pascal String Quartet’s recording of Beethoven’s Opus 127, String Quartet No. 12 in E-flat major, I - Maestoso - Allegro. Creative commons use of this recording is made possible by the work of the European Archive.
|
| 42 |
+
|
| 43 |
+
MusicNet labels come from 513 label classes using the most naive definition of a class: distinct instrument/note combinations. The breakdowns reported in Table 1 indicate the number of distinct notes that appear for each instrument in our dataset. For example, while a piano has 88 keys only 83 of them are performed in MusicNet. For many tasks a note’s value will be a part of its label, in which case the number of classes will expand by approximately an order of magnitude after taking the cartesian product of the set of classes with the set of values: quarter-note, eighth-note, triplet, etc. Labels regularly overlap in the time series, creating polyphonic multi-labels.
|
| 44 |
+
|
| 45 |
+
MusicNet is skewed towards Beethoven, thanks to the composer’s popularity among performing ensembles. The dataset is also skewed towards Solo Piano due to an abundance of digital scores available for piano works. For training purposes, researchers may want to augment this dataset to increase coverage of instruments such as Flute and Oboe that are under-represented in MusicNet. Commercial recordings could be used for this purpose and labeled using the alignment protocol described in Sect. 3.
|
| 46 |
+
|
| 47 |
+
# 3 DATASET CONSTRUCTION
|
| 48 |
+
|
| 49 |
+
MusicNet recordings are freely-licensed classical music collected from the European Archive, the Isabella Stewart Gardner Museum, Musopen, and various artists’ collections. The MusicNet labels are retrieved from digital MIDI scores, collected from various archives including the Classical Archives (classicalarchives.com) Suzuchan’s Classic MIDI (suzumidi.com) and HarfeSoft (harfesoft.de). The methods in this section produce an alignment between a digital score and a corresponding freely-licensed recording. A recording is labeled with events in the score, associated to times in the performance via the alignment. Scores containing 6, 550, 760 additional labels are available on request to researchers who wish to augment MusicNet with commercial recordings.
|
| 50 |
+
|
| 51 |
+
Music-to-score alignment is a long-standing problem in the music research and signal processing communities (Raphael, 1999). Dynamic time warping (DTW) is a classical approach to this problem. An early use of DTW for music alignment is Orio & Schwarz (2001) where a recording is aligned to a crude synthesis of its score, designed to capture some of the structure of an overtone series. The method described in this paper aligns recordings to synthesized performances of scores, using side information from a commercial synthesizer. To the best of our knowledge, commercial synthesis was first used for the purpose of alignment in Turetsky & Ellis (2003).
|
| 52 |
+
|
| 53 |
+
The majority of previous work on alignment focuses on pop music. This is more challenging than aligning classical music because commercial synthesizers do a poor job reproducing the wide variety of vocal and instrumental timbers that appear in modern pop. Furthermore, pop features inharmonic instruments such as drums for which natural metrics on frequency representations–including $\ell ^ { 2 }$ –are not meaningful. For classical music to score alignment, a variant of the techniques described in Turetsky & Ellis (2003) works robustly. This method is described below; we discuss the evaluation of this procedure and its error rate on MusicNet in the appendix.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 2: (Left) Heatmap visualization of local alignment costs between the synthesized and recorded spectrograms, with the optimal alignment path in red. The block from $x = 0$ to $x = 1 0 0$ frames corresponds to silence at the beginning of the recorded performance. The slope of the alignment can be interpreted as an instantaneous tempo ratio between the recorded and synthesized performances. The curvature in the alignment between $x \ = \ 1 0 0$ and $x \ = \ 1 7 5$ corresponds to an extension of the first notes by the performer. (Right) Annotation of note onsets on the spectrogram of the recorded performance, determined by the alignment shown on the left.
|
| 57 |
+
|
| 58 |
+
In order to align the performance with a score, we need to define a metric that compares short segments of the score with segments of a performance. Musical scores can be expressed as binary vectors in $E \times K$ where $E = \{ 1 , \ldots , n \}$ and $K$ is a dictionary of notes. Performances reside in $\mathbb { R } ^ { T \times p }$ , where $T \in \{ 1 , \dots , m \}$ is a sequence of time steps and $p$ is the dimensionality of the spectrogram at time $T$ . Given some local cost function $C : ( \mathbb { R } ^ { p } , K ) \to \mathbb { R }$ , a score $\mathbf { Y } \in E \times K$ , and a performance $\mathbf { X } \in \mathbb { R } ^ { T \times p }$ , the alignment problem is to
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r l r } & { \underset { t \in \mathbb { Z } ^ { n } } { \mathrm { m i n i m i z e } } } & { \displaystyle \sum _ { i = 1 } ^ { n } C ( \mathbf { X } _ { t _ { i } } , \mathbf { Y } _ { i } ) } \\ & { \mathrm { s u b j e c t ~ t o } } & { t _ { 0 } = 0 , } \\ & { t _ { n } = m , } \\ & { t _ { i } \leq t _ { j } } & { \mathrm { i f } i < j . } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
Dynamic time warping gives an exact solution to the problem in $\mathcal { O } ( m n )$ time and space.
|
| 65 |
+
|
| 66 |
+
The success of dynamic time warping depends on the metric used to compare the score and the performance. Previous works can be broadly categorized into three groups that define an alignment cost $C$ between segments of music $\mathbf { X }$ and score $\mathbf { y }$ by injecting them into a common normed space via maps $\Psi$ and $\Phi$ :
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
C ( \mathbf { x } , \mathbf { y } ) = \| \Psi ( \mathbf { x } ) - \Phi ( \mathbf { y } ) \|
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The most popular approach–and the one adopted by this paper–maps the score into the space of the performance (Orio & Schwarz, 2001; Turetsky $\&$ Ellis, 2003; Soulez et al., 2003). An alternative approach maps both the score and performance into some third space, commonly a chromogram space (Hu et al., 2003; Izmirli $\&$ Dannenberg, 2010; Joder et al., 2013). Finally, some recent methods consider alignment in score space, taking $\Phi = \mathrm { I d }$ and learning $\Psi$ (Garreau et al., 2014; Lajugie et al., 2016).
|
| 73 |
+
|
| 74 |
+
With reference to the general cost (2), we must specify the maps $\Psi , \Phi$ , and the norm $\| \cdot \|$ . We compute the cost in the performance feature space $\mathbb { R } ^ { p }$ , hence we take $\Psi = \mathrm { I d }$ . For the features, we use the log-spectrogram with a window size of 2048 samples. We use a stride of 512 samples between features. Hence adjacent feature frames are computed with $7 5 \%$ overlap. For audio sampled at $4 4 . 1 \mathrm { k H z }$ , this results in a feature representation with 4 $\mathrm { \Delta } 4 , 1 0 0 / 5 1 2 \approx 8 6 $ frames per second. A discussion of these parameter choices can be found in the appendix. The map $\Phi$ is computed by a synthetizer: we used Plogue’s Sforzando sampler together with Garritan’s Personal Orchestra 4 sample library.
|
| 75 |
+
|
| 76 |
+
For a (pseudo)-metric on $\mathbb { R } ^ { p }$ , we take the $\ell ^ { 2 }$ norm $\| \cdot \| _ { 2 }$ on the low 50 dimensions of $\mathbb { R } ^ { p }$ . Recall that $\mathbb { R } ^ { p }$ represents Fourier components, so we can roughly interpret the $k$ ’th coordinate of $\mathbb { R } ^ { p }$ as the energy associated with the frequency $k \times ( 2 2 , 0 5 0 / \mathrm { 1 0 2 4 } ) \approx \bar { k } \times 2 2 . 5 \mathrm { H z }$ , where $2 2 , 0 5 0 \mathrm { H z }$ is the Nyquist frequency of a signal sampled at $4 4 . 1 \mathrm { k H z }$ . The 50 dimension cutoff is chosen empirically: we observe that the resulting alignments are more accurate using a small number of low-frequency bins rather than the full space $\mathbb { R } ^ { p }$ . Synthesizers do not accurately reproduce the high-frequency features of a musical instrument; by ignoring the high frequencies, we align on a part of the spectrum where the synthesis is most accurate. The proposed choice of cutoff is aggressive compared to usual settings; for instance, Turetsky & Ellis (2003) propose cutoffs in the $2 . 5 \mathrm { k H z }$ range. The fundamental frequencies of many notes in MusicNet are higher than the $5 0 \times 2 2 . 5 \mathrm { H z } \approx 1 \mathrm { k H z }$ cutoff. Nevertheless, we find that all notes align well using only the low-frequency information.
|
| 77 |
+
|
| 78 |
+
# 4 METHODS
|
| 79 |
+
|
| 80 |
+
We consider identification of notes in a segment of audio $\textbf { x } \in \ \mathcal { X }$ as a multi-label classification problem, modeled as follows. Assign each audio segment a binary label vector $\mathbf { y } \in \{ 0 , 1 \} ^ { 1 2 8 }$ . The 128 dimensions correspond to frequency codes for notes, and ${ \bf y } _ { n } = 1$ if note $n$ is present at the midpoint of $\mathbf { x }$ . Let $f : \mathcal { X } \to \mathcal { H }$ indicate a feature map. We train a multivariate linear regression to predict $\hat { \mathbf { y } }$ given $f ( \mathbf { x } )$ , which we optimize for square loss. The vector $\hat { \mathbf { y } }$ can be interpreted as a multi-label estimate of notes in $\mathbf { x }$ by choosing a threshold $c$ and predicting label $n$ iff ${ \hat { \mathbf { y } } } _ { n } > c$ . We search for the value $c$ that maximizes $F _ { 1 }$ -score on a sampled subset of MusicNet.
|
| 81 |
+
|
| 82 |
+
# 4.1 RELATED WORK
|
| 83 |
+
|
| 84 |
+
Learning on raw audio is studied in both the music and speech communities. Supervised learning on music has been driven by access to labeled datasets. Pop music labeled with chords (Harte, 2010) has lead to a long line of work on chord recognition, most recently Korzeniowsk & Widmer (2016). Genre labels and other metadata has also attracted work on representation learning, for example Dieleman & Schrauwen (2014). There is also substantial work modeling raw audio representations of speech; a current example is Tokuda & Zen (2016). Recent work from Google DeepMind explores generative models of raw audio, applied to both speech and music (van den Oord et al., 2016).
|
| 85 |
+
|
| 86 |
+
The music community has worked extensively on a closely related problem to note prediction: fundamental frequency estimation. This is the analysis of fundamental (in contrast to overtone) frequencies in short audio segments; these frequencies are typically considered as proxies for notes. Because access to large labeled datasets was historically limited, most of these works are unsupervised. A good overview of this literature can be found in Benetos et al. (2013). Variants of non-negative matrix factorization are popular for this task; a recent example is Khlif & Sethu (2015). A different line of work models audio probabilistically, for example Berg-Kirkpatrick et al. (2014). Recent work by Kelz et al. (2016) explores supervised models, trained using the MAPS piano dataset.
|
| 87 |
+
|
| 88 |
+
# 4.2 MULTI-LAYER PERCEPTRONS
|
| 89 |
+
|
| 90 |
+
We build a two-layer network with features $f _ { i } ( \mathbf { x } ) = \log \left( 1 + \operatorname* { m a x } ( 0 , \mathbf { w } _ { i } ^ { T } \mathbf { x } ) \right)$ . We find that compression introduced by a logarithm improves performance versus a standard ReLU network (see Table 3). Figure 1 illustrates a selection of weights $w _ { i }$ learned by the bottom layer of this network. The weights learned by the network are modulated sinusoids. This explains the effectiveness of spectrograms as a low-level representation of musical audio. The weights decay at the boundaries, analogous to Gabor filters in vision. This behavior is explained by the labeling methodology: the audio segments used here are approximately $1 / 3$ of a second long, and a segment is given a note label if that note is on in the center of the segment. Therefore information at the boundaries of the segment is less useful for prediction than information nearer to the center.
|
| 91 |
+
|
| 92 |
+
# 4.3 (LOG-)SPECTROGRAMS
|
| 93 |
+
|
| 94 |
+
Spectrograms are an engineered feature representation for musical audio signals, available in popular software packages such as librosa (McFee et al., 2015). Spectrograms (resp. log-spectrograms) are closely related to a two-layer ReLU network (resp. the log-ReLU network described above). If $\mathbf { x } = ( x _ { 1 } , \dots , x _ { t } )$ denotes a segment of an audio signal of length $t$ then we can define
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathrm { S p e c } _ { k } ( \mathbf { x } ) \equiv \left| \sum _ { s = 0 } ^ { t - 1 } e ^ { - 2 \pi i k s / t } x _ { s } \right| ^ { 2 } = \left( \sum _ { s = 0 } ^ { t - 1 } \cos ( 2 \pi k s / t ) x _ { s } \right) ^ { 2 } + \left( \sum _ { s = 0 } ^ { t - 1 } \sin ( 2 \pi k s / t ) x _ { s } \right) ^ { 2 } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
These features are not precisely learnable by a two-layer ReLU network. But recall that $| x | =$ $\operatorname* { m a x } ( 0 , x ) + \operatorname* { m a x } ( 0 , - \bar { x } )$ and if we take weight vectors ${ \bf u } , { \bf v } \in \mathbb { R } ^ { T }$ with $u _ { s } = \cos ( 2 \pi k s / t )$ and $v _ { s } = \sin ( 2 \pi k s / t )$ then the ReLU network can learn
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
f _ { k , \mathrm { c o s } } ( \mathbf { x } ) + f _ { k , \mathrm { s i n } } ( \mathbf { x } ) \equiv | \mathbf { u } ^ { T } \mathbf { x } | + | \mathbf { v } ^ { T } \mathbf { x } | = \left| \sum _ { s = 0 } ^ { t - 1 } \mathrm { c o s } ( 2 \pi k s / t ) x _ { s } \right| + \left| \sum _ { s = 0 } ^ { t - 1 } \mathrm { s i n } ( 2 \pi k s / t ) x _ { s } \right| .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
We call this family of features a ReLUgram and observe that it has a similar form to the spectrogram; we merely replace the $x \mapsto x ^ { 2 }$ non-linearity of the spectrogram with $x \mapsto | x |$ . These features achieve similar performance to spectrograms on the classification task (see Table 3).
|
| 107 |
+
|
| 108 |
+
# 4.4 WINDOW SIZE
|
| 109 |
+
|
| 110 |
+
When we parameterize a network, we must choose the width of the set of weights in the bottom layer. This width is called the receptive field in the vision community; in the music community it is called the window size. Traditional frequency analyses, including spectrograms, are highly sensitive to the window size. Windows must be long enough to capture relevant information, but not so long that they lose temporal resolution; this is the classical time-frequency tradeoff. Furthermore, windowed frequency analysis is subject to boundary effects, known as spectral leakage. Classical signal processing attempts to dampen these effects with predefined window functions, which apply a mask that attenuates the signal at the boundaries (Rabiner & Schafer, 2007).
|
| 111 |
+
|
| 112 |
+
The proposed end-to-end models learn window functions. If we parameterize these models with a large window size then the model will learn that distant information is irrelevant to local prediction, so the magnitude of the learned weights will attenuate at the boundaries. We therefore focus on two window sizes: 2048 samples, which captures the local content of the signal, and 16,384 samples, which is sufficient to capture almost all relevant context (again see Figure 1).
|
| 113 |
+
|
| 114 |
+
# 4.5 REGULARIZATION
|
| 115 |
+
|
| 116 |
+
The size of MusicNet is essential to achieving the results in Figure 1. In Figure 3 (Left) we optimize a two-layer ReLU network on a small subset of MusicNet consisting of 65, 000 monophonic data points. While these features do exhibit dominant frequencies, the signal is quite noisy. Comparable noisy frequency selective features were recovered by Dieleman & Schrauwen (2014); see their Figure 3. We can recover clean features on a small dataset using heavy regularization, but this destroys classification performance; regularizing with dropout poses a similar tradeoff. By contrast, Figure 3 (Right) shows weights learned by an unregularized two-layer network trained on the full MusicNet dataset. The models described in this paper do not overfit to MusicNet and optimal performance (reported in Table 3) is achieved without regularization.
|
| 117 |
+
|
| 118 |
+
# 4.6 CONVOLUTIONAL NETWORKS
|
| 119 |
+
|
| 120 |
+
Previously, we estimated $\hat { \mathbf { y } }$ by regressing against $f ( \mathbf { x } )$ . We now consider a convolutional model that regresses against features of a collection of shifted segments $\mathbf { x } _ { \ell }$ near to the original segment x. The learned features of this network are visually comparable to those learned by the fully connected network (Figure 1). The parameters of this network are the receptive field, stride, and pooling regions.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 3: (Left) Features learned by a 2-layer ReLU network trained on small monophonic subset of MusicNet. (Right) Features learned by the same network, trained on the full MusicNet dataset.
|
| 124 |
+
|
| 125 |
+
The results reported in Table 3 are achieved with 500 hidden units using a receptive field of 2, 048 samples with an 8-sample stride across a window of 16, 384 samples. These features are grouped into average pools of width 16, with a stride of 8 features between pools. A max-pooling operation yields similar results. The learned features are consistent across different parameterizations. In all cases the learned features are comparable to those of a fully connected network.
|
| 126 |
+
|
| 127 |
+
# 5 RESULTS
|
| 128 |
+
|
| 129 |
+
We hold out a test set of 3 recordings for all the results reported in this section:
|
| 130 |
+
|
| 131 |
+
• Bach’s Prelude in D major for Solo Piano. WTK Book 1, No 5. Performed by Kimiko Ishizaka. MusicNet recording id 2303.
|
| 132 |
+
• Mozart’s Serenade in E-flat major. K375, Movement 4 - Menuetto. Performed by the Soni Ventorum Wind Quintet. MusicNet recording id 1819.
|
| 133 |
+
• Beethoven’s String Quartet No. 13 in B-flat major. Opus 130, Movement 2 - Presto. Released by the European Archive. MusicNet recording id 2382.
|
| 134 |
+
|
| 135 |
+
The test set is a representative sampling of MusicNet: it covers most of the instruments in the dataset in small, medium, and large ensembles. The test data points are evenly spaced segments separated by 512 samples, between the 1st and 91st seconds of each recording. For the wider features, there is substantial overlap between adjacent segments. Each segment is labeled with the notes that are on in the middle of the segment.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 4: Precision-recall curves for the convolutional network on the test set. Curves are evaluated on subsets of the test set consisting of all data points (blue); points with exactly one label (monophonic; green); and points with exactly three labels (red).
|
| 139 |
+
|
| 140 |
+
We evaluate our models on three scores: precision, recall, and average precision. The precision score is the count of correct predictions by the model (across all data points) divided by the total number of predictions by the model. The recall score is the count of correct predictions by the model divided by the total number of (ground truth) labels in the test set. Precision and recall are parameterized by the note prediction threshold $c$ (see Sect. 4). By varying $c$ , we construct precision-recall curves (see Figure 4). The average precision score is the area under the precision-recall curve.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Representation</td><td>Window Size</td><td>Precision</td><td>Recall</td><td>Average Precision</td></tr><tr><td>log-spectrograms</td><td>1,024</td><td>49.0%</td><td>40.5%</td><td>39.8%</td></tr><tr><td>spectrograms</td><td>2,048</td><td>28.9%</td><td>52.5 %</td><td>32.9%</td></tr><tr><td>log-spectrograms</td><td>2,048</td><td>61.9%</td><td>42.0%</td><td>48.8%</td></tr><tr><td>log-ReLUgrams</td><td>2.048</td><td>58.9%</td><td>47.9%</td><td>49.3%</td></tr><tr><td>MLP,500 nodes</td><td>2.048</td><td>50.1%</td><td>58.0%</td><td>52.1%</td></tr><tr><td>MLP, 2500 nodes</td><td>2.048</td><td>53.6%</td><td>62.3%</td><td>56.2%</td></tr><tr><td>AvgPool,2 stride</td><td>2,148</td><td>53.4%</td><td>62.5%</td><td>56.4%</td></tr><tr><td>log-spectrograms</td><td>8,192</td><td>64.2%</td><td>28.6%</td><td>52.1%</td></tr><tr><td>log-spectrograms</td><td>16,384</td><td>58.4%</td><td>18.1%</td><td>45.5%</td></tr><tr><td>MLP, 500 nodes</td><td>16,384</td><td>54.4%</td><td>64.8%</td><td>60.0%</td></tr><tr><td>CNN, 64 stride</td><td>16,384</td><td>60.5%</td><td>71.9%</td><td>67.8%</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 3: Benchmark results on MusicNet for models discussed in this paper. The learned representations are optimized for square loss with SGD using the Tensorflow library (Abadi et al.). We report the precision and recall corresponding to the best $F _ { 1 }$ -score on validation data.
|
| 145 |
+
|
| 146 |
+
A spectrogram of length $n$ is computed from $2 n$ samples, so the linear 1024-point spectrogram model is directly comparable to the MLP runs with 2048 raw samples. Learned features4 modestly outperform spectrograms for comparable window sizes. The discussion of windowing in Sect. 4.4 partially explains this. Figure 5 suggests a second reason. Recall (Sect. 4.3) that the spectrogram features can be interpreted as the magnitude of the signal’s inner product with sine waves of linearly spaced frequencies. In contrast, the proposed networks learn weights with frequencies distributed similarly to the distribution of notes in MusicNet (Figure 5). This gives the network higher resolution in the most critical frequency regions.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 5: (Left) The frequency distribution of notes in MusicNet. (Right) The frequency distribution of learned nodes in a 500-node, two-layer ReLU network.
|
| 150 |
+
|
| 151 |
+
# ACKNOWLEDGMENTS
|
| 152 |
+
|
| 153 |
+
We thank Bob L. Sturm for his detailed feedback on an earlier version of the paper. We also thank Brian McFee and Colin Raffel for fruitful discussions. Sham Kakade acknowledges funding from the Washington Research Foundation for innovation in Data-intensive Discovery. Zaid Harchaoui acknowledges funding from the program ”Learning in Machines and Brains” of CIFAR.
|
| 154 |
+
|
| 155 |
+
REFERENCES
|
| 156 |
+
M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mane, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viegas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng. TensorFlow: Largescale machine learning on heterogeneous systems. URL http://tensorflow.org/.
|
| 157 |
+
E. Benetos and S. Dixon. Joint multi-pitch detection using harmonic envelope estimation for polyphonic music transcription. IEEE Selected Topics in Signal Processing, 2011.
|
| 158 |
+
E. Benetos, S. Dixon, D. Giannoulis, H. Kirchoff, and A. Klapuri. Automatic music transcription: challenges and future directions. Journal of Intelligent Information Systems, 2013.
|
| 159 |
+
T. Berg-Kirkpatrick, J. Andreas, and D. Klein. Unsupervised transcription of piano music. NIPS, 2014.
|
| 160 |
+
S. Dieleman and B. Schrauwen. End-to-end learning for music audio. ICASSP, 2014.
|
| 161 |
+
Z. Duan, B. Pardo, and C. Zhang. Multiple fundamental frequency estimation by modeling spectral peaks and non-peak regions. TASLP, 2011.
|
| 162 |
+
V. Emiya, R. Badeau, and B. David. Multipitch estimation of piano sounds using a new probabilistic spectral smoothness principle. TASLP, 2010.
|
| 163 |
+
S. Ewert, M. Muller, and P. Grosche. High resolution audio synchronization using chroma features. ¨ ICASSP, 2009.
|
| 164 |
+
D. Garreau, R. Lajugie, S. Arlot, and F. Bach. Metric learning for temporal sequence alignment. NIPS, 2014.
|
| 165 |
+
M. Goto, H. Hashiguchi, T. Nishimura, and R. Oka. RWC music database: Music genre database and musical instrument sound database. ISMIR, 2003.
|
| 166 |
+
Gaetan Hadjeres and Franc¸ois Pachet. Deepbach: a steerable model for bach chorales generation. ¨ arXiv preprint, 2016.
|
| 167 |
+
C. Harte. Towards Automatic Extraction of Harmony Information from Music Signals. PhD thesis, Department of Electrical Engineering, Queen Mary, University of London, 2010.
|
| 168 |
+
N. Hu, R. B. Dannenberg, and G. Tzanetakis. Polyphonic audio matching and alignment for music retrieval. IEEE Workshop on Applications of Signal Processing to Audio and Acoustics, 2003.
|
| 169 |
+
E. J. Humphrey, J. P. Bello, and Y. LeCun. Moving beyond feature design: Deep architectures and automatic feature learning in music informatics. ISMIR, 2012.
|
| 170 |
+
O. Izmirli and R. B. Dannenberg. Understanding features and distance functions for music sequence alignment. ISMIR, 2010.
|
| 171 |
+
C. Joder, S. Essid, and G. Richard. Learning optimal features for polyphonic audio-to-score alignment. TASLP, 2013.
|
| 172 |
+
R. Kelz, M. Dorfer, F. Korzeniowski, S. Bock, A. Arzt, and G. Widmer. On the potential of simple ¨ framewise approaches to piano transcription. ISMIR, 2016.
|
| 173 |
+
A. Khlif and V. Sethu. An iterative multi range non-negative matrix factorization algorithm for polyphonic music transcription. ISMIR, 2015.
|
| 174 |
+
F. Korzeniowsk and G. Widmer. Feature learning for chord recognition: the deep chroma extractor. ISMIR, 2016.
|
| 175 |
+
R. Lajugie, P. Bojanowski, P. Cuvillier, S. Arlot, and F. Bach. A weakly-supervised discriminative model for audio-to-score alignment. ICASSP, 2016.
|
| 176 |
+
B. McFee and G. Lanckriet. Learning multi-modal similarity. JMLR, 2011.
|
| 177 |
+
B. McFee, T. Bertin-Mahieux, D. P. W. Ellis, and G. Lanckriet. The million song dataset challenge. Proceedings of the 21st International Conference on World Wide Web, 2012.
|
| 178 |
+
B. McFee, C. Raffel, D. Liang, D. P. W. Ellis, M. McVicar, E. Battenberg, and O. Nieto. librosa: Audio and music signal analysis in python. SCIPY, 2015.
|
| 179 |
+
N. Orio and D. Schwarz. Alignment of monophonic and polyphonic music to a score. International Computer Music Conference, 2001.
|
| 180 |
+
G. Poliner and D. P. W. Ellis. A discriminative model for polyphonic piano transcription. EURASIP Journal on Applied Signal Processing, 2007.
|
| 181 |
+
L. Rabiner and R. Schafer. Introduction to digital speech processing. Foundations and trends in signal processing, 2007.
|
| 182 |
+
C. Raffel and D. P. W. Ellis. Large-scale content-based matching of MIDI and audio files. ISMIR, 2015.
|
| 183 |
+
C. Raffel, B. McFee, E. J. Humphrey, J. Salamon, O. Nieto, D. Liang, and D. P. W. Ellis. mir eval: A transparent implementation of common mir metrics. ISMIR, 2014.
|
| 184 |
+
C. Raphael. Automatic segmentation of acoustic musical signals using hidden markov models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1999.
|
| 185 |
+
O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. Imagenet large scale visual recognition challenge. IJCV, 2015.
|
| 186 |
+
F. Soulez, X. Rodet, and D. Schwarz. Improving polyphonic and poly-instrumental music to score alignment. ISMIR, 2003.
|
| 187 |
+
K. Tokuda and H. Zen. Directly modeling voiced and unvoiced components in speech waveforms by neural networks. ICASSP, 2016.
|
| 188 |
+
R. J. Turetsky and D. P. W. Ellis. Ground-truth transcriptions of real music from force-aligned midi syntheses. ISMIR, 2003.
|
| 189 |
+
A. van den Oord, S. Dieleman, and B. Schrauwen. Deep content-based music recommendation. NIPS, 2013.
|
| 190 |
+
A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint, 2016.
|
| 191 |
+
|
| 192 |
+
# A VALIDATING THE MUSICNET LABELS
|
| 193 |
+
|
| 194 |
+
We validate the aligned MusicNet labels with a listening test. We create an aural representation of an aligned score-performance pair by mixing a short sine wave into the performance with the frequency indicated by the score at the time indicated by the alignment. We can listen to this mix and, if the alignment is correct, the sine tones will exactly overlay the original performance; if the alignment is incorrect, the mix will sound dissonant.
|
| 195 |
+
|
| 196 |
+
We have listened to sections of each recording in the aligned dataset: the beginning, several random samples of middle, and the end. Mixes with substantially incorrect alignments were rejected from the dataset. Failed alignments are mostly attributable to mismatches between the midi and the recording. The most common reason for rejection is musical repeats. Classical music often contains sections with indications that they be repeated a second time; in classical music performance culture, it is often acceptable to ignore these directions. If the score and performance make different choices regarding repeats, a mismatch arises. When the score omits a repeat that occurs in the performance, the alignment typically warps over the entire repeated section, with correct alignments before and after. When the score includes an extra repeat, the alignment typically compresses it into very short segment, with correct alignments on either side. We rejected alignments exhibiting either of these issues from the dataset.
|
| 197 |
+
|
| 198 |
+
From the aligned performances that we deemed sufficiently accurate to admit to the dataset, we randomly sampled 30 clips for more careful annotation and analysis. We weighted the sample to cover a wide coverage of recordings with various instruments, ensemble sizes, and durations. For each sampled performance, we randomly selected a 30 second clip. Using software transforms, it is possible to slow a recording down to approximately 1/4 speed. Two of the clips were too richly structured and fast to precisely analyze (slowing the signal down any further introduces artifacts that make the signal difficult to interpret). Even in these two rejected samples, the alignments sound substantially correct.
|
| 199 |
+
|
| 200 |
+
For the other 28 clips, we carefully analyzed the aligned performance mix and annotated every alignment error. Two of the authors are classically trained musicians: we independently checked for errors and we our analyses were nearly identical. Where there was disagreement, we used the more pessimistic author’s analysis. Over our entire set of clips we averaged a $4 . 0 \%$ error rate.
|
| 201 |
+
|
| 202 |
+
Note that we do not catch every type of error. Mistaken note onsets are more easily identified than mistaken offsets. Typically the release of one note coincides with the onset of a new note, which implicitly verifies the release. However, release times at the ends of phrases may be less accurate; these inaccuracies would not be covered by our error analysis. We were also likely to miss performance mistakes that maintain the meter of the performance, but for professional recordings such mistakes are rare.
|
| 203 |
+
|
| 204 |
+
For stringed instruments, chords consisting of more than two notes are “rolled”; i.e. they are performed serially from the lowest to the highest note. Our alignment protocol cannot separate notes that are notated simultaneously in the score; a rolled chord is labeled with a single starting time, usually the beginning of the first note in the roll. Therefore, there is some time period at the beginning of a roll where the top notes of the chord are labeled but have not yet occurred in the performance. There are reasonable interpretations of labeling under which these labels would be judged incorrect. On the other hand, if the labels are used to supervise transcription then ours is likely the desired labeling.
|
| 205 |
+
|
| 206 |
+
We can also qualitatively characterize the types of errors we observed. The most common types of errors are anticipations and delays: a single, or small sequence of labels is aligned to a slightly early or late location in the time series. Another common source of error is missing ornaments and trills: these are short flourishes in a performance are sometimes not annotated in our score data, which results in a missing annotation in the alignment. Finally, there are rare performance errors in the recordings and transcription errors in the score.
|
| 207 |
+
|
| 208 |
+
# B ALIGNMENT PARAMETER ROBUSTNESS
|
| 209 |
+
|
| 210 |
+
The definitions of audio featurization and the alignment cost function were contingent on several parameter choices. These choices were optimized by systematic exploration of the parameter space. We investigated what happens as we vary each parameter and made the choices that gave the best results in our listening tests. Fine-tuning of the parameters yields marginal gains.
|
| 211 |
+
|
| 212 |
+
The quality of alignments improves uniformly with the quality of synthesis. The time-resolution of labels improves uniformly as the stride parameter decreases; minimization of stride is limited by system memory constraints. We find that the precise phase-invariant feature specification has little effect on alignment quality. We experimented with spectrograms and log-spectrograms using windowed and un-windowed signals. Alignment quality seemed to be largely unaffected.
|
| 213 |
+
|
| 214 |
+
The other parameters are governed by a tradeoff curve; the optimal choice is determined by balancing desirable outcomes. The Fourier window size is a classic tradeoff between time and frequency resolution. The $\ell ^ { 2 }$ norm can be understood as a tradeoff between the extremes of $\ell ^ { 1 }$ and $\ell ^ { \infty }$ . The $\bar { \ell ^ { 1 } }$ norm is too egalitarian: the preponderance of errors due to synthesis quality add up and overwhelm the signal. On the other hand, the $\ell ^ { \infty }$ norm ignores too much of the signal in the spectrogram. The spectrogram cutoff, discussed in Sec. 3, is also a tradeoff between synthesis quality and maximal use of information
|
| 215 |
+
|
| 216 |
+
# C ADDITIONAL ERROR ANALYSIS
|
| 217 |
+
|
| 218 |
+
For each model, using the test set described in Sect. 5, we report accuracy and error scores used by the MIR community to evaluate the Multi-F0 systems. Definitions and a discussion of these metrics are presented in Poliner & Ellis (2007).
|
| 219 |
+
|
| 220 |
+
<table><tr><td>Representation</td><td>Acc</td><td>Etot</td><td>Esub</td><td>Emiss</td><td>Efa</td></tr><tr><td>512-point log-spectrogram</td><td>28.5%</td><td>.819</td><td>.198</td><td>.397</td><td>.224</td></tr><tr><td>1024-point log-spectrogram</td><td>33.4%</td><td>.715</td><td>.123</td><td>.457</td><td>.135</td></tr><tr><td>1024-point log-ReLUgram</td><td>35.9%</td><td>.711</td><td>.144</td><td>.377</td><td>.190</td></tr><tr><td>4096-point log-spectrogram</td><td>24.7%</td><td>.788</td><td>.085</td><td>.628</td><td>.074</td></tr><tr><td>8192-point log-spectrogram</td><td>16.1%</td><td>.866</td><td>.082</td><td>.737</td><td>.047</td></tr><tr><td>MLP,500 nodes,2048 raw samples</td><td>36.8%</td><td>.790</td><td>.206</td><td>.214</td><td>.370</td></tr><tr><td>MLP,2500 nodes.2048 samples</td><td>40.4%</td><td>.740</td><td>.177</td><td>.200</td><td>.363</td></tr><tr><td>AvgPool, 5 stride,2048 samples</td><td>40.5%</td><td>.744</td><td>.176</td><td>.200</td><td>.369</td></tr><tr><td>MLP, 500 nodes,16384 samples</td><td>42.0%</td><td>.735</td><td>.160</td><td>.191</td><td>.383</td></tr><tr><td>CNN, 64 stride,16384 samples</td><td>48.9%</td><td>.634</td><td>.117</td><td>.164</td><td>.352</td></tr></table>
|
| 221 |
+
|
| 222 |
+
Table 4: MIREX-style statistics, evaluated using the mir eval library (Raffel et al., 2014).
|
| 223 |
+
|
| 224 |
+
# D PRECISION & RECALL CURVES
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 7: The 500 node, 2048 raw sample MLP.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 6: The linear spectrogram model.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 9: The average pooling model.
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 8: The 2500 node, 2048 raw sample MLP.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 10: The 500 node, 16384 raw sample MLP.
|
| 242 |
+
Figure 11: The convolutional model.
|
| 243 |
+
|
| 244 |
+
# E ADDITIONAL RESULTS
|
| 245 |
+
|
| 246 |
+
We report additional results on splits of the test set described in Sect. 5.
|
| 247 |
+
|
| 248 |
+
<table><tr><td>Model</td><td>Features</td><td>Precision</td><td>Recall</td><td>Average Precision</td></tr><tr><td>MLP, 500 nodes</td><td>2048 raw samples</td><td>56.1%</td><td>62.7%</td><td>59.2%</td></tr><tr><td>MLP,2500 nodes</td><td>2048 raw samples</td><td>59.1%</td><td>67.8%</td><td>63.1%</td></tr><tr><td>AvgPool, 5 stride</td><td>2048 raw samples</td><td>59.1%</td><td>68.2%</td><td>64.5%</td></tr><tr><td>MLP, 500 nodes</td><td>16384 raw samples</td><td>60.2%</td><td>65.2%</td><td>65.8%</td></tr><tr><td>CNN, 64 stride</td><td>16384 raw samples</td><td>65.9%</td><td>75.2%</td><td>74.4%</td></tr></table>
|
| 249 |
+
|
| 250 |
+
Table 5: The Soni Ventorum recording of Mozart’s Wind Quintet K375 (MusicNet id 1819).
|
| 251 |
+
|
| 252 |
+
<table><tr><td>Model</td><td>Features</td><td>Precision</td><td>Recall</td><td>Average Precision</td></tr><tr><td>MLP, 500 nodes</td><td>2048 raw samples</td><td>35.4%</td><td>40.7%</td><td>28.0%</td></tr><tr><td>MLP,2500 nodes</td><td>2048 raw samples</td><td>38.3%</td><td>44.3%</td><td>30.9%</td></tr><tr><td>AvgPool, 5 stride</td><td>2048 raw samples</td><td>38.6%</td><td>45.2%</td><td>31.7%</td></tr><tr><td>MLP, 500 nodes</td><td>16384 raw samples</td><td>43.4%</td><td>51.3%</td><td>41.0%</td></tr><tr><td>CNN, 64 stride</td><td>16384 raw samples</td><td>51.0%</td><td>57.9%</td><td>49.3%</td></tr></table>
|
| 253 |
+
|
| 254 |
+
Table 6: The European Archive recording of Beethoven’s String Quartet No. 13 (MusicNet id 2382).
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Model</td><td>Features</td><td>Precision</td><td>Recall</td><td>Average Precision</td></tr><tr><td>MLP, 500 nodes</td><td>2048 raw samples</td><td>55.6%</td><td>67.4%</td><td>64.1%</td></tr><tr><td>MLP,2500 nodes</td><td>2048 raw samples</td><td>60.1%</td><td>71.3%</td><td>68.6%</td></tr><tr><td>AvgPool, 5 stride</td><td>2048 raw samples</td><td>59.6%</td><td>70.7%</td><td>68.1%</td></tr><tr><td>MLP, 500 nodes</td><td>16384 raw samples</td><td>57.1%</td><td>76.3%</td><td>68.4%</td></tr><tr><td>CNN, 64 stride</td><td>16384 raw samples</td><td>61.9%</td><td>80.1%</td><td>73.9%</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Table 7: The Kimiko Ishizaka recording of Bach’s Prelude in D major (MusicNet id 2303).
|
md/train/ryetZ20ctX/ryetZ20ctX.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEFENSIVE QUANTIZATION: WHEN EFFICIENCY MEETS ROBUSTNESS
|
| 2 |
+
|
| 3 |
+
Ji Lin
|
| 4 |
+
MIT
|
| 5 |
+
jilin@mit.edu
|
| 6 |
+
|
| 7 |
+
Chuang Gan MIT-IBM Watson AI Lab ganchuang@csail.mit.edu
|
| 8 |
+
|
| 9 |
+
Song Han
|
| 10 |
+
MIT
|
| 11 |
+
songhan@mit.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Neural network quantization is becoming an industry standard to efficiently deploy deep learning models on hardware platforms, such as CPU, GPU, TPU, and FPGAs. However, we observe that the conventional quantization approaches are vulnerable to adversarial attacks. This paper aims to raise people’s awareness about the security of the quantized models, and we designed a novel quantization methodology to jointly optimize the efficiency and robustness of deep learning models. We first conduct an empirical study to show that vanilla quantization suffers more from adversarial attacks. We observe that the inferior robustness comes from the error amplification effect, where the quantization operation further enlarges the distance caused by amplified noise. Then we propose a novel Defensive Quantization (DQ) method by controlling the Lipschitz constant of the network during quantization, such that the magnitude of the adversarial noise remains non-expansive during inference. Extensive experiments on CIFAR-10 and SVHN datasets demonstrate that our new quantization method can defend neural networks against adversarial examples, and even achieves superior robustness than their fullprecision counterparts, while maintaining the same hardware efficiency as vanilla quantization approaches. As a by-product, DQ can also improve the accuracy of quantized models without adversarial attack.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Neural network quantization (Han et al., 2015; Zhu et al., 2016; Jacob et al., 2017) is a widely used technique to reduce the computation and memory costs of neural networks, facilitating efficient deployment. It has become an industry standard for deep learning hardware. However, we find that the widely used vanilla quantization approaches suffer from unexpected issues — the quantized model is more vulnerable to adversarial attacks (Figure 1). Adversarial attack is consist of subtle perturbations on the input images that causes the deep learning models to give incorrect labels (Szegedy et al., 2013; Goodfellow et al.). Such perturbations are hardly detectable by human eyes but can easily fool neural networks. Since quantized neural networks are widely deployed in many safety-critical scenarios, e.g., autonomous driving (Amodei et al., 2016), the potential security risks cannot be neglected. The efficiency and latency in such applications are also important, so we need to jointly optimize them.
|
| 20 |
+
|
| 21 |
+
The fact that quantization leads to inferior adversarial robustness is counter intuitive, as small perturbations should be denoised with low-bit representations. Recent work (Xu et al., 2017) also demonstrates that quantization on input image space , i.e. color bit depth reduction, is quite effective to defend adversarial examples. A natural question then rises, why the quantization operator is yet effective when applied to intermediate DNN layers? We analyze that such issue is caused by the error amplification effect of adversarial perturbation (Liao et al., 2018) — although the magnitude of perturbation on the image is small, it is amplified significantly when passing through deep neural network (see Figure 3b). The deeper the layers are, the more significant such side effect is. Such amplification pushes values into a different quantization bucket, which is undesirable. We conducted empirical experiments to analyze how quantization influences the activation error between clean and adversarial samples (Figure 3a): when the magnitude of the noise is small, activation quantization is capable of reducing the errors by eliminating small perturbations; However, when the magnitude of perturbation is larger than certain threshold, quantization instead amplify the errors, which causes
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+
(a) Quantization preserves the accuracy till 4-5 bits on clean image.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
(b) Quantization no longer preserves the accuracy under adversarial attack (same legend as left).
|
| 29 |
+
Figure 1. Quantized neural network are more vulnerable to adversarial attack. Quantized models have no loss of accuracy on clean image ${ \geq } 5$ bits), but have significant loss of accuracy under adversarial attack compared to full precision models. Setup: VGG-16 and Wide ResNet on the test set of CIFAR-10 with FGSM attack.
|
| 30 |
+
|
| 31 |
+
the quantized model to make mistakes. We argue that this is the main reason causing the inferior robustness of the quantized models.
|
| 32 |
+
|
| 33 |
+
In this paper, we propose Defensive Quantization (DQ) that not only fixes the robustness issue of quantized models, but also turns activation quantization into a defense method that further boosts adversarial robustness. We are inspired by the success of image quantization in improving robustness. Intuitively, it will be possible to defend the attacks with quantization operations if we can keep the magnitude of the perturbation small. However, due to the error amplification effect of gradient based adversarial samples, it is non-trivial to keep the noise at a small scale during inference. Recent works (Cisse et al., 2017; Qian & Wegman, 2018) have attempted to make the network non-expansive by controlling the Lipschitz constant of the network to be smaller than 1, which has smaller variation change in its output than its input. In such case, the input noise will not propagate through the intermediate layers and impact the output, but attenuated. Our method is built on the theory. Defensive quantization not only quantizes feature maps into low-bit representations, but also controls the Lipschitz constant of the network, such that the noise is kept within a small magnitude for all hidden layers. In such case, we keep the noise small, as in the left zone of Figure 3a, quantization can reduce the perturbation error. The produced model with our method enjoys better security and efficiency at the same time.
|
| 34 |
+
|
| 35 |
+
Experiments show that Defensive Quantization (DQ) offers three unique advantages. First, DQ provides an effective way to boost the robustness of deep learning models while maintains the efficiency. Second, DQ is a generic building block of adversarial defense, which can be combined with other adversarial defense techniques to advance state-of-the-art robustness. Third, our method makes quantization itself easier thanks to the constrained dynamic range.
|
| 36 |
+
|
| 37 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 38 |
+
|
| 39 |
+
# 2.1 MODEL QUANTIZATION
|
| 40 |
+
|
| 41 |
+
Neural network quantization (Han et al., 2015; Rastegari et al., 2016; Zhou et al., 2016; Courbariaux & Bengio, 2016; Zhu et al., 2016)) are widely adopted to enable efficient inference. By quantizing the network into low-bit representation, the inference of network requires less computation and less memory, while still achieves little accuracy degradation on clean images. However, we find that the quantized models suffer from severe security issues — they are more vulnerable against adversarial attacks compared to full-precision models, even when they have the same clean image accuracy. Adversarial perturbation is applied to the input image, thus it is most related to activation quantization (Dhillon et al., 2018). We carry out the rest of the paper using ReLU6 based activation quantization (Howard et al., 2017; Sandler et al., 2018), as it is computationally efficient and is widely adopted by modern frameworks like TensorFlow (Abadi et al., 2016). As illustrated in Figure 2, a quantized convolutional network is composed of several quantized convolution block, each containing a serial of $c o n \nu + B N + R e L U 6 +$ linear quantize operators. As the quantization operator has
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 2. Defensive quantization with Lipschitz regularization.
|
| 45 |
+
|
| 46 |
+
0 gradient almost everywhere, we followed common practice to use a STE (Bengio et al., 2013) function $y = x +$ stop gradient[Quantize $( x ) - x ]$ for gradient computation, which also eliminates the obfuscated gradient problem (Athalye et al., 2018).
|
| 47 |
+
|
| 48 |
+
Our work bridges two domains: model quantization and adversarial defense. Previous work (Galloway et al., 2017) claims binary quantized networks can improve the robustness against some attacks. However, the improvement is not substantial and they used randomized quantization, which is not practical for real deployment (need extra random number generators in hardware). It also causes one of the obfuscated gradient situations (Athalye et al., 2018): stochastic gradients, leading to a false sense of security. Rakin et al. (2018) tries to use quantization as an effective defense method. However, they employed Tanh-based quantization, which is not hardware friendly on fixed-point units due to the large overhead accessing look-up table. Even worse, according to our re-implementation, their method actually leads to severe gradient masking problem (Papernot et al., 2016a) during adversarial training, due to the nature of Tanh function (see A.1 for detail). As a result, the actual robustness of this work under black-box attack has no improvement over full-precision model and is even worse. Therefore, there is no previous work that are conducted under real inference setting to study the quantized robustness for both black-box and white-box. Our work aim to raise people’s awareness about the security of the actual deployed models.
|
| 49 |
+
|
| 50 |
+
# 2.2 ADVERSARIAL ATTACKS & DEFENSES
|
| 51 |
+
|
| 52 |
+
Given an image $\mathbf { X }$ , an adversarial attack method tries to find a small perturbation $\pmb { \Delta }$ with constraint $| | \Delta | | \leq \epsilon$ , such that the neural network gives different outputs for $\mathbf { X }$ and $\mathbf { X } ^ { a d v } \triangleq \mathbf { X } + \pmb { \Delta }$ . Here $\epsilon$ is a scalar to constrain the norm of the noise (e.g., $\epsilon = 8$ is commonly used when we represent colors from 0-255), so that the perturbation is hardly visible to human. For this paper we choose to study attacks defined under $| | \cdot | | _ { \infty }$ , where each element of the image can vary at most $\epsilon$ to form an adversary. We introduce several attack and defense methods used in our work in the following sections.
|
| 53 |
+
|
| 54 |
+
# 2.2.1 ATTACK METHODS
|
| 55 |
+
|
| 56 |
+
Random Perturbation (Random) Random perturbation attack adds a uniform sampled noise within $[ - \epsilon , \epsilon ]$ to the image, The method has no prior knowledge of the data and the network, thus is considered as the weakest attack method.
|
| 57 |
+
|
| 58 |
+
Fast Gradient Sign Method (FGSM) & R+FGSM Goodfellow et al. proposed a fast method to calculate the adversarial noise by following the direction of the loss gradient $\nabla _ { \mathbf { X } } L ( \mathbf { X } , y )$ , where $L ( \mathbf { X } , y )$ is the loss function for training (e.g. cross entropy loss). The adversarial samples are computed as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
{ \bf X } ^ { a d v } = { \bf X } + \epsilon * \mathrm { s i g n } ( \nabla _ { \bf X } { L } ( { \bf X } , y ) )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
As FGSM is an one-step gradient-based method, it can suffer from sharp curvature near the data points, leading a false direction of ascent. Therefore, Tramer et al. (2017) proposes to prepend FGSM \` by a random step to escape the non-smooth vicinity. The new method is called $\mathbf { R } { + } \mathbf { F } \mathbf { G } \mathbf { S } \mathbf { M }$ , defined as follows, for parameters $\epsilon$ and $\epsilon _ { 1 }$ (where $\epsilon _ { 1 } < \epsilon$ ):
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
{ \bf X } ^ { a d v } = { \bf X } ^ { \prime } + ( \epsilon - \epsilon _ { 1 } ) * \mathrm { s i g n } ( \nabla _ { \bf X } L ( { \bf X } , y ) ) , \mathrm { w h e r e } { \bf X } ^ { \prime } = { \bf X } + \epsilon _ { 1 } * \mathrm { s i g n } ( \mathcal { N } ( { \bf 0 } ^ { d } , { \bf I } ^ { d } ) ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
In our paper, we set $\epsilon _ { 1 } = \epsilon / 2$ following Tramer et al. (2017). \`
|
| 71 |
+
|
| 72 |
+
Basic Iterative Method (BIM) & Projected Gradient Descend (PGD) Kurakin et al. (2016) suggests a simple yet much stronger variant of FGSM by applying it multiple times iteratively with a
|
| 73 |
+
|
| 74 |
+
(a) Noise increases with perturbation strength. Quantization makes the slope deeper.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
(b) With conventional quantization, noise increases with layer index (the amplification effect).
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
|
| 81 |
+
Figure 3. (a) Comparison of the noise introduced by adversarial-attack, with and without quantization. For small perturbation, quantization reduces the noise; for large perturbation, quantization magnifies the noise. (b) The noise amplification effect: the noise is amplified with layer index. Setup: conventional activation quantization for VGG-16, normalized difference of full-precision and low-precision activation.
|
| 82 |
+
|
| 83 |
+
small step size $\alpha$ . The method is called BIM, defined as:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\mathbf { X } _ { 0 } ^ { a d v } = \mathbf { X } , \ \mathbf { X } _ { n + 1 } ^ { a d v } = \mathrm { c l i p } _ { \mathbf { X } } ^ { \epsilon } \{ \mathbf { X } _ { n } ^ { a d v } + \alpha \mathrm { s i g n } ( \nabla _ { \mathbf { X } } L ( \mathbf { X } _ { n } ^ { a d v } , y ) ) \} ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\mathrm { c l i p } _ { \mathbf { X } } ^ { \epsilon }$ means clipping the result image to be within the $\epsilon$ -ball of $\mathbf { X }$ . In (Madry et al., 2017), the BIM is prepended by a random start as in $\mathrm { R + F G S M }$ method. The resulting attack is called PGD, which proves to be a general first-order attack. In our experiments we used PGD for comprehensive experiments as it proves to be one of the strongest attack. Unlike Madry et al. (2017) that uses a fixed $\epsilon$ and $\alpha$ , we follow Kurakin et al. (2016); Song et al. (2017) to use $\alpha = 1$ and number of iterations of $\left\lfloor \operatorname* { m i n } ( \epsilon + 4 , 1 . 2 5 \epsilon ) \right\rfloor$ , so that we can test the model’s robustness under different strength of attacks.
|
| 90 |
+
|
| 91 |
+
# 2.2.2 DEFENSE METHODS
|
| 92 |
+
|
| 93 |
+
Current defense methods either preprocess the adversarial samples to denoise the perturbation (Xu et al., 2017; Song et al., 2017; Liao et al., 2018) or making the network itself robust (Warde-Farley & Goodfellow, 2016; Papernot et al., 2016b; Madry et al., 2017; Kurakin et al., 2016; Goodfellow et al.; Tramer et al., 2017). Here we introduced several defense methods related to our experiments. \`
|
| 94 |
+
|
| 95 |
+
Feature Squeezing $\mathrm { X u }$ et al. (2017) proposes to detect adversarial images by squeezing the input image. Specifically, the image is processed with color depth bit reduction (5 bits for our experiments) and smoothed by a $2 \times 2$ median filter. If the low resolution image is classified differently as the original image, then this image is detected as adversarial.
|
| 96 |
+
|
| 97 |
+
Adversarial Training Adversarial training (Madry et al., 2017; Kurakin et al., 2016; Goodfellow et al.; Tramer et al., 2017) is currently the strongest method for defense. By augmenting the training set \` with adversarial samples, the network learns to classify adversarial samples correctly. As adversarial Table 3Table 3FGSM can easily lead to gradient masking effect (Papernot et al., 2016a), we study adversarial $\mathrm { R + F G S M }$ 4-Bit Quantized 6-Bit Quantized 8-Bit Quantized Full Precision4-Bit Quantized 6-Bit Quantized 8-Bit Quantized Full Precision as in (Tramer et al., 2017). We also experimented with PGD training (Madry et al., 2017). \`
|
| 98 |
+
|
| 99 |
+
00 0.46921857947162576 2.0000 0 2.0000 0.332712 2.0000 0 2.0000 0.28962.0000 0.46921857947162 2.0000 0 2.0000 0.332712 2.0000 0 2.0000 0.2896Experiments show that above defense methods can be combined with our DQ method to further
|
| 100 |
+
000 0.7550861999431432 3.0000 0.6733 3.0000 0.6304687265237110000 3.0000 0.6050 3.0000 0.57743.0000 0.75508619994314 3.0000 0.6733 3.0000 0.6304687265237110000 3.0000 0.6050 3.0000 0.5774improve the robustness. The robustness has been tested under the aforementioned attack methods.
|
| 101 |
+
|
| 102 |
+
# 000 0.8435416802069752 5.0000 0.7445 5.0000 0.70679410870240300 5.0000 0.6733 5.0000 5.0000 0.8435416802069752 5.0000 0.7445 5.0000 0.70679410870240300 5.0000 0.6733 5.0000 3 C O N V E N T I O NA L N N Q UA N T I Z AT I O N I S N OT RO B U S T
|
| 103 |
+
|
| 104 |
+
00 1.012114964143164 7.0000 1.005 7.0000 0.9032 7.0000 0.8307 7.0000 0.83257.0000 1.012114964143164 7.0000 1.005 7.0000 0.9032 7.0000 0.8307 7.0000 0.8325Conventional neural network quantization is more vulnerable to adversarial attacks. We experimented 000 0.9862844244360638 8.0000 0.9515 8.0000 0.86693617000095300 8.0000 0.80045166445080300 8.0000 0.7888.0000 0.9862844244360638 8.0000 0.9515 8.0000 0.86693617000095300 8.0000 0.80045166445080300 8.0000 0.788with VGG-16 (Simonyan & Zisserman, 2014) and a Wide ResNet (Zagoruyko & Komodakis, 2016) 00 1.0681920178474003 9.0000 1.0577 9.0000 0.977219 9.0000 0.8388344297226030 9.0000 0.81519.0000 1.0681920178474003 9.0000 1.0577 9.0000 0.977219 9.0000 0.8388344297226030 9.0000 0.8151of depth 28 and width 10 on CIFAR-10 (Krizhevsky & Hinton, 2009) dataset. We followed the 000 1.0993773912484481 10.000 1.1288 10.000 1.023 10.000 0.8246 10.000 0.758810.000 1.0993773912484481 10.000 1.1288 10.000 1.023 10.000 0.8246 10.000 0.7588training protocol as in (Zagoruyko & Komodakis, 2016). Adversarial samples are generated with a 000 1.1090918582426685 11.0000 1.1015 11.0000 11.0000 1.1090918582426685 11.0000 1.1015 11.0000 FGSM (Goodfellow et al.) attacker $\epsilon = 8$ 11.0000 0.8027 11.0000 0.71920199 11.0000 0.8027 11.0000 0.7192) on the entire test set. As in Figure 1, the clean image .00 1.207932074028837 12.00 1.1706 12.00 1.099673 12.00 0.827749 12.00 0.748612.00 1.207932074028837 12.00 1.1706 12.00 1.099673 12.00 0.827749 12.00 0.7486accuracy doesn’t significantly drop until the model is quantized to 4 bits (Figure 1a). However, under .00 1.2888898827224133 13.00 1.1754 13.00 1.097803 13.00 0.829665 13.00 0.7676 13.00 1.2888898827224133 13.00 1.1754 13.00 1.097803 13.00 0.829665 13.00 0.7676 adversarial attack, even with 5-bit quantization, the accuracy drastically decreased by $2 5 . 3 \%$ and $9 . 2 \%$ respectively. Although the full precision model’s accuracy has dropped, the quantized model’s accuracy dropped much harder, showing that the conventional quantization method is not robust. Clean image accuracy used to be the sole figure of merit to evaluate a quantized model. We show that even when the quantized model has no loss of performance on clean images, it can be much more easily fooled compared to full-precision ones, thus raising security concerns.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4. The error amplification effect prevents activation quantization from defending adversarial attacks.
|
| 108 |
+
|
| 109 |
+
Input image quantization, i.e., color bit depth reduction is an effective defense method ( $\mathrm { { X u } }$ et al., 2017). Counter intuitively, it does not work when applied to hidden layers, and even make the robustness worse. To understand the reason, we studied the effect of quantization w.r.t. different perturbation strength. We first randomly sample 128 images $\mathbf { X }$ from the test set of CIFAR-10, and generate corresponding adversarial samples $\mathbf { X } ^ { a d v }$ . The samples are then fed to the trained Wide ResNet model. To mimic different strength of activation perturbation, we vary the $\epsilon$ from 1 to 8. We inspected the activation after the first convolutional layer $f _ { 1 }$ $\mathrm { C o n v } + \mathrm { B N } + \mathrm { R e L U } 6 )$ , denoted as $\mathbf { A } _ { 1 } \ { \overset { \mathbf { \Gamma } } { = } } \ f _ { 1 } ( \mathbf { X } )$ and ${ \bf A } _ { 1 } ^ { a d v } = f _ { 1 } ( { \bf A } ^ { a d v } )$ . To measure the influence of perturbation, we define a normalized distance between clean and perturbed activation as:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
D ( \mathbf { A } , \mathbf { A } ^ { a d v } ) = | | \mathbf { A } - \mathbf { A } ^ { a d v } | | _ { 2 } / | | \mathbf { A } | | _ { 2 }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
We compare $D ( \mathbf { A } , \mathbf { A } ^ { a d v } )$ and $D ( { \mathrm { Q u a n t i z e } } ( \mathbf { A } ) , { \mathrm { Q u a n t i z e } } ( \mathbf { A } ^ { a d v } ) )$ , where Quantize indicates uniform quantization with 3 bits. The results are shown in Figure 3a. We can see that only when $\epsilon$ is small, quantization helps to reduce the distance by removing small magnitude perturbations. The distance will be enlarged when $\epsilon$ is larger than 3.
|
| 116 |
+
|
| 117 |
+
The above experiment explains the inferior robustness of the quantized model. We argue that such issue arises from the error amplification effect (Liao et al., 2018), where the relative perturbed distance will be amplified when the adversarial samples are fed through the network. As illustrated in Figure 4, the perturbation applied to the input image has very small magnitude compared to the image itself $\pm 8$ versus $0 - 2 5 5$ ), corresponding to the left zone of Figure 3a (desired), where quantization helps to denoise the perturbation. Nevertheless, the difference in activation is amplified as the inference carries on. If the perturbation after amplification is large enough, the situation corresponds to the right zone (actual) of Figure 3a, where quantization further increases the normalized distance. Such phenomenon is also observed in the quantized VGG-16. We plot the normalized distance of each convolutional layer’s input in Figure 3b. The fewer bits in the quantized model, the more severe the amplification effect.
|
| 118 |
+
|
| 119 |
+
# 4 DEFENSIVE QUANTIZATION
|
| 120 |
+
|
| 121 |
+
Given the robustness limitation of conventional quantization technique, we propose Defensive Quantization (DQ) to defend the adversarial examples for quantized models. DQ suppresses the noise amplification effect, keeping the magnitude of the noise small, so that we can arrive at the left zone (Figure 3a, desired) where quantization helps robustness instead of making it worse.
|
| 122 |
+
|
| 123 |
+
We control the neural network’s Lipschitz constant (Szegedy et al., 2013; Bartlett et al., 2017; Cisse et al., 2017) to suppress network’s amplification effect. Lipschitz constant describes: when input changes, how much does the output change correspondingly. For a function $f : X \to Y$ , if it satisfies
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
D _ { Y } ( f ( x _ { 1 } ) , f ( x _ { 2 } ) ) \leq k D _ { X } ( x _ { 1 } , x _ { 2 } ) , \ \forall x _ { 1 } , x _ { 2 } \in X
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
for a real-valued $k \geq 0$ and some metrics $D _ { X }$ and $D _ { Y }$ , then we call $f$ Lipschitz continuous and $k$ is the known as the Lipschitz constant of $f$ . If we consider a network $f$ with clean inputs $x _ { 1 } = \mathbf { X }$ and corresponding adversarial inputs $x _ { 2 } = \mathbf { X } _ { a d v }$ , the error amplification effect can be controlled if we
|
| 130 |
+
|
| 131 |
+
Table 1. The clean and adversarial accuracy of Wide ResNet on CIFAR-10 test set. We compare the accuracy of full-precision and quantized models. With our DQ method, we not only eliminate the robustness gap between full-precision and quantized models, but also improve the robustness over full-precision ones. The accuracy gain from quantization compared to the full-precision model (Quantize Gain) has gradually been improved as $\beta$ increases. Bold and underline numbers are the first and second highest accuracy at each row.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Acc.</td><td rowspan="2">Full Prec.</td><td colspan="5">Quantize Bit</td><td rowspan="2">Quantize Gain</td><td rowspan="2">Best Acc.</td></tr><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr><tr><td rowspan="2">Vanilla</td><td>clean</td><td>94.8</td><td>42.0</td><td>84.9</td><td>92.8</td><td>93.9</td><td>94.7</td><td rowspan="2">-9.1</td><td rowspan="2">39.3</td></tr><tr><td>adv.</td><td>39.3</td><td>9.0</td><td>8.5</td><td>14.1</td><td>19.0</td><td>30.2</td></tr><tr><td rowspan="2">DQ (β =3e-4)</td><td>clean</td><td>95.3</td><td>95.2</td><td>95.3</td><td>95.1</td><td>95.1</td><td>95.1</td><td rowspan="2">+1.4</td><td rowspan="2">43.2</td></tr><tr><td>adv.</td><td>41.8</td><td>43.2</td><td>41.1</td><td>40.1</td><td>39.8</td><td>39.3</td></tr><tr><td rowspan="2">DQ (β =6e-4)</td><td>clean</td><td>95.6</td><td>95.7</td><td>95.2</td><td>95.4</td><td>95.6</td><td>95.5</td><td rowspan="2">+2.6</td><td rowspan="2">48.3</td></tr><tr><td>adv.</td><td>45.7</td><td>48.3</td><td>47.9</td><td>43.8</td><td>43.9</td><td>44.6</td></tr><tr><td rowspan="2">DQ (β =1e-3)</td><td>clean</td><td>95.9</td><td>95.8</td><td>95.6</td><td>95.6</td><td>95.8</td><td>95.8</td><td rowspan="2">+2.7</td><td rowspan="2">51.8</td></tr><tr><td>adv.</td><td>49.1</td><td>51.3</td><td>50.4</td><td>51.3</td><td>49.8</td><td>51.8</td></tr></table>
|
| 134 |
+
|
| 135 |
+
have a small Lipschitz constant $k$ (in optimal situation we can have $k \leq 1$ ). In such case, the error introduced by adversarial perturbation will not be amplified, but reduced. Specifically, we consider a feed-forward network composed of a serial of functions:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
f ( x ) = ( \phi _ { l } \circ \phi _ { l - 1 } \circ \ldots \circ \phi _ { 1 } ) ( x )
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $\phi _ { i }$ can be a linear layer, convolutional layer, pooling, activation functions, etc. Denote the Lipschitz constant of a function $f$ as $L i p ( f )$ , then for the above network we have
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
L i p ( f ) \leq \prod _ { i = 1 } ^ { L } L i p ( \phi _ { i } )
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
As the Lipschitz constant of the network is the product of its individual layers’ Lipschitz constants, $L i p ( f )$ can grow exponentially if $L i p ( \phi _ { i } ) > 1$ . This is the common case for normal network training (Cisse et al., 2017), and thus the perturbation will be amplified for such a network. Therefore, to keep the Lipschitz constant of the whole network small, we need to keep the Lipschitz constant of each layer $L i p ( \phi _ { i } ) \leq 1$ . We call a network with $L i p ( \phi _ { i } ) \le 1 , \forall i = 1 , . . . , L$ a non-expansive network.
|
| 148 |
+
|
| 149 |
+
We describe a regularization term to keep the Lipschitz constant small. Let us first consider linear layers with weight $\mathbf { W } \in \mathbb { R } ^ { c _ { o u t } \times c _ { i n } }$ under $| | \cdot | | _ { 2 }$ norm. The Lipschitz constant is by definition the spectral norm of $W$ : $\rho ( \mathbf { W } )$ , i.e., the maximum singular value of W. Computing the singular values of each weight matrix is not computationally feasible during training. Luckily, if we can keep the weight matrix row orthogonal, the singular values are by nature equal to 1, which meets our non-expansive requirements. Therefore we transform the problem of keeping $\rho ( \mathbf { W } ) \leq 1$ into keeping $\mathbf { W } ^ { \hat { T } } \mathbf { W } \approx \mathbf { I }$ , where $\mathbf { I }$ is the identity matrix. Naturally, we introduce a regularization term $| | \mathbf { W } ^ { \hat { T } } \mathbf { \check { W } } - \mathbf { I } | |$ , where $I$ is the identity matrix. Following (Cisse et al., 2017), for convolutional layers with weight $\mathbf { W } \in \mathbb { R } ^ { c _ { o u t } \times c _ { i n } \times k \times k }$ , we can view it as a two-dimension matrix of shape $\dot { \mathbf { W } } \in \mathbb { R } ^ { c _ { o u t } \times ( c _ { i n } \bar { k } k ) }$ and apply the same regularization. The final optimization objective is:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\mathcal { L } = \mathcal { L } _ { C E } + \frac { \beta } { 2 } \sum _ { \mathbf { W } _ { l } \in \mathbb { W } } | | \mathbf { W } _ { l } ^ { T } \mathbf { W } _ { l } - \mathbf { I } | | ^ { 2 }
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where $\mathcal { L } _ { C E }$ is the original cross entropy loss and $\mathbb { W }$ denotes all the weight matrices of the neural network. $\beta$ is the weighting to adjust the relative importance. The above discussion is based on simple feed forward networks. For ResNets in our experiments, we also follow Cisse et al. (2017) to modify the aggregation layer as a convex combination of their inputs, where the 2 coefficients are updated using specific projection algorithm (see (Cisse et al., 2017) for details).
|
| 156 |
+
|
| 157 |
+
Our Defensive Quantization is illustrated in Figure 2. The key part is the regularization term, which suppress the noise amplification effect by regularizing the Lipschitz constant. As a result, the perturbation at each layer is kept within a certain range, the adversarial noise won’t propagate. Our method not only fixes the drop of robustness induced by quantization, but also takes quantization as a defense method to further increase the robustness. Therefore it’s named Defensive Quantization.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 5. The white-box and black-box robustness are consistent: vanilla quantization leads to significant robustness drop, while DQ can bridge the gap and improve the robustness, especially with lower bits $( \mathrm { b i t } { = } 1 )$ ). Setup: white-box and black-box robustness of Wide ResNet with vanilla quantization and defensive quantization.
|
| 161 |
+
|
| 162 |
+
# 5 EXPERIMENTS
|
| 163 |
+
|
| 164 |
+
Our experiments demonstrate the following advantages of Defensive Quantization. First, DQ can retain the robustness of a model when quantized with low-bit. Second, DQ is a general and effective defense method under various scenarios, thus can be combined with other defensive techniques to further advance state-of-the-art robustness. Third, as a by-product, DQ can also improve the accuracy of training quantized models on clean images without attacks, since it limits the dynamic range.
|
| 165 |
+
|
| 166 |
+
# 5.1 FIXING ROBUSTNESS DROP
|
| 167 |
+
|
| 168 |
+
Setup: We conduct experiments with Wide ResNet (Zagoruyko & Komodakis, 2016) of $2 8 \times 1 0$ on the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) using ReLU6 based activation quantization, with number of bits ranging from 1 to 5. All the models are trained following (Zagoruyko & Komodakis, 2016) with momentum SGD for 200 epochs. The adversarial samples are generated using FGSM attacker with $\epsilon = 8$ .
|
| 169 |
+
|
| 170 |
+
Result: The results are presented in Table 1. For vanilla models, though the adversarial robustness increases with the number of bits, i.e., the models closer to full-precision one has better robustness, the best quantized model still has inferior robustness by $- 9 . 1 \%$ . While with our Defensive Quantization, the quantized models have better robustness than full-precision counterparts. The robustness is better when the number of bits are small, since it can de-noise larger adversarial perturbations. We also find that the robustness is generally increasing as $\beta$ gets larger, since the regularization of Lipschitz constant itself keeps the noise smaller at later layers. At the same time, the quantized models consistently achieve better robustness. The robustness of quantized model also increases with $\beta$ . We conduct a detailed analysis of the effect of $\beta$ in Section B. The conclusion is: (1) conventional quantized models are less robust. (2) Lipschitz regularization makes the model robust. (3) Lipschitz regularization $^ +$ quantization makes model even more robust.
|
| 171 |
+
|
| 172 |
+
As shown in (Athalye et al., 2018), many of the defense methods actually lead to obfuscated gradient, providing a false sense of security. Therefore it is important to check the model’s robustness under black-box attack. We separately trained a substitute VGG-16 model on the same dataset to generate adversarial samples, as it was proved to have the best transferability (Su et al., 2018). The results are presented in Figure 5. Trends of white-box and black-box attack are consistent. Vanilla quantization leads to inferior black-box robustness, while with our method can further improve the models’ robustness. As the robustness gain is consistent for both white-box and black-box setting, our method does not suffer from gradient masking.
|
| 173 |
+
|
| 174 |
+
# 5.2 DEFEND WITH DEFENSIVE QUANTIZATION
|
| 175 |
+
|
| 176 |
+
In this section, we show that we can combine Defensive Quantization with other defense techniques to achieve state-of-the-art robustness.
|
| 177 |
+
|
| 178 |
+
Table 2. SVHN experiments tested with $\epsilon = 2 / 8 / 1 6$ . (B) indicates black-box attack.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Training Technique</td><td>Clean</td><td>Random</td><td>FGSM</td><td>R+FGSM</td><td>PGD</td><td>FGSM(B)</td><td>PGD(B)</td></tr><tr><td>Normal</td><td>96.8</td><td>97/97/96</td><td>74/42/26</td><td>86/55/35</td><td>77/05/00</td><td>90/62/40</td><td>92/58/30</td></tr><tr><td>Normal + DQ</td><td>96.7</td><td>96/96/96</td><td>77/45/31</td><td>87/59/40</td><td>79/10/00</td><td>90/63/42</td><td>92/60/31</td></tr><tr><td>Feature Squeezing</td><td>96.3</td><td>96/96/95</td><td>69/34/20</td><td>84/48/28</td><td>72/03/00</td><td>89/61/38</td><td>91/56/27</td></tr><tr><td>Feature Squeezing + DQ</td><td>96.2</td><td>96/96/96</td><td>75/42/28</td><td>86/56/36</td><td>77/06/00</td><td>90/63/40</td><td>92/59/30</td></tr><tr><td>Adversarial R+FGSM</td><td>96.6</td><td>97/96/96</td><td>84/53/38</td><td>91/70/57</td><td>87/30/06</td><td>93/74/54</td><td>94/83/72</td></tr><tr><td>Adversarial R+FGSM+DQ</td><td>96.6</td><td>97/96/95</td><td>88/59/40</td><td>93/77/61</td><td>91/47/17</td><td>94/80/61</td><td>95/89/84</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Setup: We conducted experiments on the Street View House Number dataset (SVHN) (Netzer et al., 2011) and CIFAR-10 dataset (Krizhevsky & Hinton, 2009). Since adversarial training is time consuming, we only use the official training set for experiments. CIFAR-10 is another widely used dataset containing 50,000 training samples and 10,000 testing samples of size $3 2 \times 3 2$ . For both datasets, we divide the pixel values by 255 as a pre-processing step.
|
| 183 |
+
|
| 184 |
+
Following (Athalye et al., 2018; Cisse et al., 2017; Madry et al., 2017), we used Wide ResNet (Zagoruyko & Komodakis, 2016) models in our experiments as it is considered as the standard model on the dataset. We used depth 28 and widening factor 10 for CIFAR-10, and depth 16 and widening factor 4 for SVHN. We followed the training protocol in (Zagoruyko & Komodakis, 2016) that uses a SGD optimizer with momentum $_ { 1 = 0 . 9 }$ . For CIFAR-10, the model is trained for 200 epochs with initial learning rate 0.1, decayed by a factor of 0.2 at 60, 120 and 160 epochs. For SVHN dataset, the model is trained for 160 epochs, with initial learning rate 0.01, decayed by 0.1 at 80 and 120 epochs. For DQ, we used bi $\mathrm { = } 1$ and $\beta = 2 \mathrm { e } { - 3 }$ as it offers the best robustness (see Section B).
|
| 185 |
+
|
| 186 |
+
We combine DQ with other defense methods to further boost the robustness. For Feature Squeezing (Xu et al., 2017), we used 5 bit for image color reduction, followed by a $2 \times 2$ median filter. As adversarial FGSM training leads to gradient masking issue (Tramer et al., 2017) (see A.2 for our \` experiment), we used the variant adversarial $\mathrm { R + F G S M }$ training. To avoid over-fitting into certain $\epsilon$ , we randomly sample $\epsilon$ using $\epsilon ^ { \prime } \sim \mathcal { N } ( 0 , \delta ) , \epsilon = \mathrm { c l i p } ^ { [ 0 , 2 \delta ] } ( \mathrm { a b s } ( \epsilon ^ { \prime } ) )$ . Specifically we used $\delta = 8$ to cover $\epsilon$ from 0-16. During test time, the $\epsilon$ is set to a fixed value (2/8/16). We also conducted adversarial PGD training. Following (Kurakin et al., 2016; Song et al., 2017), during training we sample random $\epsilon$ as in $\mathrm { R + F G S M }$ setting, and generate adversarial samples using step size 1 and number of iterations $\left\lfloor \operatorname* { m i n } ( \epsilon + 4 , 1 . 2 5 \epsilon ) \right\rfloor$ .
|
| 187 |
+
|
| 188 |
+
Result: The results are presented in Table 2 and Table 3, where $\mathbf { ( B ) }$ indicates black-box attack with a seperately trained VGG-16 model. The bold number indicates the best result in its column. We observe that for all normal training, feature squeezing and adversarial training settings, our DQ method can further improve the model’s robustness. Among all the defenses, adversarial training provides the best performance against various attacks, epecially adversarial $\mathrm { R + F G S M }$ training. While white box PGD attack is generally the strongest attack in our experiments. Our DQ method also consistently improves the black-box robustness and there is no sign of gradient masking. Thus DQ proves to be an effective defense for various white-box and black-box attacks.
|
| 189 |
+
|
| 190 |
+
# 5.3 IMPROVE THE TRAINING OF QUANTIZED MODELS
|
| 191 |
+
|
| 192 |
+
As a by-product of our method, Defensive Quantization can even improve the accuracy of quantized models on clean images without attack, making it a beneficial drop-in substitute for normal quantization procedures. Due to conventional quantization method’s amplification effect, the distribution of activation can step over the truncation boundary (0-6 for ReLU6, 0-1 for ReLU1), which makes the optimization difficult. DQ explicitly add a regularization to shrink the dynamic range of activation, so that it is fitted within the truncation range. To demonstrate our hypothesis, we experimented with ResNet and CIFAR-10. We quantized the activation with 4-bit (because NVIDIA recently introduced INT4 in Turing architecture) using ReLU6 and ReLU1 respectively. Vanilla quantization and DQ training are conducted for comparison. As shown in Table 4, with vanilla quantization, ReLU1 model has around $1 \%$ worse accuracy than ReLU6 model, although they are mathematically equal if we multiply the previous BN scaling by 1/6 and next convolution weight by 6. It demonstrates that improper truncation function and range will lead to training difficulty. While with DQ training, both model has improved accuracy compared to vanilla quantization, and the gap between ReLU1 model and ReLU6 model is filled, making quantization easier regardless of truncation range.
|
| 193 |
+
|
| 194 |
+
Table 3. CIFAR-10 Experiments tested with $\epsilon = 2 / 8 / 1 6$ . (B) indicates black-box attack.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Training Technique</td><td>Clean</td><td>Random</td><td>FGSM</td><td>R+FGSM</td><td>PGD</td><td>FGSM(B)</td><td>PGD(B)</td></tr><tr><td>Normal</td><td>94.8</td><td>95/91/77</td><td>59/39/29</td><td>72/37/17</td><td>56/01/00</td><td>88/63/36</td><td>90/64/42</td></tr><tr><td>Normal + DQ</td><td>95.9</td><td>96/94/84</td><td>68/53/42</td><td>77/50/30</td><td>62/04/00</td><td>84/59/40</td><td>87/50/27</td></tr><tr><td>Feature Squeezing</td><td>94.1</td><td>94/92/81</td><td>61/35/27</td><td>76/40/21</td><td>64/02/00</td><td>87/62/30</td><td>89/70/42</td></tr><tr><td>Feature Squeezing + DQ</td><td>94.9</td><td>95/93/82</td><td>66/48/33</td><td>77/51/29</td><td>66/06/01</td><td>87/62/29</td><td>90/70/43</td></tr><tr><td>Adversarial R+FGSM</td><td>91.6</td><td>92/91/91</td><td>81/52/38</td><td>87/69/48</td><td>84/43/11</td><td>92/89/85</td><td>92/91/89</td></tr><tr><td>Adversarial R+FGSM+DQ</td><td>94.0</td><td>94/93/93</td><td>85/63/51</td><td>90/74/58</td><td>87/50/22</td><td>93/91/87</td><td>94/92/92</td></tr><tr><td>Adversarial PGD</td><td>86.6</td><td>86/86/86</td><td>74/46/31</td><td>79/63/46</td><td>76/44/20</td><td>84/83/81</td><td>84/83/83</td></tr><tr><td>Adversarial PGD + DQ</td><td>87.5</td><td>87/87/87</td><td>79/53/36</td><td>83/69/52</td><td>81/50/22</td><td>87786/82</td><td>87/86/86</td></tr></table>
|
| 197 |
+
|
| 198 |
+
Table 4. DQ method improves the training of normal quantized models by limiting the dynamic range of activation. With conventional quantization, ReLU1 suffers from inferior performance than ReLU6. While with DQ, the gap is fixed, ReLU1 and ReLU6 quantized models achieve similar accuracy.
|
| 199 |
+
|
| 200 |
+
<table><tr><td></td><td>ReLU1</td><td>ReLU6</td><td>Difference</td></tr><tr><td>Vanilla Quantization</td><td>93.49%</td><td>94.41%</td><td>-0.92%</td></tr><tr><td>Defensive Quantization</td><td>95.14%</td><td>95.09%</td><td>0.05%</td></tr></table>
|
| 201 |
+
|
| 202 |
+
# 6 CONCLUSION
|
| 203 |
+
|
| 204 |
+
In this work, we aim to raise people’s awareness about the security of the quantized neural networks, which is widely deployed in GPU/TPU/FPGAs, and pave a possible direction to bridge two important areas in deep learning: efficiency and robustness. We connect these two domains by designing a novel Defensive Quantization (DQ) module to defend adversarial attacks while maintain the efficiency. Experimental results on two datasets validate that the new quantization method can make the deep learning models be safely deployed on mobile devices.
|
| 205 |
+
|
| 206 |
+
# ACKNOWLEDGMENTS
|
| 207 |
+
|
| 208 |
+
We acknowledge Google and Amazon providing us the cloud computing resources.
|
| 209 |
+
|
| 210 |
+
REFERENCES
|
| 211 |
+
|
| 212 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: a system for large-scale machine learning. In OSDI, volume 16, pp. 265–283, 2016.
|
| 213 |
+
|
| 214 |
+
Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mane.´ Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016.
|
| 215 |
+
|
| 216 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
|
| 217 |
+
|
| 218 |
+
Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6240–6249, 2017.
|
| 219 |
+
|
| 220 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 221 |
+
|
| 222 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. arXiv preprint arXiv:1704.08847, 2017.
|
| 223 |
+
|
| 224 |
+
Matthieu Courbariaux and Yoshua Bengio. Binarynet: Training deep neural networks with weights and activations constrained to+ 1 or-1. arXiv preprint arXiv:1602.02830, 2016.
|
| 225 |
+
|
| 226 |
+
Guneet S Dhillon, Kamyar Azizzadenesheli, Zachary C Lipton, Jeremy Bernstein, Jean Kossaifi, Aran Khanna, and Anima Anandkumar. Stochastic activation pruning for robust adversarial defense. arXiv preprint arXiv:1803.01442, 2018.
|
| 227 |
+
|
| 228 |
+
Angus Galloway, Graham W Taylor, and Medhat Moussa. Attacking binarized neural networks. arXiv preprint arXiv:1711.00449, 2017.
|
| 229 |
+
|
| 230 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples (2014). arXiv preprint arXiv:1412.6572.
|
| 231 |
+
|
| 232 |
+
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.
|
| 233 |
+
|
| 234 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 235 |
+
|
| 236 |
+
Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. arXiv preprint arXiv:1712.05877, 2017.
|
| 237 |
+
|
| 238 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 239 |
+
|
| 240 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 241 |
+
|
| 242 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1778–1787, 2018.
|
| 243 |
+
|
| 244 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 245 |
+
|
| 246 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 5, 2011.
|
| 247 |
+
|
| 248 |
+
NVIDIA. Nvidia turing architecture whitepaper. URL https://www.nvidia.com/ content/dam/en-zz/Solutions/design-visualization/technologies/ turing-architecture/NVIDIA-Turing-Architecture-Whitepaper.pdf.
|
| 249 |
+
|
| 250 |
+
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, 2016a.
|
| 251 |
+
|
| 252 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pp. 582–597. IEEE, 2016b.
|
| 253 |
+
|
| 254 |
+
Haifeng Qian and Mark N Wegman. L2-nonexpansive neural networks. arXiv preprint arXiv:1802.07896, 2018.
|
| 255 |
+
|
| 256 |
+
Adnan Siraj Rakin, Jinfeng Yi, Boqing Gong, and Deliang Fan. Defend deep neural networks against adversarial examples via fixed anddynamic quantized activation functions. arXiv preprint arXiv:1807.06714, 2018.
|
| 257 |
+
|
| 258 |
+
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.
|
| 259 |
+
|
| 260 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Inverted residuals and linear bottlenecks: Mobile networks for classification, detection and segmentation. arXiv preprint arXiv:1801.04381, 2018.
|
| 261 |
+
|
| 262 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 263 |
+
|
| 264 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. arXiv preprint arXiv:1710.10766, 2017.
|
| 265 |
+
|
| 266 |
+
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.
|
| 267 |
+
|
| 268 |
+
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.
|
| 269 |
+
|
| 270 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- \` Daniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 271 |
+
|
| 272 |
+
David Warde-Farley and Ian Goodfellow. 11 adversarial perturbations of deep neural networks. Perturbations, Optimization, and Statistics, pp. 311, 2016.
|
| 273 |
+
|
| 274 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
|
| 275 |
+
|
| 276 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 277 |
+
|
| 278 |
+
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.
|
| 279 |
+
|
| 280 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 281 |
+
|
| 282 |
+
# A GRADIENT MASKING OF OTHER METHODS
|
| 283 |
+
|
| 284 |
+
# A.1 TANH-BASED ACTIVATION QUANTIZATION LEADS TO FAKE SECURITY
|
| 285 |
+
|
| 286 |
+
Rakin et al. (2018) tried to use activation quantization as a defense method against adversarial samples. According to their experiments, simply Tanh based activation quantization can greatly improve the model’s robustness under PGD adversarial training setting. We reproduced their experiments by training a ResNet-18 model with PGD adversarial training on CIFAR-10 following Madry et al. (2017). To make a comparison, we also trained a full precision model and a ReLU6 quantized model following same setting. All the quantized models use bi $^ { = 2 }$ . We tested the trained model using PGD attack by Madry et al. (2017) under both white-box and black-box setting. We use a VGG-16 model separately trained with PGD adversarial training as the black-box attacker. The results are provided in Table 5.
|
| 287 |
+
|
| 288 |
+
Table 5. Tanh-based quantization improves white-box robustness, while suffers from inferior black-box robustness compared to full-precision model. The white-box accuracy is even higher than black-box, suggesting gradient masking. Setup: white-box and black-box robustness of PGD adversarially trained ResNet-18 on CIFAR-10. Quantization uses 2 bits.
|
| 289 |
+
|
| 290 |
+
<table><tr><td></td><td>Clean Acc.</td><td>White-Box Acc.</td><td>Black-Box Acc.</td></tr><tr><td>Full-Precision</td><td>83.47%</td><td>50.51%</td><td>65.58%</td></tr><tr><td>Tanh Quantized</td><td>81.60%</td><td>71.03%</td><td>61.57%</td></tr><tr><td>ReLU6 Quantized</td><td>78.97%</td><td>48.90%</td><td>59.44%</td></tr></table>
|
| 291 |
+
|
| 292 |
+
Our white-box result is consistent with (Rakin et al., 2018), where Tanh based quantizaion with PGD training gives much higher white-box accuracy compared to the full precision model. However, we can see that the black-box robustness decreases. Worse still, the black-box attack successful rate is even lower than white-box, which is abnormal since black-box attack is generally weaker than white-box. This phenomenon indicates severe gradient masking problem (Papernot et al., 2016a; Athalye et al., 2018), which gives a false sense of security. As a comparison, we also trained a ReLU6 quantized model. With ReLU6 quantization, there is no sign of gradient masking, nor improvement in robustness, indicating that gradient masking problem majorly comes from Tanh activation function. Actually, ReLU6 quantized model has slightly worse robustness.
|
| 293 |
+
|
| 294 |
+
Therefore we conclude that simple quantization cannot help to improve robustness. Instead, it leads to inferior robustness.
|
| 295 |
+
|
| 296 |
+
# A.2 ADVERSARIAL FGSM TRAINING CAUSES GRADIENT MASKING
|
| 297 |
+
|
| 298 |
+
Here we demonstrate that FGSM adversarial training leads to significant gradient masking problem, while $\mathrm { R + F G S M }$ fixes such issues. We trained a Wide ResNet using adversarial FGSM and adversarial $\mathrm { R + F G S M }$ respectively. Then the model is tested using FGSM with $\epsilon = 8$ under white-box and black-box setting (VGG-16 as substitute). The results are shown in Table
|
| 299 |
+
|
| 300 |
+
Table 6. White-box and black-box robustness of FGSM/R $+$ FGSM adversarially trained Wide ResNet on CIFAR-10.
|
| 301 |
+
|
| 302 |
+
<table><tr><td></td><td>Clean Acc.</td><td>White-Box Acc.</td><td>Black-Box Acc.</td></tr><tr><td>Adversarial FGSM</td><td>94.55%</td><td>94.18%</td><td>51.65%</td></tr><tr><td>Adversarial R+FGSM</td><td>91.61%</td><td>51.65%</td><td>87.39%</td></tr></table>
|
| 303 |
+
|
| 304 |
+
We can clearly see the same gradient masking effect. For adversarial FGSM training, it gives much higher white box robustness than $\mathrm { R + F G S M }$ adversarial training, while the black-box robustness is much worse. To avoid gradient masking, we thus use $\mathrm { R + F G S M }$ adversarial training instead.
|
| 305 |
+
|
| 306 |
+
# B HYPER-PARAMETERS: $\beta$ STUDY
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 6. Clean and adversarial accuracy of 4-bit quantized Wide ResNet w.r.t. different $\beta$
|
| 310 |
+
|
| 311 |
+
As observed in Section 5.1, the adversarial robustness of the model generally increases as $\beta$ gets larger. Here we aim to find what is the optimal $\beta$ for our experiment. We took 4-bit quantized Wide ResNet for example. As shown in Figure 6, the adversarial accuracy first gets larger as $\beta$ increases, and slowly goes down afterwards, reaching peak performance at $\beta = 0 . 0 0 2$ . The clean accuracy is more stable. At the first stage, as regularization gets stronger, the effect of noise amplify is suppressed more. While for the second stage, the training suffers from a too strong regularization. Therefore, we used a $\beta = 0 . 0 0 2$ for our experiments unless specified.
|
| 312 |
+
|
| 313 |
+
# C VISUALIZE SAMPLES AND PREDICTIONS
|
| 314 |
+
|
| 315 |
+
We visualize some of the clean and adversarial samples from CIFAR-10 test set, and the corresponding prediction for full precision model (FP), vanilla 4-bit quantized model (VQ) and our 4-bit Defensive Quantization model (DQ), as 4-bit quantization is now now supported by Tensor Cores with NVIDIA’s Turing Architecture (NVIDIA). Predicted class and probability is provided. Compared to FP and DQ, VQ has worse robustness by misclassifying more adversarial samples (sample 1, 2, 4, 6). Our DQ model enjoys better robustness than FP model in two aspects: 1. our DQ model succeeds to defend some of the attacks when FP failed (sample 5, 7); 2. our DQ model has a better confidence for true label compared to FP model when both succeeds to defend (sample 1, 4, 6). Even when all models fail to defend, our DQ model has the lowest confidence for the misclassified class (sample 3, 8).
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 7. Visualization of adversarial samples and the corresponding predictions (label and probability). FP: full-precision model; VQ: vanilla 4-bit quantized model; DQ: our 4-bit Defensive Quantization model
|
md/train/ryxIZR4tvS/ryxIZR4tvS.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# KNOWLEDGE HYPERGRAPHS: PREDICTION BEYOND BINARY RELATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge graphs store facts using relations between pairs of entities. In this work, we address the question of link prediction in knowledge hypergraphs where each relation is defined on any number of entities. While there exist techniques (such as reification) that convert the non-binary relations of a knowledge hypergraph into binary ones, current embedding-based methods for knowledge graph completion do not work well out of the box for knowledge graphs obtained through these techniques. Thus we introduce HSimplE and HypE, two embeddingbased methods that work directly with knowledge hypergraphs in which the representation of an entity is a function of its position in the relation. We also develop public benchmarks and baselines for this task and show experimentally that the proposed models are more effective than the baselines. Our experiments show that HypE outperforms HSimplE when trained with fewer parameters and when tested on samples that contain at least one entity in a position never encountered during training.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge Hypergraphs are graph structured knowledge bases that store facts about the world in the form of relations between two or more entities. They can be seen as one generalization of Knowledge Graphs, in which relations are defined on exactly two entities. Since accessing and storing all the facts in the world is difficult, knowledge bases are incomplete; the goal of link prediction (or knowledge completion) in knowledge (hyper)graphs is to predict unknown links or relationships between entities based on the existing ones. In this work we are interested in the problem of link prediction in knowledge hypergraphs. Our motivation for studying link prediction in these more sophisticated knowledge structures is based on the fact that most knowledge in the world has inherently complex composition, and that not all data can be represented as a relation between two entities without either losing a portion of the information or creating incorrect data points.
|
| 12 |
+
|
| 13 |
+
Link prediction in knowledge graphs is a problem that is studied extensively, and has applications in several tasks such as searching (Singhal, 2012) and automatic question answering (Ferrucci et al., 2010). In these studies, knowledge graphs are defined as directed graphs having nodes as entities and labeled edges as relations; edges are directed from the head entity to the tail entity. The common data structure for representing knowledge graphs is a set of triples relation(head, tail) that represent information as a collection of binary relations. There exist a large number of knowledge graphs that are publicly available, such as NELL (Carlson et al., 2010) and FREEBASE (Bollacker et al., 2008). It is noteworthy to mention that FREEBASE is a complex knowledge base where $61 \%$ of the relations are beyond binary (defined on more than two nodes). However, current methods use a simplified version of FREEBASE where the non-binary relations are converted to binary ones (defined on exactly two entities).
|
| 14 |
+
|
| 15 |
+
Embedding-based models (Nguyen, 2017) have proved to be effective for knowledge graph completion. These approaches learn embeddings for entities and relations. To find out if $r ( h , t )$ is a fact (i.e. is true), such models define a function that embeds relation $r$ and entities $h$ and $t$ , and produces the probability that $r ( h , t )$ is a fact. While successful, such embedding-based methods make the strong assumption that all relations are binary.
|
| 16 |
+
|
| 17 |
+
In this work, we introduce two embedding-based models that perform link prediction in knowledge hypergraphs. The first is HSimplE, which is inspired from SimplE (Kazemi & Poole, 2018), originally designed to perform link prediction in knowledge graphs. For a given entity, HSimplE shifts the entity embedding by a value that depends on the position of the entity in the given relation. Our second model is HypE, which in addition to learning entity embeddings, learns positional (convolutional) filters; these filters are disentangled from entity representations and are used to transform the representation of an entity based on its position in a relation. We show that both HSimplE and HypE are fully expressive. To evaluate our models, we introduce two new datasets from subsets of FREEBASE, and develop baselines by extending existing models on knowledge graphs to work with hypergraphs. We evaluate the proposed methods on standard binary and non-binary datasets. While both HSimplE and HypE outperform our baselines and the state-of-the-art, HypE is more effective with fewer parameters. It also produces much better results when predicting relations that contain at least one entity in a position never encountered during training, demonstrating the clear advantage of disentangling position representation from entity embeddings.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: In this example, the three facts in the original graph (a) show that Turing received his PhD from Princeton and his undergraduate degree from King’s College Cambridge. Figures (b) and (c) show two methods of converting this ternary relation into three binary ones.
|
| 21 |
+
|
| 22 |
+
The contributions of this paper are: (1) HypE and HSimplE, two embedding-based methods for knowledge hypergraph completion that outperform the baselines for knowledge hypergraphs, (2) a set of baselines for knowledge hypergraph completion, and (3) two new knowledge hypergraphs obtained from subsets of FREEBASE, which can serve as new evaluation benchmarks for knowledge hypergraph completion methods.
|
| 23 |
+
|
| 24 |
+
# 2 MOTIVATION AND RELATED WORK
|
| 25 |
+
|
| 26 |
+
Knowledge hypergraph completion is a relatively under-explored area. We motivate our work by outlining that adjusting current models to accommodate hypergraphs does not yield satisfactory results. Existing knowledge graph completion methods can be used in the beyond-binary setting by either (1) extending known models to work with non-binary relational data (e.g., m-TransH (Wen et al., 2016)), or by (2) converting non-binary relations into binary ones using methods such as reification or star-to-clique (Wen et al., 2016), and then applying known link prediction methods.
|
| 27 |
+
|
| 28 |
+
In the first case, the only example that extends a known model to work with non-binary relations is $\mathbf { m }$ -TransH (Wen et al., 2016), which is an extension of TransH (Wang et al., 2014), and which we show to be less effective than our models in Section 6. The second case is about restructuring a knowledge hypergraph to work with current knowledge graph completion methods. One common approach to reduce a hypergraph into a graph is reification. In order to reify a fact with a relation defined on $k$ entities, we first create a new entity $e$ (square nodes in Figure 1b) and connect $e$ to each of the $k$ entities that are part of the given fact. Another approch is Star-to-clique, which converts a fact defined on $k$ entities into $\binom { k } { 2 }$ facts with distinct relations between all pairwise entities in the fact. See Figure 1c.
|
| 29 |
+
|
| 30 |
+
Both conversion approaches have their caveats when current link-prediction models are applied to the resulting graphs. The example in Figure 1a shows three facts that pertain to the relation DEGREE_FROM_UNIVERSITY. When we reify the hypergraph in this example (Figure 1b), we add three reified entities. At test time, we again need to reify the test samples, which means we need a way to embed newly created entities about which we have almost no information. Applying the star-to-clique method to the hypergraph does not yield better results either: in this case, the resulting graph loses some of the information that the original hypergraph had — in Figure 1c, it is no longer clear which degree was granted by which institution.
|
| 31 |
+
|
| 32 |
+
Existing methods that relate to our work in this paper can be grouped into three main categories:
|
| 33 |
+
|
| 34 |
+
Knowledge graph completion. Embedding-based models such as translational (Bordes et al., 2013; Wang et al., 2014), bilinear (Yang et al., 2015; Trouillon et al., 2016; Kazemi & Poole, 2018), and deep models (Nickel et al., 2011; Socher et al., 2013) have proved effective for knowledge graphs where all relations are binary. We extend some of the models in this category and compare them with the proposed methods.
|
| 35 |
+
|
| 36 |
+
Knowledge hypergraph completion. Soft-rule models (Richardson & Domingos, 2006; De Raedt et al., 2007; Kazemi et al., 2014) can easily handle variable arity relations and have the advantage of being interpretable. However, they have a limited learning capacity and can only learn a subset of patterns (Nickel et al., 2016). Embedding-based methods are more powerful than soft-rule approaches. Guan et al. (2019) proposed an embedding-based method based on the star-to-clique approach which its caveats are discussed. m-TransH (Wen et al., 2016) extends TransH (Wang et al., 2014) to knowledge hypergraph completion. Kazemi & Poole (2018) prove that TransH and consequently m-TransH are not fully expressive and have restrictions in modeling relations. In contrast, our embedding-based proposed models are fully expressive and outperform m-TransH.
|
| 37 |
+
|
| 38 |
+
Learning on hypergraphs. Hypergraph learning has been employed to model high-order correlations among data in many tasks, such as in video object segmentation (Huang et al., 2009) and in modeling image relationships and image ranking (Huang et al., 2010). There is also a line of work extending graph neural networks to hypergraph neural networks (Feng et al., 2019) and hypergraph convolution networks (Yadati et al., 2018). On the other hand, these models are designed for undirected hypergraphs, with edges that are not labeled (no relations), while knowledge hypergraphs are directed and labeled. As there is no clear or easy way of extending these models to our knowledge hypergraph setting, we do not consider them as baselines for our experiments.
|
| 39 |
+
|
| 40 |
+
# 3 DEFINITION AND NOTATION
|
| 41 |
+
|
| 42 |
+
A world consists of a finite set of entities $\mathcal { E }$ , a finite set of relations $\mathcal { R }$ , and a set of tuples $\tau$ defined over $\mathcal { E }$ and $\mathcal { R }$ . Each tuple in $\tau$ is of the form $r ( v _ { 1 } , v _ { 2 } , \ldots , v _ { k } )$ where $r \in \mathcal { R }$ is a relation and each $v _ { i } \in \mathcal E$ is an entity, for all $i = 1 , 2 , \ldots , k$ . Here arity $| r |$ of a relation $r$ is the number of arguments that the relation takes and is fixed for each relation. A world specifies what is true: all the tuples in $\tau$ are true, and the tuples that are not in $\tau$ are false. A knowledge hypergraph consists of a subset of the tuples $\tau ^ { \prime } \subseteq \tau$ . Link prediction in knowledge hypergraphs is the problem of predicting the missing tuples in $\tau ^ { \prime }$ , that is, finding the tuples $\tau \setminus \tau ^ { \prime }$ .
|
| 43 |
+
|
| 44 |
+
An embedding is a function that converts an entity or a relation into a vector (or sometimes a higher order tensor) over a field (typically the real numbers). We use bold lower-case for vectors, that is, $\mathbf { e } \in \mathbb { R } ^ { k }$ is an embedding of entity $e$ , and $\mathbf { r } \in \mathbb { R } ^ { l }$ is an embedding of a relation $r$ .
|
| 45 |
+
|
| 46 |
+
Let $\mathbf { v _ { 1 } } , \mathbf { v _ { 2 } } , \ldots , \mathbf { v _ { k } }$ be a set of vectors. The variadic function concat $\left( \mathbf { v _ { 1 } } , \ldots , \mathbf { v _ { k } } \right)$ outputs the concatenation of its input vectors. The 1D convolution operator $^ *$ takes as input a vector $\mathbf { v }$ and a convolution weight filter $\omega$ , and outputs the convolution of $\mathbf { v }$ with the filters $\omega$ . We define the variadic function $\odot ( )$ to be the sum of the element-wise product of its input vectors, namely $\begin{array} { r } { \odot ( \mathbf { v _ { 1 } } , \mathbf { v _ { 2 } } , . . . , \mathbf { v _ { k } } ) = \sum _ { i = 1 } ^ { \ell } \mathbf { v _ { 1 } } ^ { ( i ) } \mathbf { v _ { 2 } } ^ { ( i ) } . . . \mathbf { v _ { k } } ^ { ( i ) } } \end{array}$ where each vector $\mathbf { v _ { i } }$ has the same length, and $\mathbf { v _ { j } } ^ { ( i ) }$ is the $i$ -th element of vector $\mathbf { v _ { j } }$ .
|
| 47 |
+
|
| 48 |
+
For the task of knowledge graph completion, an embedding-based model defines a function $\phi$ that takes a tuple $x$ as input, and generates a prediction, e.g., a probability (or score) of the tuple being true. A model is fully expressive if given any complete world (full assignment of truth values to all tuples), there exists an assignment of values to the embeddings of the entities and relations that accurately separates the tuples that are true in the world from those that are false.
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Visualization of HypE and HSimplE architectures. (a) function $\phi$ for HSimplE transforms entity embeddings by shifting them based on their position and combining them with the relation embedding. (b) function $f ( \mathbf { e } , i )$ for HypE takes an entity embedding and the position the entity appears in the given tuple, and returns a vector. (c) function $\phi$ takes as input a tuple and outputs the score of HypE for the tuple.
|
| 52 |
+
|
| 53 |
+
# 4 KNOWLEDGE HYPERGRAPH EMBEDDING: PROPOSED METHODS
|
| 54 |
+
|
| 55 |
+
The idea at the core of our methods is that the way an entity representation is used to make predictions is affected by the role that the entity plays in a given relation. In the example in Figure 1, Turing plays the role of a student at a university, but he may have a different role (e.g. ‘professor’) in another relation. This means that the way we use Turing’s embedding may need to be different for computing predictions for each of these roles.
|
| 56 |
+
|
| 57 |
+
The prediction for an entity should depend on the position it appears. If the prediction does not depend on the position, then the relation has to be symmetric. If it does and positions are learned independently, information about one position will not interact with that of others. It should be noted that in several embedding-based methods for knowledge graph completion, such as canonical polyadic (Hitchcock, 1927; Lacroix et al., 2018), ComplEx (Trouillon et al., 2016), and SimplE (Kazemi & Poole, 2018), the prediction depends on the position of an entity.
|
| 58 |
+
|
| 59 |
+
In what follows, we propose two embedding-based methods for link prediction in knowledge hypergraphs. The first model is inspired by SimplE and has its roots in link prediction in knowledge graphs; the second model takes a fresh look at knowledge completion as a multi-arity problem, without first setting it up within the frame of binary relation prediction.
|
| 60 |
+
|
| 61 |
+
HSimplE: HSimplE is an embedding-based method for link prediction in knowledge hypergraphs that is inspired by SimplE (Kazemi & Poole, 2018). SimplE learns two embedding vectors $\mathbf { e ^ { ( 1 ) } }$ and $\mathbf { e ^ { ( 2 ) } }$ for an entity $e$ (one for each possible position of the entity), and two embedding vectors $\mathbf { r } ^ { ( \mathbf { 1 } ) }$ and $\mathbf { r } ^ { ( 2 ) }$ for a relation $r$ (with one relation embedding as the inverse of the other). It then computes the score of a triple as $\phi \big ( r ( e _ { 1 } , e _ { 2 } ) \big ) = \odot \big ( \mathbf { r } ^ { ( 1 ) } , \mathbf { e _ { 1 } ^ { ( 1 ) } } , \mathbf { e _ { 2 } ^ { ( 2 ) } } \big ) + \odot \big ( \mathbf { r } ^ { ( 2 ) } , \mathbf { e _ { 2 } ^ { ( 1 ) } } , \mathbf { e _ { 1 } ^ { ( 2 ) } } \big )$
|
| 62 |
+
|
| 63 |
+
In HSimplE, we adopt the idea of having different representations for an entity based on its position in a relation, and updating all these representations from a single training tuple. We do this by representing each entity $e$ as a single vector $\mathbf { e }$ (instead of multiple vectors as in SimplE), and each relation $r$ as a single vector $\mathbf { r }$ . Conceptually, each e can be seen as the concatenation of the different representations of $e$ based on every possible position. For example, in a knowledge hypergraph where the relation with maximum arity is $\delta$ , an entity can appear in $\delta$ different positions; hence e will be the concatenation of $\delta$ vectors, one for each possible position. HSimplE scores a tuple using the following function:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\phi ( r ( e _ { i } , e _ { j } , \ldots , e _ { k } ) ) = \odot ( \mathbf { r } , \mathbf { e _ { i } } , \mathrm { s h i f t } ( \mathbf { e _ { j } } , \mathrm { l e n } ( \mathbf { e _ { j } } ) / \delta ) , \dots , \mathrm { s h i f t } ( \mathbf { e _ { k } } , \mathrm { l e n } ( \mathbf { e _ { k } } ) * ( \delta - 1 ) / \delta ) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Here, $\mathrm { s h i f t } ( \mathbf { a } , \mathbf { x } )$ shifts vector a to the left by $x$ steps, $\mathrm { l e n } ( \mathbf { e } )$ returns length of vector $\mathbf { e }$ , and $\delta =$ $\operatorname* { m a x } _ { r \in \mathcal { R } } ( | r | )$ . We observe that for knowledge graphs $\delta \ : = \ : 2 \ :$ ), SimplE is a special instance of HSimplE, with ${ \bf e } = \mathrm { c o n c a t } ( { \bf e } ^ { ( 1 ) } , { \bf e } ^ { ( 2 ) } )$ and $\mathbf { r } = \mathrm { c o n c a t } ( \mathbf { r } ^ { ( 1 ) } , \mathbf { r } ^ { ( 2 ) } )$ . The architecture of HSimplE is summarized in Figure 2a.
|
| 70 |
+
|
| 71 |
+
HypE: HypE learns a single representation for each entity, a single representation for each relation, and positional convolutional weight filters for each possible position. At inference time, the appropriate positional filters are first used to transform the embedding of each entity in the given fact; these transformed entity embeddings are then combined with the embedding of the relation to produce a score, e.g., a probability value that the input tuple is true. The architecture of HypE is summarized in Figures 2b and 2c.
|
| 72 |
+
|
| 73 |
+
Let $n , l , d$ , and $s$ denote the number of filters per position, the filter-length, the embedding dimension and the stride of the convolution, respectively. Let $\omega _ { i } \in \mathbb { R } ^ { n } \times \mathbb { R } ^ { \overline { { l } } }$ be the convolutional filters associated with an entity at position $i$ , and let $\omega _ { i j } ~ \in ~ \mathbb { R } ^ { l }$ be the $j$ th row of $\omega _ { i }$ . We denote by $P \in \mathbb { R } ^ { n q } \times \mathbb { R } ^ { d }$ the projection matrix, where $q = \lfloor ( d - l ) / s \rfloor + 1$ is the feature map size. For a given tuple, define $f ( \mathbf { e } , i ) = \mathrm { c o n c a t } ( \mathbf { e } * \omega _ { \mathrm { i 1 } } , \dots , \mathbf { e } * \omega _ { \mathrm { i n } } ) \mathrm { P }$ to be a function that returns a vector of size $d$ based on the entity embedding $\mathbf { e }$ and it’s position $i$ in the tuple. Thus, each entity embedding $\mathbf { e }$ appearing at position $i$ in a given tuple is convolved with the set of position-specific filters $\omega _ { i }$ to give $n$ feature maps of size $q$ . All $n$ feature maps corresponding to an entity are concatenated to a vector of size $n q$ and projected to the embedding space by multiplying it by $P$ . The projected vectors of entities and the embedding of the relation are combined by an inner-product to define $\phi$ :
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\phi ( r ( e _ { 1 } , \ldots , e _ { | r | } ) ) = \odot ( { \bf r } , f ( { \bf e _ { 1 } } , 1 ) , \ldots , f ( { \bf e _ { | r | } } , | r | ) )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
The advantage of learning positional filters independent of entities is two-folds: On one hand, learning a single vector per entity keeps entity representations simple and disentangled from its position in a given fact. On the other hand, unlike HSimplE, HypE learns positional filters from all entities that appear in the given position; Overall, this separation of representations for entities, relations, and position facilitates the representation of knowledge bases having facts of arbitrary number of entities. It also gives HypE an advantage in the case when we test a trained HypE model on a tuple that contains an entity in a position never seen before at train time. We discuss this further in Section 6.1.
|
| 80 |
+
|
| 81 |
+
Both HSimplE and HypE are fully expressive — an important property that has been the focus of several studies (Fatemi et al., 2019; Trouillon et al., 2017; Xu et al., 2018). A model that is not fully expressive can easily underfit to the training data and embed assumptions that may not be reflected in reality. We defer the proofs of expressivity to Appendix A.
|
| 82 |
+
|
| 83 |
+
# 4.1 OBJECTIVE FUNCTION AND TRAINING
|
| 84 |
+
|
| 85 |
+
To learn either of a HSimplE or HypE model, we use stochastic gradient descent with mini-batches. In each learning iteration, we iteratively take in a batch of positive tuples from the knowledge hypergraph. As we only have positive instances available, we need also to train our model on negative instances. For this purpose, for each positive instance, we produce a set of negative instances. For negative sample generation, we follow the contrastive approach of Bordes et al. (2013) for knowledge graphs and extend it to knowledge hypergraphs: for each tuple, we produce a set of negative samples of size $N | r |$ by replacing each of the entities with $N$ random entities in the tuple, one at a time. Here, $N$ is the ratio of negative samples in our training set, and is a hyperparameter.
|
| 86 |
+
|
| 87 |
+
Given a knowledge hypergraph defined on $\tau ^ { \prime }$ , we let $\tau _ { t r a i n } ^ { \prime }$ , $\tau _ { t e s t } ^ { \prime }$ , and $\tau _ { v a l i d } ^ { \prime }$ denote the train, test, and validation sets, respectively, so that $\tau ^ { \prime } = \tau _ { t r a i n } ^ { \prime } \cup \tau _ { t e s t } ^ { \prime } \cup \tau _ { v a l i d } ^ { \prime }$ . For any tuple $x$ in , we let $T _ { n e g } ( x )$ be a function that generates a set of negative samples through the process described above. Let $\mathbf { r }$ represent relation embeddings, e represent entity embeddings, and let $\phi$ be the function given by equation 1 that maps a tuple to a score based on $\mathbf { r }$ and $\mathbf { e }$ . We define the following cross entropy loss, which is a combination of softmax and negative log likelihood loss, and has been shown to be effective for link prediction (Kadlec et al., 2017):
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathcal { L } ( \mathbf { r } , \mathbf { e } ) = \sum _ { x ^ { \prime } \in \tau _ { t r a i n } ^ { \prime } } - l o g \bigg ( \frac { e ^ { \phi ( x ^ { \prime } ) } } { e ^ { \phi ( x ^ { \prime } ) } + \displaystyle \sum _ { x \in T _ { n e g } ( x ^ { \prime } ) } e ^ { \phi ( x ) } } \bigg )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
# 5 EXPERIMENTAL SETUP
|
| 94 |
+
|
| 95 |
+
# 5.1 DATASETS
|
| 96 |
+
|
| 97 |
+
We conduct experiments on a total of 5 different datasets. For the experiments on datasets with binary relations, we use two standard benchmarks for knowledge graph completion: WN18 (Bordes et al., 2014) and $\mathrm { F B } 1 5 \mathrm { k }$ (Bordes et al., 2013). WN18 is a subset of WORDNET (Miller, 1995) and $\mathrm { F B } 1 5 \mathrm { k }$ is a subset of FREEBASE (Bollacker et al., 2008). We use the train, validation, and test split proposed by Bordes et al. (2013). The experiments on knowledge hypergraph completion are conducted on three datasets. The first is JF17K proposed by Wen et al. (2016); as no validation set is proposed for JF17K, we randomly select $20 \%$ of the train set as validation. We also create two datasets FB-AUTO and M-FB15K from FREEBASE. See Appendix A for more dataset details.
|
| 98 |
+
|
| 99 |
+
# 5.2 BASELINES
|
| 100 |
+
|
| 101 |
+
To compare our results to that of existing work, we first design a few simple baselines that extend current models to work with knowledge hypergraphs. We only consider models that admit a simple extension to beyond-binary relations for the link prediction task. The baselines for this task are grouped into the following categories: (1) methods that work with binary relations and that are easily extendable to higher-arity: r-SimplE, m-DistMult, and m-CP; (2) existing methods that can handle higher-arity relations: m-TransH. Below we give some details about methods in category (1).
|
| 102 |
+
|
| 103 |
+
r-SimplE: To test performance of a model trained on reified data, we converted higher-arity relations in the train set to binary relations through reification. We then use the SimplE model (that we call r-SimplE) to train and test on this reified data. In this setting, at test time higher-arity relations are first reified to a set of binary relations; this process creates new auxiliary entities for which the model has no learned embeddings. To embed the auxiliary entities for the prediction step, we use the observation we have about them at test time. For example, a higher-arity relation $r ( e _ { 1 } , e _ { 2 } , e _ { 3 } )$ is reified at test time by being replaced by three facts: $r _ { 1 } ( i d 1 2 3 , e _ { 1 } )$ , $r _ { 2 } ( i d 1 2 3 , e _ { 2 } )$ , and $r _ { 3 } ( i d 1 2 3 , e _ { 3 } )$ . When predicting the tail entity of $r _ { 1 } ( i \dot { d } 1 2 3 , ? )$ , we use the other two reified facts to learn an embedding for entity id123. Because id123 is added only to help represent the higher-arity relations as a set of binary relations, we only do tail prediction for reified relations.
|
| 104 |
+
|
| 105 |
+
m-DistMult: DistMult (Yang et al., 2015) defines a score function $\phi ( r ( e _ { i } , e _ { j } ) ) = \odot ( { \bf r } , { \bf e _ { i } } , { \bf e _ { j } } )$ . To accommodate non-binary relations, we redefine this function as $\phi ( r ( e _ { i } , \ldots , e _ { j } ) ) = \odot ( \mathbf { r } , \mathbf { e _ { i } } , \ldots , \mathbf { e _ { j } } )$
|
| 106 |
+
|
| 107 |
+
m-CP: Canonical Polyadic (CP) decomposition (Hitchcock, 1927) embeds each entity $e$ as two vectors $\mathbf { e ^ { ( 1 ) } }$ and $\mathbf { e ^ { ( 2 ) } }$ , and each relation $r$ as a single vector $\mathbf { r }$ . CP defines the score function $\phi ( r ( e _ { i } , e _ { j } ) ) = \odot ( { \bf r } , { \bf e _ { i } ^ { ( 1 ) } } , { \bf e _ { j } ^ { ( 2 ) } } )$ . We extend CP to a variant $\left( \mathrm { m - C P } \right)$ that accommodates nonbinary relations, and which embeds each entity as $\delta$ different vectors $\mathbf { e } ^ { ( \mathbf { 1 } ) } , . . , \mathbf { e } ^ { ( \delta ) }$ , where $\delta \ : = \ :$ $\mathrm { m a x } _ { r \in \mathcal { R } } ( | r | )$ . m-CP computes the score of a tuple as $\phi ( r ( e _ { i } , \ldots , e _ { j } ) ) = \odot ( \mathbf { r } , \mathbf { e _ { i } ^ { ( 1 ) } } , . . . , \mathbf { e _ { j } ^ { ( | \mathbf { r } | ) } } )$ .
|
| 108 |
+
|
| 109 |
+
# 5.3 EVALUATION METRICS
|
| 110 |
+
|
| 111 |
+
Given a knowledge hypergraph on $\tau ^ { \prime }$ , we evaluate various completion methods using a train and test set $\tau _ { t r a i n } ^ { \prime }$ and $\tau _ { t e s t } ^ { \prime }$ . We use two evaluation metrics: $\operatorname { H i t } @ \operatorname { t }$ and Mean Reciprocal Rank (MRR). Both these measures rely on the ranking of a tuple $x \in \tau _ { t e s t } ^ { \prime }$ within a set of corrupted tuples. For each tuple $r ( e _ { 1 } , \ldots , e _ { k } )$ in $\tau _ { t e s t } ^ { \prime }$ and each entity position $i$ in the tuple, we generate $| \mathcal { E } | - 1$ corrupted tuples by replacing the entity $e _ { i }$ with each of the entities in $\mathcal { E } \setminus \{ e _ { i } \bar { \} }$ . For example, by corrupting entity $e _ { i }$ , we would obtain a new tuple $r ( e _ { 1 } , \ldots , e _ { i } ^ { c } , \ldots , e _ { k } )$ where $\bar { e _ { i } ^ { c } } \in \mathcal { E } \setminus \{ e _ { i } \}$ . Let the set of corrupted tuples, plus $r ( e _ { 1 } , \ldots , e _ { k } )$ , be denoted by $\theta _ { i } ( r ( e _ { 1 } , \ldots , e _ { k } ) )$ . Let $\mathrm { r a n k } _ { i } ( r ( e _ { 1 } , \ldots , e _ { k } ) )$ be the ranking of $r ( e _ { 1 } , \ldots , e _ { k } )$ within $\dot { \theta } _ { i } ( r ( e _ { 1 } , \ldots , e _ { k } ) )$ based on the score $\phi ( x )$ for each $x \in \theta _ { i } ( r ( e _ { 1 } , \ldots , e _ { k } ) )$ . In an ideal knowledge hypergraph completion method, the rank $\mathrm { r a n k } _ { i } ( r ( e _ { 1 } , \ldots , e _ { k } ) )$ is 1 among all corrupted tuples. We compute the MRR as 1K Pr(e1,...,ek)∈τ0test $\begin{array} { r } { \frac { 1 } { K } \sum _ { r ( e _ { 1 } , . . . , e _ { k } ) \in \tau _ { t e s t } ^ { \prime } } \sum _ { i = 1 } ^ { k } \frac { 1 } { \mathrm { r a n k } _ { i } r ( e _ { 1 } , . . . , e _ { k } ) } } \end{array}$ where $\begin{array} { r } { K = \sum _ { r ( e _ { 1 } , \dots e _ { k } ) \in \tau _ { t e s t } ^ { \prime } } | r | } \end{array}$ is the number of prediction tasks. $\operatorname { H i t } @ \operatorname { t }$ measures the proportion of tuples in $\tau _ { t e s t } ^ { \prime }$ that rank among top $t$ in their corresponding corrupted sets. We follow Bordes et al. (2013) and remove all corrupted tuples that are in $\tau ^ { \prime }$ from our computation of MRR and $\mathrm { H i t @ t }$ .
|
| 112 |
+
|
| 113 |
+
# 6 EXPERIMENTS
|
| 114 |
+
|
| 115 |
+
This section summarizes our experiments with HSimplE and HypE. We evaluate both models on knowledge hypergraphs, as well as on knowledge graphs, and show results on training with different embedding dimensions. Moreover, to test their representation power further, we evaluate HSimplE and HypE on a more challenging dataset that we describe below. We also conduct ablation studies based on performance breakdown across different arities.
|
| 116 |
+
|
| 117 |
+
Table 1: Knowledge hypergraph completion results on JF17K, FB-AUTO and M-FB15K for baselines and the proposed method. The prefixes ‘r’ and $\cdot _ { \mathrm { m } } ,$ in the model names stand for reification and multi-arity respectively. Both our methods outperform the baselines on all datasets.
|
| 118 |
+
|
| 119 |
+
<table><tr><td></td><td colspan="4">JF17K</td><td colspan="4">FB-AUTO</td><td colspan="4">M-FB15K</td></tr><tr><td>Model</td><td>MRR</td><td>Hit@1</td><td>Hit@3</td><td>Hit@10</td><td>MRR</td><td>Hit@1</td><td>Hit@3</td><td>Hit@10</td><td>MRR Hit@1</td><td>Hit@3</td><td></td><td>Hit@10</td></tr><tr><td>r-SimplE</td><td>0.102</td><td>0.069</td><td>0.112</td><td>0.168</td><td>0.106</td><td>0.082</td><td>0.115</td><td>0.147</td><td>0.051</td><td>0.042</td><td>0.054</td><td>0.070</td></tr><tr><td>m-DistMult</td><td>0.460</td><td>0.367</td><td>0.510</td><td>0.635</td><td>0.784</td><td>0.745</td><td>0.815</td><td>0.845</td><td>0.705</td><td>0.633</td><td>0.740</td><td>0.844</td></tr><tr><td>m-CP</td><td>0.392</td><td>0.303</td><td>0.441</td><td>0.560</td><td>0.752</td><td>0.704</td><td>0.785</td><td>0.837</td><td>0.680</td><td>0.605</td><td>0.715</td><td>0.828</td></tr><tr><td>m-TransH(Wen et al.,2016)</td><td>0.446</td><td>0.357</td><td>0.495</td><td>0.614</td><td>0.728</td><td>0.727</td><td>0.728</td><td>0.728</td><td>0.623</td><td>0.531</td><td>0.669</td><td>0.809</td></tr><tr><td>HSimplE(Ours)</td><td>0.472</td><td>0.375</td><td>0.523</td><td>0.649</td><td>0.798</td><td>0.766</td><td>0.821</td><td>0.855</td><td>0.730</td><td>0.664</td><td>0.763</td><td>0.859</td></tr><tr><td>HypE(Ours)</td><td>0.492</td><td>0.409</td><td>0.533</td><td>0.650</td><td>0.804</td><td>0.774</td><td>0.823</td><td>0.856</td><td>0.777</td><td>0.725</td><td>0.800</td><td>0.881</td></tr></table>
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 3: The above experiments show that HypE outperforms HSimplE when trained with fewer parameters, and when tested on samples that contain at least one entity in a position never encountered during training. (a) MRR of HypE and HSimplE for different embedding dimensions. (b) Results of m-CP, HSimplE, and HypE on the missing positions test set.
|
| 123 |
+
|
| 124 |
+
# 6.1 KNOWLEDGE HYPERGRAPH COMPLETION RESULTS
|
| 125 |
+
|
| 126 |
+
The results of our experiments, summarized in Table 1, show that both HSimplE and HypE outperform the proposed baselines across the three datasets JF17K, FB-AUTO, and M-FB15K. They further demonstrate that reification for the r-SimplE model does not work well; this is because the reification process introduces auxiliary entities for which the model does not learn appropriate embeddings because these auxiliary entities appear in very few facts. Comparing the results of rSimplE against HSimplE, we can also see that extending a model to work with hypergraphs works better than reification when high-arity relations are present.
|
| 127 |
+
|
| 128 |
+
The ability of knowledge sharing through the learned position-dependent convolution filters suggests that HypE would need a lower number of parameters than HSimplE in order to obtain good results. To test this, we train both models with embedding dimension of 50, 100, and 200. Figure 3a shows the MRR evaluation on the test set for each model with different embedding sizes. Based on the MRR result, we can see that HypE outperforms HSimplE by $2 4 \%$ for embedding dimension 50, implying that HypE works better under a constrained budget. This difference becomes negligible for embedding dimensions of 200.
|
| 129 |
+
|
| 130 |
+
Disentangling the representations of entity embeddings and positional filters enables HypE to better learn the role of position within a relation, because the learning process considers the behaviour of all entities that appear in a given position at time of training. This becomes specially important in the case when some entities never appear in certain positions in the train set, but you still want to be able to reason about them no matter what position they appear in at test time. In order to test the effectiveness of our models in this more challenging scenario, we created a missing positions test set by selecting the tuples from our original test set that contain at least one entity in a position it never appears in in the train dataset. The results on these experiments (Figure 3b) show that (1) both HSimplE and HypE outperform m-CP (which learns different embeddings for each entity-position pair), and more importantly, (2) HypE significantly outperforms HSimplE for this challenging test set, leading us to believe that disentangling entity and position representations may be a better strategy for this scenario.
|
| 131 |
+
|
| 132 |
+
Table 2: Knowledge graph completion results on WN18 and FB15K for baselines and HypE. Note that we do not include results for HSimplE because for knowledge graphs, HSimplE is equivalent to SimplE. The table shows that HypE performs similar to the best baselines for knowledge graphs with binary relations.
|
| 133 |
+
|
| 134 |
+
<table><tr><td></td><td colspan="4">WN18</td><td colspan="4">FB15k</td></tr><tr><td>Model</td><td>MRR</td><td>Hit@1</td><td>Hit@3</td><td>Hit@10</td><td>MRR</td><td>Hit@1</td><td>Hit@3</td><td>Hit@10</td></tr><tr><td>CP(Hitchcock,1927)</td><td>0.074</td><td>0.049</td><td>0.080</td><td>0.125</td><td>0.326</td><td>0.219</td><td>0.376</td><td>0.532</td></tr><tr><td>TransH (Wang et al., 2014)</td><td>1</td><td>1</td><td>-</td><td>0.867</td><td>-</td><td>-</td><td>-</td><td>0.585</td></tr><tr><td>m-TransH (Wen et al., 2016)</td><td>0.671</td><td>0.495</td><td>0.839</td><td>0.923</td><td>0.351</td><td>0.228</td><td>0.427</td><td>0.559</td></tr><tr><td>DistMult (Yang et al., 2015)</td><td>0.822</td><td>0.728</td><td>0.914</td><td>0.936</td><td>0.654</td><td>0.546</td><td>0.733</td><td>0.824</td></tr><tr><td>SimplE (Kazemi & Poole,2018)</td><td>0.942</td><td>0.939</td><td>0.944</td><td>0.947</td><td>0.727</td><td>0.660</td><td>0.773</td><td>0.838</td></tr><tr><td>HypE (Ours)</td><td>0.934</td><td>0.927</td><td>0.940</td><td>0.944</td><td>0.725</td><td>0.648</td><td>0.777</td><td>0.856</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 3: Breakdown performance of $\mathrm { H i t } @ 1 0$ across relations with different arities on JF17K.
|
| 137 |
+
Arity
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Model</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>All</td></tr><tr><td>r-SimplE</td><td>0.478</td><td>0.025</td><td>0.015</td><td>0.022</td><td>0.000</td><td>0.168</td></tr><tr><td>m-DistMult</td><td>0.359</td><td>0.591</td><td>0.745</td><td>0.869</td><td>0.359</td><td>0.635</td></tr><tr><td>m-CP</td><td>0.305</td><td>0.517</td><td>0.679</td><td>0.870</td><td>0.875</td><td>0.560</td></tr><tr><td>m-TransH (Wen et al., 2016)</td><td>0.316</td><td>0.563</td><td>0.762</td><td>0.925</td><td>0.979</td><td>0.614</td></tr><tr><td>HSimplE (Ours)</td><td>0.376</td><td>0.625</td><td>0.742</td><td>0.810</td><td>0.010</td><td>0.649</td></tr><tr><td>‘HypE (Ours)</td><td>0.338</td><td>0.626</td><td>0.776</td><td>0.936</td><td>0.948</td><td>0.650</td></tr></table>
|
| 140 |
+
|
| 141 |
+
# 6.2 KNOWLEDGE GRAPH COMPLETION RESULTS
|
| 142 |
+
|
| 143 |
+
To confirm that HSimplE and HypE still work well on the more common knowledge graphs, we evaluate them on WN18 and FB15K. Table 2 shows link prediction results on WN18 and FB15K. Baseline results are taken from the original papers except that of m-TransH, which we implement ourselves. Instead of tuning the parameters of HypE to get potentially better results, we instead follow the Kazemi & Poole (2018) setup with the same grid search approach by setting $n = 2$ , $l = 2$ , and $s = 2$ . This results in all models in Table 2 having the same number of parameters, and thus makes them directly comparable to each other. Note that since HSimplE is equivalent to SimplE for binary relations (as shown in Section 4), we have excluded HSimplE from the table. The results show that on WN18 and FB15K, HypE outperforms all baselines except SimplE, while its performance remains comparable to that of SimplE.
|
| 144 |
+
|
| 145 |
+
# 6.3 ABLATION STUDY ON DIFFERENT ARITIES
|
| 146 |
+
|
| 147 |
+
We break down the performance of HSimplE, HypE and each of the baselines across relations with different arities. Table 3 shows the Hit@10 results of the models for each arity in JF17K. We observe that the proposed models outperform the state-of-the-art and the baselines in all arities except arity 6, which has a total of only 37 tuples in the train and test sets. Table 3 also shows that the performance of all models generally improve as arity increases. We note that the train set has much fewer relation types that are defined on a high number of entities — JF17K contains only two relation types that admit six entities. This leads us to hypothesize that the position and/or entity representations learned for higher arities are optimized for these few relation types.
|
| 148 |
+
|
| 149 |
+
# 7 CONCLUSIONS
|
| 150 |
+
|
| 151 |
+
Knowledge hypergraph completion is an important problem that has received little attention. In this work, having introduced two new knowledge hypergraph dataset, baselines, and two new methods for link prediction in knowledge hypergraphs, we hope to kindle interest in the problem. Unlike knowledge graphs, hypergraphs have a more complex structure that opens the door to more challenging questions such as: how do we effectively predict the missing entities in a given (partial) tuple? Is MRR a good evaluation metric for hypergraphs?
|
| 152 |
+
|
| 153 |
+
# REFERENCES
|
| 154 |
+
|
| 155 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In ACM ICMD, 2008.
|
| 156 |
+
|
| 157 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS, 2013.
|
| 158 |
+
|
| 159 |
+
Antoine Bordes, Xavier Glorot, Jason Weston, and Yoshua Bengio. A semantic matching energy function for learning with multi-relational data. Machine Learning, 94(2):233–259, 2014.
|
| 160 |
+
|
| 161 |
+
Andrew Carlson, Justin Betteridge, Bryan Kisiel, Burr Settles, Estevam R Hruschka Jr, and Tom M Mitchell. Toward an architecture for never-ending language learning. In AAAI, 2010.
|
| 162 |
+
|
| 163 |
+
Luc De Raedt, Angelika Kimmig, and Hannu Toivonen. Problog: A probabilistic prolog and its application in link discovery. IJCAI, 2007.
|
| 164 |
+
|
| 165 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12(Jul):2121–2159, 2011.
|
| 166 |
+
|
| 167 |
+
Bahare Fatemi, Siamak Ravanbakhsh, and David Poole. Improved knowledge graph embedding using background taxonomic information. In AAAI, 2019.
|
| 168 |
+
|
| 169 |
+
Yifan Feng, Haoxuan You, Zizhao Zhang, Rongrong Ji, and Yue Gao. Hypergraph neural networks. In AAAI, 2019.
|
| 170 |
+
|
| 171 |
+
David Ferrucci, Eric Brown, Jennifer Chu-Carroll, James Fan, David Gondek, Aditya A Kalyanpur, Adam Lally, J William Murdock, Eric Nyberg, John Prager, et al. Building watson: An overview of the deepqa project. AI magazine, 31(3):59–79, 2010.
|
| 172 |
+
|
| 173 |
+
Saiping Guan, Xiaolong Jin, Yuanzhuo Wang, and Xueqi Cheng. Link prediction on n-ary relational data. In The World Wide Web Conference, pp. 583–593. ACM, 2019.
|
| 174 |
+
|
| 175 |
+
Frank L Hitchcock. The expression of a tensor or a polyadic as a sum of products. Journal of Mathematics and Physics, 6(1-4):164–189, 1927.
|
| 176 |
+
|
| 177 |
+
Yuchi Huang, Qingshan Liu, and Dimitris Metaxas. Video object segmentation by hypergraph cut. In CVPR, 2009.
|
| 178 |
+
|
| 179 |
+
Yuchi Huang, Qingshan Liu, Shaoting Zhang, and Dimitris N Metaxas. Image retrieval via probabilistic hypergraph ranking. In CVPR, 2010.
|
| 180 |
+
|
| 181 |
+
Rudolf Kadlec, Ondrej Bajgar, and Jan Kleindienst. Knowledge base completion: Baselines strike back. In RepL4NLP, 2017.
|
| 182 |
+
|
| 183 |
+
Seyed Mehran Kazemi and David Poole. Simple embedding for link prediction in knowledge graphs. In NIPS, 2018.
|
| 184 |
+
|
| 185 |
+
Seyed Mehran Kazemi, David Buchman, Kristian Kersting, Sriraam Natarajan, and David Poole. Relational logistic regression. In KR, 2014.
|
| 186 |
+
|
| 187 |
+
Timothee Lacroix, Nicolas Usunier, and Guillaume Obozinski. Canonical tensor decomposition for ´ knowledge base completion. ICML, 2018.
|
| 188 |
+
|
| 189 |
+
George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39–41, 1995.
|
| 190 |
+
|
| 191 |
+
Dat Quoc Nguyen. An overview of embedding models of entities and relationships for knowledge base completion. arXiv preprint arXiv:1703.08098, 2017.
|
| 192 |
+
|
| 193 |
+
Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. A three-way model for collective learning on multi-relational data. In ICML, 2011.
|
| 194 |
+
|
| 195 |
+
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, 2016.
|
| 196 |
+
|
| 197 |
+
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, 2017.
|
| 198 |
+
Matthew Richardson and Pedro Domingos. Markov logic networks. Machine learning, 62(1-2): 107–136, 2006.
|
| 199 |
+
Sameer Singh, Amarnag Subramanya, Fernando Pereira, and Andrew McCallum. Wikilinks: A large-scale cross-document coreference corpus labeled via links to wikipedia. University of Massachusetts, Amherst, Tech. Rep. UM-CS-2012, 15, 2012.
|
| 200 |
+
Amit Singhal. Introducing the knowledge graph: things, not strings, 2012.
|
| 201 |
+
Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In NIPS, 2013.
|
| 202 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. JMLR, 15(1):1929–1958, 2014.
|
| 203 |
+
Theo Trouillon, Johannes Welbl, Sebastian Riedel, ´ Eric Gaussier, and Guillaume Bouchard. Com- ´ plex embeddings for simple link prediction. In ICML, 2016.
|
| 204 |
+
Theo Trouillon, Christopher R Dance, ´ Eric Gaussier, Johannes Welbl, Sebastian Riedel, and Guil- ´ laume Bouchard. Knowledge graph completion via complex tensor factorization. JMLR, 18(1): 4735–4772, 2017.
|
| 205 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In AAAI, 2014.
|
| 206 |
+
Jianfeng Wen, Jianxin Li, Yongyi Mao, Shini Chen, and Richong Zhang. On the representation and embedding of knowledge bases beyond binary relations. In IJCAI, 2016.
|
| 207 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 208 |
+
Naganand Yadati, Madhav Nimishakavi, Prateek Yadav, Anand Louis, and Partha Talukdar. Hypergcn: Hypergraph convolutional networks for semi-supervised classification. arXiv preprint arXiv:1809.02589, 2018.
|
| 209 |
+
Bishan Yang, Wen tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. CoRR, abs/1412.6575, 2015.
|
| 210 |
+
|
| 211 |
+
# A APPENDIX
|
| 212 |
+
|
| 213 |
+
# A.1 DATASETS
|
| 214 |
+
|
| 215 |
+
Table 4 summarizes the statistics of the datasets. Note first that FREEBASE is a reified dataset; that is, it is created from a knowledge base having facts with relations defined on two or more entities. To obtain a knowledge hypergraph $H$ from FREEBASE, we perform an inverse reification process by following the steps below.
|
| 216 |
+
|
| 217 |
+
1. From FREEBASE, remove the facts that have relations defined on a single entity, or that contain numbers or enumeration as entities.
|
| 218 |
+
2. Convert the triples in FREEBASE that share the same entity into facts in $H$ . For example, the triples $r _ { 0 } ( i d 1 2 3 , e _ { i } )$ , $r _ { 1 } ( i d 1 2 3 , e _ { j } )$ , and $r _ { 2 } ( i d 1 2 3 , e _ { k } )$ , which were originally created by the addition of the (unique) reified entity $i d 1 2 3$ , now represent fact $\boldsymbol { r } ( e _ { i } , e _ { j } , e _ { k } )$ in $H$ .
|
| 219 |
+
3. Create the FB-AUTO dataset by selecting the facts from $H$ whose subject is ‘automotive’.
|
| 220 |
+
4. Create the M-FB15K dataset by following a strategy similar to that proposed by Bordes et al. (2013): select the facts in $H$ that pertain to entities present in the Wikilinks database (Singh et al., 2012).
|
| 221 |
+
|
| 222 |
+
5. Split the facts in each of FB-AUTO and M-FB15K randomly into train, test, and validation sets.
|
| 223 |
+
|
| 224 |
+
Table 4: Dataset Statistics.
|
| 225 |
+
|
| 226 |
+
<table><tr><td>Dataset</td><td></td><td>R</td><td>#train</td><td>#valid</td><td>#test</td><td>#arity=2</td><td>#arity=3 #arity=4 #arity=5 #arity=6</td><td></td><td></td><td></td></tr><tr><td>WN18</td><td>40,943</td><td>18</td><td>141,442</td><td>5,000</td><td>5,000</td><td>151,442</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>FB15k</td><td>14,951</td><td>1,345</td><td>483,142</td><td>50,000</td><td>59,071</td><td>592,213</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>JF17K</td><td>29,177</td><td>327</td><td>77,733</td><td>一</td><td>24,915</td><td>56,322</td><td>34,550</td><td>9,509</td><td>2,230</td><td>37</td></tr><tr><td>FB-AUTO</td><td>3,410</td><td>8</td><td>6,778</td><td>2,255</td><td>2,180</td><td>3,786</td><td>0</td><td>215</td><td>7,212</td><td>0</td></tr><tr><td>M-FB15K</td><td>10,314</td><td>71</td><td>415,375</td><td>39,348</td><td>38,797</td><td>82,247</td><td>400,027</td><td>26</td><td>11,220</td><td>0</td></tr></table>
|
| 227 |
+
|
| 228 |
+
# A.2 IMPLEMENTATION DETAILS
|
| 229 |
+
|
| 230 |
+
We implement HSimplE, HypE and the baselines in PyTorch (Paszke et al., 2017). We use Adagrad (Duchi et al., 2011) as the optimizer and dropout (Srivastava et al., 2014) to regularize our model and baselines. We tune our hyperparameters over the validation set, and fix the maximum number of epochs to 500 and batch size to 128. We set the embedding size and negative ratio to 200 and 10 respectively. We compute the MRR of models over the validation set every 50 epochs and select the epoch that results the best. The learning rate and dropout rate of all models are tuned. HypE also has $n$ , $l$ and $s$ as hyperparameters. We select the hyperparameters of HypE, HSimplE and baselines via the same grid search based on MRR on the validation. The code of the proposed model, the baselines, and the datasets are available in this link.
|
| 231 |
+
|
| 232 |
+
# A.3 FULL EXPRESSIVITY
|
| 233 |
+
|
| 234 |
+
Theorem 1 (Expressivity of HypE) Let $\tau$ be a set of true tuples defined over entities $\mathcal { E }$ and relations $\mathcal { R }$ , and let $\delta = \operatorname* { m a x } _ { r \in \mathcal { R } } ( | r | )$ be the maximum arity of the relations in $\mathcal { R }$ . There exists a HypE model with embedding vectors of size at most m $\mathrm { { 1 a x } } ( \delta | \tau | , \delta )$ that assigns 1 to the tuples in $\tau$ and 0 to others.
|
| 235 |
+
|
| 236 |
+
Proof: To prove the theorem, we show an assignment of embedding values for each of the entities and relations in $\tau$ such that the scoring function of HypE is as follows:
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
\phi ( x ) = { \left\{ \begin{array} { l l } { 0 } & { { \mathrm { i f ~ } } x \in \tau } \\ { 1 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
We begin the proof by first describing the embeddings of each of the entities and relations in HypE;
|
| 243 |
+
we then proceed to show that with such an embedding, HypE can represent any world accurately.
|
| 244 |
+
|
| 245 |
+
Let us first assume that $| \tau | > 0$ and let $f _ { p }$ be the $p$ th fact in $\tau$ . We let each entity $e \in { \mathcal { E } }$ be represented with a vector of length $\delta \lvert \tau \rvert$ in which the $p$ th block of $\delta$ -bits is the one-hot representation of $e$ in fact $f _ { p }$ : if $e$ appears in fact $f _ { p }$ at position $i$ , then the ith bit of the $p$ th block is set to 1, and to 0 otherwise. Each relation $r \in \mathcal { R }$ is then represented as a vector of length $\tau$ whose $p$ th bit is equal to 1 if fact $f _ { p }$ is defined on relation $r$ , and 0 otherwise.
|
| 246 |
+
|
| 247 |
+
HypE defines different convolutional weight filters for each entity position within a tuple. As we have at most $\delta$ possible positions, we define each convolutional filter $\omega _ { i }$ as a vector of length $\delta$ where the ith bit is set to 1 and all others to 0, for each $i = 1 , 2 , \dots , \delta$ . When the scoring function $\phi$ is applied to some tuple $x$ , for each entity position $i$ in $x$ , convolution filter $\omega _ { i }$ is applied to the entity at position $i$ in the tuple as a first step; the $\odot ( )$ function is then applied to the resulting vector and the relation embedding to obtain a score.
|
| 248 |
+
|
| 249 |
+
Given any tuple $x$ , we want to show that $\phi ( x ) = 1$ if $x \in \tau$ and 0 otherwise.
|
| 250 |
+
|
| 251 |
+
First assume that $x = f _ { p }$ is the $p$ th fact in $\tau$ that is defined on relation $r$ and entities where $e _ { i }$ is the entity at position $i$ . Convolving each $e _ { i }$ with $\omega _ { i }$ results in a vector of length $| \tau |$ where the $p$ th bit is equal to 1 (since both $\omega _ { i }$ and the $p$ th block of $e _ { i }$ have a 1 at the $i$ th position) (See Figure 4. Then, as a first step, function $\odot ( )$ computes the element-wise multiplication between the embedding of relation $r$ (that has 1 at position $p$ ) and all of the convolved entity vectors (each having 1 at position $p )$ ; this results in a vector of length $| \tau |$ where the $p$ th bit is set to 1 and all other bits set to 0. Finally, $\odot ( ( ) )$ sums the outcome of the resulting products to give us a score of 1.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 4: An example of an embedding where $| \tau | = 5$ , $\delta = 4$ and $f _ { 3 }$ is the third fact in $\tau$
|
| 255 |
+
|
| 256 |
+
To show that $\phi ( x ) = 0$ when $x \notin \tau$ , we prove the contrapositive, namely that if $\phi ( x ) = 1$ , then $x$ must be a fact in $\tau$ . We proceed by contradiction. Assume that there exists a tuple $x \notin \tau$ such that $\phi ( x ) = 1$ . This means that at the time of computing the element-wise product in the $\odot ( )$ function, there was a position $j$ at which all input vectors to $\odot ( )$ had a value of 1. This can happen only when (1) applying the convolution filter $w _ { j }$ to each of the entities in $x$ produces a vector having 1 at position $j$ , and (2) the embedding of relation $r \in x$ has 1 at position $j$ .
|
| 257 |
+
|
| 258 |
+
The first case can happen only if all entities of $x$ appear in the $j$ th fact $f _ { j } \in \tau$ ; the second case happens only if relation $r \in x$ appears in $f _ { j }$ . But if all entities of $x$ as well as its relation appear in fact $f _ { j }$ , then $x \in \tau$ , contradicting our assumption. Therefore, if $\phi ( x ) = 1$ , then $x$ must be a fact in $\tau$ .
|
| 259 |
+
|
| 260 |
+
To complete the proof, we consider the case when $| \tau | = 0$ . In this case, since there are no facts, all entities and relations are represented by zero-vectors of length $\delta$ . Then, for any tuple $x$ , $\phi ( x ) = 0$ . This completes the proof.
|
| 261 |
+
|
| 262 |
+
Theorem 2 (Expressivity of HSimplE) Let $\tau$ be a set of true tuples defined over entities $\mathcal { E }$ and relations $\mathcal { R }$ , and let $\delta = \operatorname* { m a x } _ { r \in { \mathcal { R } } } ( | r | )$ be the maximum arity of the relations in $\mathcal { R }$ . There exists $a$ HSimplE model with embedding vectors of size at most ma $\mathbf { \boldsymbol { x } } ( \delta \vert \tau \vert , \delta )$ that assigns 1 to the tuples in $\tau$ and 0 to others.
|
| 263 |
+
|
| 264 |
+
The proof of Theorem 2 is similar to the proof of Theorem 1, except that instead of applying convolution filters, shifting is applied on entity embeddings. After applying shifting, the same proof by contradiction holds for HSimplE.
|
md/train/x1Lp2bOlVIo/x1Lp2bOlVIo.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Diffusion Normalizing Flow
|
| 2 |
+
|
| 3 |
+
Qinsheng Zhang Georgia Institute of Technology qzhang419@gatech.edu
|
| 4 |
+
|
| 5 |
+
Yongxin Chen Georgia Institute of Technology yongchen@gatech.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We present a novel generative modeling method called diffusion normalizing flow based on stochastic differential equations (SDEs). The algorithm consists of two neural SDEs: a forward SDE that gradually adds noise to the data to transform the data into Gaussian random noise, and a backward SDE that gradually removes the noise to sample from the data distribution. By jointly training the two neural SDEs to minimize a common cost function that quantifies the difference between the two, the backward SDE converges to a diffusion process the starts with a Gaussian distribution and ends with the desired data distribution. Our method is closely related to normalizing flow and diffusion probabilistic models and can be viewed as a combination of the two. Compared with normalizing flow, diffusion normalizing flow is able to learn distributions with sharp boundaries. Compared with diffusion probabilistic models, diffusion normalizing flow requires fewer discretization steps and thus has better sampling efficiency. Our algorithm demonstrates competitive performance in both high-dimension data density estimation and image generation tasks.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Generative model is a class of machine learning models used to estimate data distributions and sometimes generate new samples from the distributions [8, 35, 16, 37, 7]. Many generative models learn the data distributions by transforming a latent variable $\mathbf { z }$ with a tractable prior distribution to the data space [8, 35, 32]. To generate new samples, one can sample from the latent space and then follow the transformation to the data space. There exist a large class of generative models where the latent space and the data space are of the same dimension. The latent variable and the data are coupled through trajectories in the same space. These trajectories serve two purposes: in the forward direction $\mathbf x \to \mathbf z$ , the trajectories infer the posterior distribution in the latent space associated with a given data sample $\mathbf { x }$ , and in the backward direction $\mathbf z \to \mathbf x$ , it generates new samples by simulating the trajectories starting from the latent space. This type of generative model can be roughly divided into two categories, depending on whether these trajectories connecting the latent space and the data space are deterministic or stochastic.
|
| 14 |
+
|
| 15 |
+
When deterministic trajectories are used, these generative models are known as flow-based models. The latent space and the data space are connected through an invertible map, which could either be realized by the composition of multiple invertible maps [35, 8, 20] or a differential equation [4, 14]. In these models, the probability density at each data point can be evaluated explicitly using the change of variable theorem, and thus the training can be carried out by minimizing the negative log-likelihood (NLL) directly. One limitation of the flow-based model is that the invertible map parameterized by neural networks used in it imposes topological constraints on the transformation from z to x. Such limitation affects the performance significantly when the prior distribution on $\mathbf { z }$ is a simple unimodal distribution such as Gaussian while the target data distribution is a well-separated multi-modal distribution, i.e., its support has multiple isolated components. In [6], it is shown that there are some fundamental issues of using well-conditioned invertible functions to approximate such complicated multi-modal data distributions.
|
| 16 |
+
|
| 17 |
+
When stochastic trajectories are used, the generative models are often known as the diffusion model [38]. In a diffusion model, a prespecified stochastic forward process gradually adds noise into the data to transform the data samples into simple random variables. A separate backward process is trained to revert this process to gradually remove the noise from the data to recover the original data distributions. When the forward process is modeled by a stochastic differential equation (SDE), the optimal backward SDE [1] can be retrieved by learning the score function [39, 40, 17, 2]. When the noise is added to the data sufficiently slow in the forward process, the backward diffusion can often revert the forward one reasonably well and is able to generate high fidelity samples. However, this also means that the trajectories have to be sufficiently long with a large number of time-discretization steps, which leads to slow training and sampling. In addition, since the forward process is fixed, the way noise is added is independent of the data distribution. As a consequence, the learned model may miss some complex but important details in the data distribution, as we will explain later.
|
| 18 |
+
|
| 19 |
+
In this work, we present a new generative modeling algorithm that resembles both the flow-based models and the diffusion models. It extends the normalizing flow method by gradually adding noise to the sampling trajectories to make them stochastic. It extends the diffusion model by making the forward process from $\mathbf { x }$ to $\mathbf { z }$ trainable. Our algorithm is thus termed Diffusion Normalizing Flow (DiffFlow). The comparisons and relations among DiffFlow, normalizing flow, and diffusion models are shown in Figure 1. When the noise in DiffFlow shrinks to zero, DiffFlow reduces to a standard normalizing flow. When the forward process is fixed to some specific type of diffusion, DiffFlow reduces to a diffusion model.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: The schematic diagram for normalizing flows, diffusion models, and DiffFlow. In normalizing flow, both the forward and the backward processes are deterministic. They are the inverse of each other and thus collapse into a single process. The diffusion model has a fixed forward process and trainable backward process, both are stochastic. In DiffFlow, both the forward and the backward processes are trainable and stochastic.
|
| 23 |
+
|
| 24 |
+
In DiffFlow, the forward and backward diffusion processes are trained simultaneously by minimizing the distance between the forward and the backward process in terms of the Kullback-Leibler (KL) divergence of the induced probability measures [42]. This cost turns out to be equivalent to (see Section 3 for a derivation) the (amortized) negative evidence lower bound (ELBO) widely used in variational inference [21]. One advantage to use the KL divergence directly is that it can be estimated with no bias using sampled trajectories of the diffusion processes. The KL divergence in the trajectory space also bounds the KL divergence of the marginals, providing an alternative method to bound the likelihood (see Section 3 for details). To summarize, we have made the following contributions.
|
| 25 |
+
|
| 26 |
+
1. We propose a novel density estimation model termed diffusion normalizing flow (DiffFlow) that extends both the flow-based models and the diffusion models. The added stochasticity in DiffFlow boosts the expressive power of the normalizing flow and results in better performance in terms of sampling quality and likelihood. Compared with diffusion models, DiffFlow is able to learn a forward diffusion process to add noise to the data adaptively and more efficiently. This avoids adding noise to regions where noise is not so desirable. The learnable forward process also shortens the trajectory length, making the sampling much faster than standard diffusion models (We observe a 20 times speedup over diffusion models without decreasing sampling quality much).
|
| 27 |
+
|
| 28 |
+
2. We develop a stochastic adjoint algorithm to train the DiffFlow model. This algorithm evaluates the objective function and its gradient sequentially along the trajectory. It avoids storing all the intermediate values in the computational graph, making it possible to train DiffFlow for highdimensional problems.
|
| 29 |
+
|
| 30 |
+
3. We apply the DiffFlow model to several generative modeling tasks with both synthetic and real datasets, and verify the performance of DiffFlow and its advantages over other methods.
|
| 31 |
+
|
| 32 |
+
# 2 Background
|
| 33 |
+
|
| 34 |
+
Below we provide a brief introduction to normalizing flows and diffusion models. In both of these models, we use $\tau = \{ \mathbf { x } ( t ) , 0 \leq t \leq T \}$ to denote trajectories from the data space to the latent space in the continuous-time setting, and $\boldsymbol \tau \doteq \{ \mathbf { x } _ { 0 } , \mathbf { x } _ { 1 } , \cdot \cdot \cdot , \mathbf { x } _ { N } \}$ in the discrete-time setting.
|
| 35 |
+
|
| 36 |
+
Normalizing Flows: The trajectory in normalizing flows is modeled by a differential equation
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\begin{array} { r } { \dot { \mathbf { x } } = \mathbf { f } ( \mathbf { x } , t , \theta ) , } \end{array}
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
parameterized by $\theta$ . This differential equation starts from random ${ \bf x } ( 0 ) = { \bf x }$ and ends at ${ \mathbf x } ( T ) = { \mathbf z }$ Denote by $p ( \mathbf { x } ( t ) )$ the probability distribution of ${ \bf x } ( t )$ , then under mild assumptions, it evolves following [4]
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\frac { \partial \log p ( \mathbf { x } ( t ) ) } { \partial t } = - \mathrm { t r } ( \frac { \partial \mathbf { f } } { \partial \mathbf { x } } ) .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Using this relation (1) (2) one can compute the likelihood of the model at any data point $\mathbf { x }$
|
| 49 |
+
|
| 50 |
+
In the discrete-time setting, the map from $\mathbf { x }$ to $\mathbf { z }$ in normalizing flows is a composition of a collection of bijective functions as $F = F _ { N } \circ F _ { N - 1 } \cdot \cdot \cdot F _ { 2 } \circ F _ { 1 }$ . The trajectory $\boldsymbol \tau = \{ \mathbf { x } _ { 0 } , \mathbf { x } _ { 1 } , \cdot \cdot \cdot , \mathbf { x } _ { N } \}$ satisfies
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathbf { x } _ { i } = F _ { i } ( \mathbf { x } _ { i - 1 } , \theta ) , \quad \mathbf { x } _ { i - 1 } = F _ { i } ^ { - 1 } ( \mathbf { x } _ { i } , \theta )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
for all $i$ . Similar to Equation (2), based on the rule for change of variable, the log-likelihood of any data samples $\mathbf { x } _ { 0 } = \mathbf { x }$ can be evaluated as
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\log p ( \mathbf { x } _ { 0 } ) = \log p ( \mathbf { x } _ { N } ) - \sum _ { i = 1 } ^ { N } \log | \mathbf { d e t } ( \frac { \partial F _ { i } ^ { - 1 } ( \mathbf { x } _ { i } ) } { \partial \mathbf { x } _ { i } } ) | .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Since the exact likelihood is accessible in normalizing flows, these models can be trained by minimizing the negative log-likelihood directly.
|
| 63 |
+
|
| 64 |
+
Diffusion Models: The trajectories in diffusion models are modeled by stochastic differential equations. More explicitly, the forward process is of the form
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r } { d \mathbf { x } = \mathbf { f } ( \mathbf { x } , t ) d t + g ( t ) d \mathbf { w } , } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where the drift term $\textbf { f } : \mathbb { R } ^ { d } \times \mathbb { R } \mathbb { R } ^ { d }$ is a vector-valued function, and the diffusion coefficient $g : \mathbb { R } \mathbb { R }$ is a scalar function (in fact, $g$ is often chosen to be a constant). Here w denotes the standard Brownian motion. The forward process is normally a simple linear diffusion process [38, 16]. The forward trajectory $\tau$ can be sampled using (5) initialized with the data distribution. Denote by $p _ { F }$ the resulting probability distribution over the trajectories. With a slight abuse of notation, we also use $p _ { F }$ to denote the marginal distribution of the forward process.
|
| 71 |
+
|
| 72 |
+
The backward diffusion from ${ \mathbf z } = { \mathbf x } ( T )$ to ${ \bf x } = { \bf x } ( 0 )$ is of the form
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
d \mathbf { x } = [ \mathbf { f } ( \mathbf { x } , t ) - g ^ { 2 } ( t ) \mathbf { s } ( \mathbf { x } , t , \theta ) ] d t + g ( t ) d \mathbf { w } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
It is well-known that when s coincides with the score function $\nabla \log p _ { F }$ , and $\mathbf { x } ( T )$ in the forward and backward processes share the same distribution, the distribution $p _ { B }$ induced by the backward process (6) is equal to $p _ { F }$ [1],[29, Chapter 13]. To train the score network $\mathbf { s } ( \mathbf { x } , t , \theta )$ , one can use the KL divergence between $p _ { F }$ and $p _ { B }$ as an objective function to reduce the difference between $p _ { F }$ and $p _ { B }$ . When the difference is sufficiently small, $p _ { F }$ and $p _ { B }$ should have similar distribution over ${ \bf x } ( 0 )$ , and one can then use the backward diffusion (6) to sample from the data distribution.
|
| 79 |
+
|
| 80 |
+
In the discrete setting, the trajectory distributions can be more explicitly written as
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
p _ { F } ( \tau ) = p _ { F } ( \mathbf { x } _ { 0 } ) \prod _ { i = 1 } ^ { N } p _ { F } ( \mathbf { x } _ { i } | \mathbf { x } _ { i - 1 } ) , \quad p _ { B } ( \tau ) = p _ { B } ( \mathbf { x } _ { T } ) \prod _ { i = 1 } ^ { N } p _ { B } ( \mathbf { x } _ { i - 1 } | \mathbf { x } _ { i } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The KL divergence between $p _ { F }$ and $p _ { B }$ can be decomposed according to this expression (7). Most diffusion models use this decomposition, and meanwhile take advantage of the simple structure of the forward process (5), to evaluate the objective function in training [39, 40, 41].
|
| 87 |
+
|
| 88 |
+
# 3 Diffusion normalizing flow
|
| 89 |
+
|
| 90 |
+
We next present our diffusion normalizing flow models. Similar to diffusion models, the DiffFlow models also has a forward process
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\begin{array} { r } { d \mathbf { x } = \mathbf { f } ( \mathbf { x } , t , \theta ) d t + g ( t ) d \mathbf { w } , } \end{array}
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
and a backward process
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
d \mathbf { x } = [ \mathbf { f } ( \mathbf { x } , t , \theta ) - g ^ { 2 } ( t ) \mathbf { s } ( \mathbf { x } , t , \theta ) ] d t + g ( t ) d \mathbf { w } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
The major difference is that, instead of being a fixed linear function as in most diffusion models, the drift term f is also learnable in DiffFlow. The forward process is initialized with the data samples at $t = 0$ and the backward process is initialized with a given noise distribution at $t = T$ . Our goal is to ensure the distribution of the backward process at time $t = 0$ is close to the real data distribution. That is, we would like the difference between $p _ { B } ( \mathbf { x } ( 0 ) )$ and $p _ { F } ( \mathbf { x } ( 0 ) )$ to be small.
|
| 103 |
+
|
| 104 |
+
To this end, we use the KL divergence between $p _ { B } ( \tau )$ and $p _ { F } ( \tau )$ over the trajectory space as the training objective function. Since
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
K L ( p _ { F } ( \mathbf { x } ( t ) ) | p _ { B } ( \mathbf { x } ( t ) ) ) \leq K L ( p _ { F } ( \tau ) | p _ { B } ( \tau ) )
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
for any $0 \leq t \leq T$ by data processing inequality, small difference between $p _ { B } ( \tau )$ and $p _ { F } ( \tau )$ implies small difference between $\bar { p } _ { B } ( \mathbf { x } ( 0 ) )$ and $p _ { F } ( { \bf \bar { x } } ( 0 ) )$ in terms of KL divergence (more details are included in Appendix B).
|
| 111 |
+
|
| 112 |
+
# 3.1 Implementation
|
| 113 |
+
|
| 114 |
+
In real implementation, we discretize the forward process (8) and the backward process (9) as
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r c l } { \mathbf { x } _ { i + 1 } } & { = } & { \mathbf { x } _ { i } + \mathbf { f } _ { i } ( \mathbf { x } _ { i } ) \Delta t _ { i } + g _ { i } \delta _ { i } ^ { F } \sqrt { \Delta t _ { i } } } \\ { \mathbf { x } _ { i } } & { = } & { \mathbf { x } _ { i + 1 } - [ \mathbf { f } _ { i + 1 } ( \mathbf { x } _ { i + 1 } ) - g _ { i + 1 } ^ { 2 } \mathbf { s } _ { i + 1 } ( \mathbf { x } _ { i + 1 } ) ] \Delta t _ { i } + g _ { i + 1 } \delta _ { i } ^ { B } \sqrt { \Delta t _ { i } } , } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $\delta _ { i } ^ { F } , \delta _ { i } ^ { B } \sim \mathcal { N } ( 0 , \mathbf { I } )$ are unit Gaussian noise, $\{ t _ { i } \} _ { i = 0 } ^ { N }$ are the discretization time points, and $\Delta t _ { i } = t _ { i + 1 } - t _ { i }$ is the step size at the $i$ -th step. Here we have dropped the dependence on the parameter $\theta$ to simplify the notation. With this discretization, the KL divergence between trajectory distributions becomes
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\small \mathrm { K } L ( p _ { F } ( \tau ) | p _ { B } ( \tau ) ) = \underbrace { \mathbb { E } _ { \tau \sim p _ { F } } [ \log p _ { F } ( \mathbf { x } _ { 0 } ) ] } _ { L _ { 0 } } + \underbrace { \mathbb { E } _ { \tau \sim p _ { F } } [ - \log p _ { B } ( \mathbf { x } _ { N } ) ] } _ { L _ { N } } + \underbrace { \sum _ { i = 1 } ^ { N - 1 } \mathbb { E } _ { \tau \sim p _ { F } } [ \log \frac { p _ { F } ( \mathbf { x } _ { i } | \mathbf { x } _ { i - 1 } ) } { p _ { B } ( \mathbf { x } _ { i - 1 } | \mathbf { x } _ { i } ) } ] } _ { L _ { i } } .
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
The term $L _ { 0 }$ in (13) is a constant determined by entropy of the dataset as
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\underset { \tau \sim p _ { F } } { \mathbb { E } } [ \log p _ { F } ( \mathbf { x } _ { 0 } ) ] = \underset { \mathbf { x } _ { 0 } \sim p _ { F } } { \mathbb { E } } [ \log p _ { F } ( \mathbf { x } _ { 0 } ) ] = : - H ( p _ { F } ( x ( 0 ) ) ) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
The term $L _ { N }$ is easy to calculate since $p _ { B } ( x _ { N } )$ is a simple distribution, typically standard Gaussian distribution.
|
| 133 |
+
|
| 134 |
+
To evaluate $L _ { 1 : N - 1 }$ , we estimate it over sampled trajectory from the forward process $p _ { F }$ . For a given trajectory $\tau$ sampled from $p _ { F } ( \tau )$ , we need to calculate $p _ { B } ( \tau )$ along the same trajectory. To this end, a specific group of $\{ \delta _ { i } ^ { B } \}$ is chosen such that the same trajectory can be reconstructed from the backward process. Thus, $\delta _ { i } ^ { B }$ satisfies
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\delta _ { i } ^ { B } ( \tau ) = \frac { 1 } { g _ { i + 1 } \sqrt { \Delta t } } \Bigg [ \mathbf { x } _ { i } - \mathbf { x } _ { i + 1 } + [ \mathbf { f } _ { i + 1 } ( \mathbf { x } _ { i + 1 } ) - g _ { i + 1 } ^ { 2 } \mathbf { s } _ { i + 1 } ( \mathbf { x } _ { i + 1 } ) ] \Delta t \Bigg ] .
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Since $\delta _ { i } ^ { B }$ is a Gaussian noise, the negative log-likelihood term $p _ { B } \big ( \mathbf { x } _ { i } \big | \mathbf { x } _ { i + 1 } \big )$ is equal to $\textstyle \frac { 1 } { 2 } ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 }$ after dropping constants (see more details in Appendix B). In view of the fact that the expectation of $\begin{array} { r } { \sum _ { i } \frac { 1 } { 2 } \bar { ( \delta _ { i } ^ { F } ( \tau ) ) } ^ { 2 } } \end{array}$ remains a constant, minimizing Equation (13) is equivalent to minimizing the following loss (see Appendix $\textrm { C }$ for the full derivation):
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
L : = \mathbb { E } _ { \tau \sim p _ { F } } [ - \log p _ { B } ( \mathbf { x } _ { N } ) + \sum _ { i } \frac { 1 } { 2 } ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } ] = \mathbb { E } _ { \delta ^ { F } ; \mathbf { x } _ { 0 } \sim p _ { 0 } } [ - \log p _ { B } ( \mathbf { x } _ { N } ) + \sum _ { i } \frac { 1 } { 2 } ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } ] ,
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where the last equality is based on a reparameterization trick [21]. We can minimize the loss in Equation (15) with Monto Carlo gradient estimation as in Algorithm 1.
|
| 147 |
+
|
| 148 |
+
# Algorithm 1 Training
|
| 149 |
+
|
| 150 |
+
<table><tr><td>repeat</td></tr><tr><td>Xq ~ Real data distribution EN~N(0,I)</td></tr><tr><td></td></tr><tr><td>Sample: T = {xi}o based on :N</td></tr><tr><td>Gradient descent step Vθ[-log pB(xN) +∑i 1(δB(τ))²]</td></tr><tr><td>until converged</td></tr></table>
|
| 151 |
+
|
| 152 |
+
# Algorithm 2 Stochastic Adjoint Algorithm for DiffFlow
|
| 153 |
+
|
| 154 |
+
1: Input: Forward trajectory $\{ \mathbf { x } _ { i } \} _ { i = 0 } ^ { N }$
|
| 155 |
+
2: $\begin{array} { r } { \frac { \partial L } { \partial \mathbf { x } _ { N } } = \frac { 1 } { 2 } \frac { \partial ( \delta _ { N } ^ { B } ( \tau ) ) ^ { 2 } } { \partial \mathbf { x } _ { N } } - \frac { \partial \log p _ { B } ( \mathbf { x } _ { N } ) } { \mathbf { x } _ { N } } } \end{array}$
|
| 156 |
+
3: $\begin{array} { r } { \frac { \partial L } { \partial \theta } = 0 } \end{array}$
|
| 157 |
+
4: for $i = N , N - 1 , \cdots , 1 \mathbf { d } \mathbf { c }$
|
| 158 |
+
5: $\begin{array} { r } { \frac { \partial L } { \partial \mathbf { x } _ { i - 1 } } = \bigl ( \frac { \partial L } { \partial \mathbf { x } _ { i } } + \frac { 1 } { 2 } \frac { \partial ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } } { \partial \mathbf { x } _ { i } } \bigr ) \frac { \partial \mathbf { x } _ { i } } { \partial \mathbf { x } _ { i - 1 } } + \frac { 1 } { 2 } \frac { \partial ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } } { \partial \mathbf { x } _ { i - 1 } } } \end{array}$
|
| 159 |
+
6: $\begin{array} { r } { \frac { \partial L } { \partial \theta } + = \frac { 1 } { 2 } \frac { \partial ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } } { \partial \theta } + \big ( \frac { \partial L } { \partial \mathbf { x } _ { i } } + \frac { 1 } { 2 } \frac { \partial ( \delta _ { i } ^ { B } ( \tau ) ) ^ { 2 } } { \partial \mathbf { x } _ { i } } \big ) \frac { \partial \mathbf { x } _ { i } } { \partial \theta } } \end{array}$
|
| 160 |
+
7: end for
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 2: Gradient Flowchart.
|
| 164 |
+
|
| 165 |
+
# 3.2 Stochastic Adjoint method
|
| 166 |
+
|
| 167 |
+
One challenge in training DiffFlow is memory consumption. When a naive backpropagation strategy is used, the memory consumption explodes quickly. Indeed, differentiating through the operations of the forward pass requires unrolling networks $N$ times and caching all network intermediate values for every step, which prevents this naive implementation of DiffFlow from being applied in high dimensional applications. Inspired by the adjoint method in Neural ODE [4], we propose the adjoint variable $\frac { \partial L } { \partial \mathbf { x } _ { i } }$ and a stochastic adjoint algorithm that allows training the DiffFlow model with reduced memory consumption. In this adjoint method, we cache intermediate states $\mathbf { x } _ { i }$ and, based on these intermediate states, reproduce the whole process, including $\delta _ { i } ^ { F } , \delta _ { i } ^ { B }$ as well as $f _ { i } , s _ { i }$ exactly.
|
| 168 |
+
|
| 169 |
+
We note another similar approach [26] of training SDEs caches random noise dw and further takes advantage of the pseudo-random generator to save memory for the intermediate noises, resulting in constant memory consumption However, the approach can not reproduce exact trajectories due to time discretization error and requires extra computation to recover $d \mathbf { w }$ from the pseudo-random generator. We found that in our image experiments in Section 4, the cached $\left\{ { { \bf { x } } _ { i } } \right\}$ consumes only about $\bar { 2 } \%$ memory out of all the memory being used during training. Due to the accuracy and acceptable memory overhead, the introduced stochastic adjoint approach is a better choice for DiffFlow. We summarize the method in Algorithm 2 and Figure 2. We also include the PyTorch [34] implementation in the supplemental material.
|
| 170 |
+
|
| 171 |
+
# 3.3 Time discretization and progressive training
|
| 172 |
+
|
| 173 |
+
We propose two time discretization schemes for training DiffFlow: fixed timestamps $L _ { \beta }$ and flexible timestamps $\hat { L } _ { \beta }$ . For fixed timestamps, the time interval $[ 0 , T ]$ is discretized with fixed schedule $\begin{array} { r } { t _ { i } = ( \frac { i } { N } ) ^ { \beta } T } \end{array}$ . With such fixed time discretization over batches, we denote the loss function as $L _ { \beta }$ . Empirically, we found $\beta = 0 . 9$ works well. This choice of $\beta$ increases stepsize $\Delta t _ { i }$ when the forward process approaches $\mathbf { z } = \mathbf { x } _ { N }$ and provides higher resolution when the backward process is close to $\mathbf { x } _ { \mathrm { 0 } }$ . We found such discretization generates samples with good quality and high fidelity details. The choice of polynomial function is arbitrary; other functions of similar sharps may work as well.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: $\Delta t _ { i }$ of $L _ { \beta }$ and $\hat { L } _ { \beta }$
|
| 177 |
+
|
| 178 |
+
In the flexiable timestamps scheme, we train different batches with different time discretization points. Specifically, $t _ { i }$ is sampled uniformly from the interval $\begin{array} { r } { \big [ \big ( \frac { i - 1 } { N - 1 } \big ) ^ { \beta } T , ( \frac { i } { N - 1 } ) ^ { \beta } T \big ] } \end{array}$ for each batch. We denote the training objective function with such random time discretization as $\hat { L } _ { \beta }$ . We empirically found such implementation results in lower loss and better stability when we conduct progressive training where we increase $N$ gradually as training progresses. In progressive training, we refine the forward and backward processes as $N$ increase. This training scheme can significantly save training time compared with the other method that uses a fixed large $N$ during the whole process. Empirically, we found that progressive training can speed up the training up to 16 times.
|
| 179 |
+
|
| 180 |
+
To understand why such random time discretization scheme is more stable, we hypothesis that this choice encourages a smoother f , s since it seeks functions f , s to reduce objective loss under different sets of $\{ t _ { i } \}$ instead of a specific $\{ t _ { i } \}$ . We illustrate fixed timestamps in $L _ { \beta }$ and a realization of random discretization in $\hat { L } _ { \beta }$ in Figure 3 with $\beta = 0 . 9$ .
|
| 181 |
+
|
| 182 |
+
# 3.4 Learnable forward process
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Illustration of forwarding trajectories of DiffFlow, DDPM, and FFJORD. Each row shows two trajectories of transforming data distributions, four rings, and Olympics rings, to a base distribution. Different modes of densities are in different colors. Though FFJORD adjusts forward process based on data, its bijective property prevents the approach from expanding density support to the whole space. DDPM can transform data distributions into Gaussian distribution but a datainvariant way of adding noise can corrupt the details of densities, e.g., the densities at the intersections of the rings. DiffFlow not only transforms data into base distribution but also keeps the topological information of the original datasets. Points from the same ring are transformed into continental plates instead of being distributed randomly.
|
| 186 |
+
|
| 187 |
+
The forward process not only is responsible for driving data into latent space, but also provides enough supervised information to learning backward process. Thanks to bijective property, NFs can reconstruct data exactly but there is no guarantee that it can reach the standard Gaussian. At the other extreme, Denoising diffusion probabilistic models (DDPM) [17] adopt a data-invariant forward diffusing schema, ensuring that $\mathbf { x } _ { N }$ is Gaussian. DDPM can even reach Gaussian in one step with $N = 1$ , which output noise disregarding data samples. However, backward process will be difficult to learn if data is destroyed in one step. Therefore, DDPM adds noise slowly and often needs more than one thousand steps for diffusion.
|
| 188 |
+
|
| 189 |
+
The forward module of DiffFlow is a combination of normalizing flow and diffusion models. We show the comparision in fitting toy 2D datasets in Figure 4. We are especially interested in data with well-separated modes and sharp density boundaries. Those properties are believed to appear in various datasets. As stated by manifold hypothesis [36], real-world data lie on low-dimensional manifold [28] embedded in a high-dimensional space. To construct the distributions in Figure 4, we rotate the 1-d Gaussian distribution $\mathcal { N } ( 1 , 0 . 0 0 1 ^ { 2 } )$ around the center to form a ring and copy the rings to different locations.
|
| 190 |
+
|
| 191 |
+
As a bijective model, FFJORD [14] struggles to diffuse the concentrated density mass into a Gaussian distribution. DiffFlow overcomes expressivity limitations of the bijective constraint by adding noise. As added noise shrinks to zero, the DiffFlow has no stochasticity and degrades to a flow-based model. Based on this fact, we present the following theorem with proof in Appendix A.
|
| 192 |
+
|
| 193 |
+
Theorem 1. As diffusion coefficients $g _ { i } \to 0$ , DiffFlow reduces to Normalizing Flow. Moreover, minimizing the objective function in Equation (13) is equivalent to minimizing the negative loglikelihood as in Equation (4).
|
| 194 |
+
|
| 195 |
+
DDPM [17] uses a fixed noising transformation. Due to the data-invariant approach $p ( \mathbf { x } _ { T } | \mathbf { x } _ { 0 } ) =$ $p ( \mathbf { x } _ { T } )$ , points are diffused in the same way even though they may appear in different modes or different datasets. We observe that sharp details are destroyed quickly in DDPM diffusion, such as the intersection regions between rings. However, with the help of learnable transformation, DiffFlow diffuses in a much efficient way. The data-dependent approach shows different diffusion strategies on different modes and different datasets. Meanwhile, similar to NFs, it keeps some topological information for learning backward processes. We include more details about the toy sample in Section 4.
|
| 196 |
+
|
| 197 |
+
# 4 Experiments
|
| 198 |
+
|
| 199 |
+
We evaluate the performance of DiffFlow in sample quality and likelihood on test data. To evaluate the likelihood, we adopt the marginals distribution equivalent SDEs
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
d \mathbf { x } = [ \mathbf { f } ( \mathbf { x } , t , \theta ) - \frac { 1 + \lambda ^ { 2 } } { 2 } g ^ { 2 } ( t ) \mathbf { s } ( \mathbf { x } , t , \theta ) ] d t + \lambda g ( t ) d \mathbf { w } ,
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
with $\lambda \geq 0$ (Proof see Appendix $\mathrm { H }$ ). When $\lambda = 0$ , it reduces to probability ODE [41]. The ODE provides an efficient way to evaluate the density and negative log-likelihood. For any $0 \leq \lambda \leq 1$ , the above SDE can be used for sampling. Empirically, we found $\lambda = 1$ has the best performance.
|
| 206 |
+
|
| 207 |
+
# 4.1 Synthetic 2D examples
|
| 208 |
+
|
| 209 |
+
We compare the performance of DiffFlow and existing diffusion models and NFs on estimating the density of 2-dimensional data. We compare the forward trajectories of DiffFlow, DDPM [17] and FFJORD $[ 1 4 ] ^ { 1 }$ in Figure 4 and its sampling performance in Figure 5. To make a fair comparison, we build models with comparable network sizes, around 90k learnable parameters. We include more training and model details in Appendix E.
|
| 210 |
+
|
| 211 |
+
All three algorithms have good performance on datasets whose underlying distribution has smooth density, such as 2 spirals. However, when we shrink the support of samples or add complex patterns, performance varies significantly. We observe that FFJORD leaks many samples out of the main modes and datasets with complex details and sharp density exacerbates the disadvantage.
|
| 212 |
+
|
| 213 |
+
DDPM has higher sample quality but blurs density details, such as intersections between rings, areas around leaves of the Fractal tree, and boxes in Sierpinski Carpet. The performance is within ´ expectation given that details are easy to be destroyed and ignored with the data-invariant noising schema. On the less sharp dataset, such as 2 Spirals and Checkerboard, its samples align with data almost perfectly.
|
| 214 |
+
|
| 215 |
+
DiffFlow produces the best samples (according to a human observer). We owe the performance to the flexible noising forward process. As illustrated in Figure 4, DiffFlow provides more clues and retains detailed patterns longer for learning its reverse process. We also report a comprehensive comparison of the negative likelihood and more analysis in Appendix E. DiffFlow has a much lower negative likelihood, especially on sharp datasets.
|
| 216 |
+
|
| 217 |
+
# 4.2 Density estimation on real data
|
| 218 |
+
|
| 219 |
+
We perform density estimation experiments on five tabular datasets [33]. We employ the probability flow to evaluate the negative log-likelihood. We find that our algorithm has better performance in most datasets than most approaches trained by directly minimizing negative log-likelihood, including NFs and autoregressive models. DiffFlow outperforms FFJORD by a wide margin on all datasets except HEPMASS. Compared with autoregressive models, it excels NAF [18] on all but GAS. Those models require $\mathcal O ( d )$ computations to sample from. Meanwhile, DiffFlow is quite effective in achieving such performance with MLPs that have less than 5 layers. We include more details in Appendix F
|
| 220 |
+
|
| 221 |
+
# 4.3 Image generation
|
| 222 |
+
|
| 223 |
+
In this section, we report the quantitative comparison and qualitative performance of our method and existing methods on common image datasets, MNIST [24] and CIFAR-10 [23]. We use the same unconstrained U-net style model as used successfully by Ho et al. [17] for drift and score network. We reduce the network size to half of the original DDPM network so that the total number of trainable parameters of DiffFlow and DDPM are comparable. We use small $N = 1 0$ at the beginning of training and slowly increase to large $N$ as training proceeds. The schedule of $N$ reduces the training time greatly compared with using large $N$ all the time. We use constants $g _ { i } = 1$ and $T = 0 . 0 5$ for MNIST and CIFAR10, and $N = 3 0$ for sampling MNIST data and $N = 1 0 0$ for sampling CIFAR10. As it is reported by Jolicoeur-Martineau et al. [19], adding noise at the last step will significantly lower sampling quality, we use one single denoising step at the end of sampling with Tweedie’s formula [10].
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 5: Samples from DiffFlow, DDPM and FFJORD on 2-D datasets. All three models have reasonable performance on datasets that have smooth underlying distributions. But only DiffFlow is capable to capture complex patterns and provides sharp samples when dealing with more challenging datasets.
|
| 227 |
+
|
| 228 |
+
<table><tr><td>Dataset</td><td>POWER</td><td>GAS</td><td>HEPMASS</td><td>MINIBOONE</td><td>BSDS300</td></tr><tr><td>RealNVP [8]</td><td>-0.17</td><td>-8.33</td><td>18.71</td><td>13.55</td><td>-153.28</td></tr><tr><td>FFJORD[14]</td><td>-0.46</td><td>-8.59</td><td>14.92</td><td>10.43</td><td>-157.40</td></tr><tr><td>DiffFlow (ODE)</td><td>-1.04</td><td>-10.45</td><td>15.04</td><td>8.06</td><td>-157.80</td></tr><tr><td>MADE [11]</td><td>3.08</td><td>-3.56</td><td>20.98</td><td>15.59</td><td>-148.85</td></tr><tr><td>MAF [33]</td><td>-0.24</td><td>-10.08</td><td>17.70</td><td>11.75</td><td>-155.69</td></tr><tr><td>TAN [31]</td><td>-0.48</td><td>-11.19</td><td>15.12</td><td>11.01</td><td>-157.03</td></tr><tr><td>NAF[18]</td><td>-0.62</td><td>-11.96</td><td>15.09</td><td>8.86</td><td>-157.73</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 1: Average negative log-likelihood (in nats) on tabular datasets [33] for density estimation (lower is better).
|
| 231 |
+
|
| 232 |
+
We report negative log-likelihood (NLL) in bits per dimension or negative ELBO if NLL is unavailable. On MNIST, we achieve competitive performance on NLL as in Table 2. We show the uncurated samples from DiffFlow in Figure 6 and Figure 7. On CIFAR-10, DiffFlow also achieves competitive NLL performance as shown in Table 3. DiffFlow performs better than normalizing flows and DDPM models, but is slightly worse than $\mathrm { { D D P M + + } }$ (sub, deep, sub-vp) and Improved DDPM. However, these approaches conduct multiple architectural improvements and use much deeper and wider networks. We also report the popular sample metric, Fenchel Inception Distance (FID) [15]. DiffFLow has a lower FID score than normalizing flows and has competitive performance compared with DDPM trained with unweighted variational bounds, DDPM and Improved DDPM. It is worse than DDPM trained with reweighted loss, DDPM $( L _ { s } )$ , DDPM cont, and DDPM $^ { + + }$ [17, 41, 30]. Besides, sampling quality with different sampling steps $N$ are compared in Table $4 ^ { 2 }$ . The advantage of DiffFlow is clear when we compare relative FIDs degeneracy ratio with $N = 1 0 0$ respectively. DiffFlow is able to retain better sampling quality when decreasing $N$ . Full details on architectures used, training setup details, and more samples can be found in Appendix G.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
Figure 6: MNIST Samples
|
| 236 |
+
|
| 237 |
+
Table 2: NLL on MNIST
|
| 238 |
+
|
| 239 |
+
<table><tr><td>Model</td><td>NLL (↓)</td></tr><tr><td>RealNVP [8]</td><td>1.06</td></tr><tr><td>Glow [20]</td><td>1.05</td></tr><tr><td>FFJORD[14]</td><td>0.99</td></tr><tr><td>ResFlow [5]</td><td>0.97</td></tr><tr><td>DiffFlow</td><td>0.93</td></tr></table>
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure 7: CIFAR10 Samples
|
| 243 |
+
|
| 244 |
+
Table 3: NLLs and FIDs on CIFAR-10.
|
| 245 |
+
|
| 246 |
+
<table><tr><td>Model</td><td>NLL(↓)</td><td>FID (↓</td></tr><tr><td>RealNVP[8]</td><td>3.49</td><td rowspan="4">46.90</td></tr><tr><td>Glow [20]</td><td>3.35</td></tr><tr><td>Flow++[16]</td><td>3.29 =</td></tr><tr><td>FFJORD [14]</td><td>3.40 1</td></tr><tr><td>ResFlow[5]</td><td>3.28</td><td rowspan="9">46.37 13.51 3.17</td></tr><tr><td>DDPM(L)[17]</td><td>≤3.70</td></tr><tr><td>DDPM(Ls)[17]</td><td>≤3.75</td></tr><tr><td>DDPM(Ls)(ODE) [41]</td><td>3.28 3.37 3.56</td></tr><tr><td>DDPM cont. (sub-VP) [41]</td><td>3.05</td></tr><tr><td>DDPM++ (sub-VP) [41]</td><td>3.02 3.16 2.99</td></tr><tr><td>DDPM++ (deep,sub-VP)[41]</td><td>2.94</td></tr><tr><td>Improved DDPM [30] ≤2.94</td><td>11.47</td></tr><tr><td>≤3.71</td><td>13.87</td></tr><tr><td>DiffFlow (L β) DiffFlow (L β)</td><td></td><td>13.43</td></tr><tr><td></td><td>≤3.67</td><td></td></tr><tr><td>DiffFlow (L β, ODE)</td><td>3.04</td><td>14.14</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 4: FIDs with various $N$
|
| 249 |
+
|
| 250 |
+
<table><tr><td>N DiffFlowDDPM(L)DDPM(Ls) DDIM</td><td colspan="2"></td></tr><tr><td>5 28.31</td><td>373.51</td><td>370.23 44.69</td></tr><tr><td>10 22.56</td><td>364.64</td><td>365.12 18.62</td></tr><tr><td>20 17.98</td><td>138.84 135.44</td><td>10.89</td></tr><tr><td>50 14.72</td><td>47.12</td><td>34.56 7.01</td></tr><tr><td>100 13.43</td><td>22.23</td><td>10.04 5.63</td></tr></table>
|
| 251 |
+
|
| 252 |
+
Table 5: Relative FIDs degeneracy ratio
|
| 253 |
+
|
| 254 |
+
<table><tr><td colspan="2">N DiffFlowDDPM(L) DDPM(Ls)DDIM</td></tr><tr><td>5 2.12 16.80</td><td>37.02 7.94</td></tr><tr><td>10 1.68 16.40</td><td>36.12 3.31</td></tr><tr><td>20 1.34 6.24</td><td>13.54 1.93</td></tr><tr><td>50 1.10 2.12</td><td>3.45 1.24</td></tr><tr><td>100 1.0 1.0</td><td>1.0 1.0</td></tr></table>
|
| 255 |
+
|
| 256 |
+
# 5 Related work
|
| 257 |
+
|
| 258 |
+
Normalizing flows [8, 35] have recently received lots of attention due to its exact density evaluation and ability to model high dimensional data [20, 9]. However, the bijective requirement poses limitations on modeling complex data, both empirically and theoretically [42, 6]. Some works attempt to relax the bijective requirement; discretely index flows [9] use domain partitioning with only locally invertible functions. Continuously indexed flows [6] extend discretely indexing to a continuously indexing approach. As pointed out in Stochastic Normalizing Flows (SNF) [42], stochasticity can effectively improve the expressive power of the flow-based model in low dimension applications. The architecture used in SNF, which requires known underlying energy models, presents challenges for density learning tasks; SNF is designed for sampling from unnormalized probability distribution instead of density estimation. Besides, even with ideal networks and infinite amount of data, due to the predefined stochstic block being used, SNF cannot find models with aligned forward and backward distribution as DiffFlow.
|
| 259 |
+
|
| 260 |
+
When it comes to stochastic trajectories, minimizing the distance between trajectory distributions has been explored in existing works. Denoising diffusion model [38] uses a fixed linear forward diffusion schema and reparameterizes the KL divergence such that minimizing loss is possible without computing whole trajectories. Diffusion models essentially corrupt real data iteratively and learn to remove the noise when sampling. Recently, Diffusion models have shown the capability to model high-dimensional data distribution, such as images [17, 40], shapes [3], text-to-speech [22]. Lately, the Score-based model [41] provides a unified framework for score-matching methods and diffusion models based on stochastic calculus. The diffusion processes and sampling processes can be viewed as forwarding SDE and reverse-time SDE. Thanks to the linear forward SDE being used in DDPM, the forward marginal distributions have a closed-form and are suitable for training score functions on large-scale datasets. Also, due to the reliance on fixed linear forward process, it takes thousands of steps to diffuse data and generate samples. DiffFlow considers general SDEs and nosing and sampling are more efficient.
|
| 261 |
+
|
| 262 |
+
Existing Neural SDE approaches suffer from poor scaling properties. Backpropagating through solver [12] has a linear memory complexity with the number of steps. The pathwise approach [13] scales poorly in computation complexity. Our stochastic adjoint approach shares a similar spirit with SDE adjoint sensitivity [25]. The choice of caching noise requires high resolution of time discretization and prevents the approach from scaling to high dimension applications. By caching the trajectory states, DiffFlow can use a coarser discretization and deploy on larger dimension problems and problems with more challenging densities. The additional memory footprint is negligible compared with the other network memory consumption in DiffFlow.
|
| 263 |
+
|
| 264 |
+
# 6 Limitations
|
| 265 |
+
|
| 266 |
+
While DiffFlow gains more flexibility due to the introduction of a learnable forward process, it loses the analytical form for $p _ { F } ( \mathbf { x } _ { t } | \mathbf { x } _ { 0 } )$ and thus the training less efficient compared with score-based loss [41]. Training DiffFlow relies on backpropagation through trajectories and is thus significantly slower than diffusion models with affine drift. Empirically, we found DiffFlow is about 6 times slower than DDPM in 2d toy examples, 55 times in MNIST, and 160 times in CIFAR10 without progressive training in Section 3.3. Though the stochastic adjoint method and progressive training help save memory footprint and reduce training time, the training of DiffFlow is still more expensive than DDPM and its variants. On the other hand, compared with normalizing flows, the extra noise in DiffFlow boosts the expressive power of the model with little extra cost. Though DiffFlow trained based on SDE, its marginal distribution equivalent ODE 2 shows much better performance than its counterpart trained with ODE [14]. It is interesting to investigate, both empirically and theoretically, the benefit in terms of expressiveness improvement caused by stochastic noise for training normalizing flows.
|
| 267 |
+
|
| 268 |
+
# 7 Conclusions
|
| 269 |
+
|
| 270 |
+
We proposed a novel algorithm, the diffusion normalizing flow (DiffFlow), for generative modeling and density estimation. The proposed method extends both the normalizing flow models and the diffusion models. Our DiffFlow algorithm has two trainable diffusion processes modeled by neural SDEs, one forward and one backward. These two SDEs are trained jointly by minimizing the KL divergence between them. Compared with most normalizing flow models, the added noise in DiffFlow relaxes the bijectivity condition in deterministic flow-based models and improves their expressive power. Compared with diffusion models, DiffFlow learns a more flexible forward diffusion that is able to transform data into noise more effectively and adaptively. In our experiments, we observed that DiffFlow is able to model distributions with complex details that are not captured by representative normalizing flow models and diffusion models, including FFJORD, DDPM. For CIFAR10 dataset, our DiffFlow method has worse performance than DDPM in terms of FID score. We believe our DiffFlow algorithm can be improved further by using different neural network architectures, different time discretizing method and different choices of time interval. We plan to explore these options in the near future.
|
| 271 |
+
|
| 272 |
+
Our algorithm is able to learn the distribution of high-dimensional data and then generate new samples from it. Like many other generative modeling algorithms, it may be potentially used to generate misleading data such as fake images or videos.
|
| 273 |
+
|
| 274 |
+
# Acknowledgements
|
| 275 |
+
|
| 276 |
+
The authors would like to thank the anonymous reviewers for useful comments. This work is supported in part by grants NSF CAREER ECCS-1942523 and NSF CCF-2008513.
|
| 277 |
+
|
| 278 |
+
# References
|
| 279 |
+
|
| 280 |
+
[1] Anderson, B. D. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12 (3):313–326, 1982.
|
| 281 |
+
[2] Bordes, F., Honari, S., and Vincent, P. Learning to generate samples from noise through infusion training. arXiv preprint arXiv:1703.06975, 2017.
|
| 282 |
+
[3] Cai, R., Yang, G., Averbuch-Elor, H., Hao, Z., Belongie, S., Snavely, N., and Hariharan, B. Learning gradient fields for shape generation. In Proceedings of the European Conference on Computer Vision (ECCV), 2020.
|
| 283 |
+
[4] Chen, R. T., Rubanova, Y., Bettencourt, J., and Duvenaud, D. Neural ordinary differential equations. arXiv preprint arXiv:1806.07366, 2018.
|
| 284 |
+
[5] Chen, R. T. Q., Behrmann, J., Duvenaud, D., and Jacobsen, J. Residual flows for invertible generative modeling. In Advances in Neural Information Processing Systems, 2019.
|
| 285 |
+
[6] Cornish, R., Caterini, A., Deligiannidis, G., and Doucet, A. Relaxing bijectivity constraints with continuously indexed normalising flows. In International Conference on Machine Learning, pp. 2133–2143. PMLR, 2020.
|
| 286 |
+
[7] Deng, Y., Bakhtin, A., Ott, M., Szlam, A., and Ranzato, M. Residual energy-based models for text generation. arXiv preprint arXiv:2004.11714, 2020.
|
| 287 |
+
[8] Dinh, L., Sohl-Dickstein, J., and Bengio, S. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
|
| 288 |
+
[9] Dinh, L., Sohl-Dickstein, J., Larochelle, H., and Pascanu, R. A rad approach to deep mixture models. arXiv preprint arXiv:1903.07714, 2019.
|
| 289 |
+
[10] Efron, B. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496): 1602–1614, 2011.
|
| 290 |
+
[11] Germain, M., Gregor, K., Murray, I., and Larochelle, H. Made: Masked autoencoder for distribution estimation. In International Conference on Machine Learning, pp. 881–889. PMLR, 2015.
|
| 291 |
+
[12] Giles, M. and Glasserman, P. Smoking adjoints: Fast monte carlo greeks. Risk, 19(1):88–92, 2006.
|
| 292 |
+
[13] Gobet, E. and Munos, R. Sensitivity analysis using itô–malliavin calculus and martingales, and application to stochastic optimal control. SIAM Journal on control and optimization, 43(5):1676–1713, 2005.
|
| 293 |
+
[14] Grathwohl, W., Chen, R. T., Bettencourt, J., Sutskever, I., and Duvenaud, D. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018.
|
| 294 |
+
[15] Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
|
| 295 |
+
[16] Ho, J., Chen, X., Srinivas, A., Duan, Y., and Abbeel, P. Flow $+ +$ : Improving flow-based generative models with variational dequantization and architecture design. In International Conference on Machine Learning, pp. 2722–2730. PMLR, 2019.
|
| 296 |
+
[17] Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. arXiv preprint arXiv:2006.11239, 2020.
|
| 297 |
+
[18] Huang, C.-W., Krueger, D., Lacoste, A., and Courville, A. Neural autoregressive flows. In International Conference on Machine Learning, pp. 2078–2087. PMLR, 2018.
|
| 298 |
+
[19] Jolicoeur-Martineau, A., Piché-Taillefer, R., Combes, R. T. d., and Mitliagkas, I. Adversarial score matching and improved sampling for image generation. arXiv preprint arXiv:2009.05475, 2020.
|
| 299 |
+
[20] Kingma, D. P. and Dhariwal, P. Glow: Generative flow with invertible 1x1 convolutions. arXiv preprint arXiv:1807.03039, 2018.
|
| 300 |
+
[21] Kingma, D. P. and Welling, M. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 301 |
+
[22] Kong, Z., Ping, W., Huang, J., Zhao, K., and Catanzaro, B. Diffwave: A versatile diffusion model for audio synthesis. arXiv preprint arXiv:2009.09761, 2020.
|
| 302 |
+
[23] Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009.
|
| 303 |
+
[24] LeCun, Y. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 304 |
+
[25] Li, X., Wong, T.-K. L., Chen, R. T., and Duvenaud, D. Scalable gradients for stochastic differential equations. In International Conference on Artificial Intelligence and Statistics, pp. 3870–3882. PMLR, 2020.
|
| 305 |
+
[26] Li, X., Wong, T.-K. L., Chen, R. T., and Duvenaud, D. Scalable gradients for stochastic differential equations. In International Conference on Artificial Intelligence and Statistics, pp. 3870–3882. PMLR, 2020.
|
| 306 |
+
[27] Meng, C., Song, J., Song, Y., Zhao, S., and Ermon, S. Improved autoregressive modeling with distribution smoothing. arXiv preprint arXiv:2103.15089, 2021.
|
| 307 |
+
[28] Narayanan, H. and Mitter, S. Sample complexity of testing the manifold hypothesis. In Proceedings of the 23rd International Conference on Neural Information Processing Systems-Volume 2, pp. 1786–1794, 2010.
|
| 308 |
+
[29] Nelson, E. Dynamical theories of Brownian motion. Princeton university press, 2020.
|
| 309 |
+
[30] Nichol, A. and Dhariwal, P. Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672, 2021.
|
| 310 |
+
[31] Oliva, J., Dubey, A., Zaheer, M., Poczos, B., Salakhutdinov, R., Xing, E., and Schneider, J. Transformation autoregressive networks. In International Conference on Machine Learning, pp. 3898–3907. PMLR, 2018.
|
| 311 |
+
[32] Oord, A. v. d., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A., and Kavukcuoglu, K. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 312 |
+
[33] Papamakarios, G., Pavlakou, T., and Murray, I. Masked autoregressive flow for density estimation. arXiv preprint arXiv:1705.07057, 2017.
|
| 313 |
+
[34] Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
|
| 314 |
+
[35] Rezende, D. and Mohamed, S. Variational inference with normalizing flows. In International Conference on Machine Learning, pp. 1530–1538. PMLR, 2015.
|
| 315 |
+
[36] Roweis, S. T. and Saul, L. K. Nonlinear dimensionality reduction by locally linear embedding. science, 290(5500):2323–2326, 2000.
|
| 316 |
+
[37] Salimans, T., Karpathy, A., Chen, X., and Kingma, D. P. Pixelcnn $^ { + + }$ : Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017.
|
| 317 |
+
[38] Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256–2265. PMLR, 2015.
|
| 318 |
+
[39] Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11895–11907, 2019.
|
| 319 |
+
[40] Song, Y. and Ermon, S. Improved techniques for training score-based generative models. arXiv preprint arXiv:2006.09011, 2020.
|
| 320 |
+
[41] Song, Y., Sohl-Dickstein, J., Kingma, D., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=PxTIG12RRHS.
|
| 321 |
+
[42] Wu, H., Köhler, J., and Noe, F. Stochastic normalizing flows. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 5933–5944. Curran Associates, Inc., 2020.
|
md/train/zspml_qcldq/zspml_qcldq.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSS-MODAL RETRIEVAL AUGMENTATION FOR MULTI-MODAL CLASSIFICATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent advances in using retrieval components over external knowledge sources have shown impressive results for a variety of downstream tasks in natural language processing. Here, we explore the use of unstructured external knowledge sources of images and their corresponding captions for improving visual question answering (VQA). First, we train a novel alignment model for embedding images and captions in the same space, which achieves state-of-the-art image-caption retrieval performance w.r.t. similar methods. Second, we show that retrievalaugmented multi-modal transformers using the trained alignment model significantly improve results on VQA over strong baselines. reporting state-of-the-art performance. We further conduct extensive experiments to establish the promise of this approach, and examine novel applications for inference time such as hotswapping indices.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural networks augmented with non-parametric retrieval components have recently shown impressive results in NLP (Khandelwal et al., 2019; Guu et al., 2020; Lewis et al., 2020; Izacard & Grave, 2020). In this work, we train a state-of-the-art image-caption alignment model and utilize it in various retrieval-augmented multi-modal transformer architectures, achieving state-of-the-art performance on visual question answering (VQA) significant improvement over the baselines, including the winner of the VQA 2.0 2020 challenge.
|
| 12 |
+
|
| 13 |
+
Retrieval components are promising because they allow for easy revision and expansion of their memory, as compared to their parametric, pre-training counterparts. They provide more interpretability, as well as direct factual consistency with trusted knowledge sources. In the multi-modal setting, retrieval augmentation allows for leveraging the strengths of text-based models—as evidenced by the strong performance of BERT-based models in vision-and-language (Lu et al., 2019; Li et al., 2019b; Kiela et al., 2019)—via cross-modal translation from images to text. Being able to seamlessly “hot swap” knowledge sources without the need for re-training the model affords a unique scalability not typically seen in the traditional deep learning literature. Nearest neighbor methods are known to be strong baselines in the vision and language domain (Devlin et al., 2015).
|
| 14 |
+
|
| 15 |
+
We introduce a simple yet effective novel dense cross-modal alignment architecture called DXR (Dense X-modal Retriever). DXR achieves state-of-the-art performance on both COCO (Chen et al., 2015) and Flickr30k (Young et al., 2014) image-caption retrieval, with respect to similar methods. We subsequently use DXR to augment several multi-modal transformer architectures with a retrieval component. We show that retrieval augmentation yields impressive results for a variety of well-known multi-modal transformer architectures, ranging from VisualBERT (Li et al., 2019b) and ViLBERT (Lu et al., 2019)—which use bounding-box features—to Movie $^ +$ MCAN (Jiang et al., 2020)—which uses grid features. We name our overall method XTRA, for X-modal Transformer Retrieval Augmentation. Specifically, our contributions are as follows:
|
| 16 |
+
|
| 17 |
+
• We introduce a novel image-caption retrieval architecture, DXR, that achieves state-of-theart performance on COCO and Flickr30k, with respect to similar methods. • We introduce a new retrieval-augmented multi-modal transformer architecture, XTRA, that achieves state-of-the-art performance significant improvement on VQA over the baselines.
|
| 18 |
+
|
| 19 |
+
To our knowledge, this is the first work to showcase the promise of hybrid parametric and non-parametric models for the vision and language domain.
|
| 20 |
+
|
| 21 |
+
• We conduct extensive experiments to shed light on this novel approach. We explore different datasets for training the alignment model, as well as the effect of in-domain versus out-of-domain retrieval indices, the index size and inference time applications. Our experiments show that our proposed method significantly improves over a variety of strong multi-modal baselines, and demonstrates superior results over pre-training.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Cross-Modal Retrieval Prior work in cross-modal retrieval can be divided into two primary categories: (i) methods that use grid-features and/or vector representations of the embedding space, and (ii) methods that use detection features, sequence representations, or share information between the two modalities for computing the similarity metric. The first category consists of methods such as RRF (Liu et al., 2017) and DPC (Zheng et al., 2017) which use two convolutional network branches for image and text. CMPM by Zhang & Lu (2018) introduced a pre-trained image backbone with a Bi-directional LSTM to learn image and text embeddings. The most relevant work in this category is ${ \mathrm { V S E } } { + } { + }$ (Faghri et al., 2017), which focuses on hard negative mining and ranking loss. The second category generally exploits the use of detection features, which enforces an additional complexity. Methods such as TERN (Messina et al., 2020b), TERAN (Messina et al., 2020a), SAEM (Wu et al., 2019) and MMCA (Wei et al., 2020), use transformer modules to obtain modality-specific embeddings. TERAN, as well as SCAN (Lee et al., 2018), utilize sequence similarities. SCO (Huang et al., 2018) and VSRN (Li et al., 2019a) learn, in addition to image-text alignment, to generate the caption from the image embedding. MMCA, as well as CAMP (Wang et al., 2019), fuses image and text information to obtain the final embeddings. Other methods, such as Unicoder-VL (Li et al., 2020a), Oscar (Li et al., 2020b) and UNITER (Chen et al., 2020) learn to align between image and text by using positive and negative tuples of images and captions. While these models perform well, they suffer from high computational complexity as we discuss in Sec. 3.4
|
| 26 |
+
|
| 27 |
+
External Knowledge Source Methods The use of an external knowledge source (KS) has gained much attention in the field of natural language processing (NLP), such as the work of Verga et al. (2020). Our work is inspired by that of Lewis et al. (2020), which introduced RAG, a generic approach for a variety of downstream NLP tasks, that uses a learned retriever (DPR by Karpukhin et al. (2020)) to augment the inputs by marginalizing across several retrieved phrases retrieved from Wikipedia. In the multi-modal domain, previous efforts have focused on building different types of KS, such as the work of Zhu et al. (2014), Chen et al. (2013), Divvala et al. (2014), Sadeghi et al. (2015) and Zhu et al. (2015), which use web information for the construction of the KS. Methods that use an external KS for a downstream task use a structured KS, such as the work of Narasimhan et al. (2018), Narasimhan & Schwing (2018), Wang et al. (2015) Wang et al. (2018) and Zhu et al. (2017). Zhu et al. (2017) introduced an iterative method for VQA tasks. Marino et al. (2019) introduced OK-VQA, a novel VQA dataset that requires the use of an external KS. Fan et al. (2020) applied a KS to multi-modal dialogue. In our work, we focus on a more natural KS, such as images and captions, which better reflect the data generated in newspapers and social media.
|
| 28 |
+
|
| 29 |
+
Multi-modal Classification In this work, we investigate the potential advantages of using an external KS for the popular and challenging VQA domain, a multi-modal classification task. Current methods for VQA use pre-training on different datasets in order to gain better performance. In our experiments, we show performance for common methods such as VisualBERT (Li et al., 2019b), which concatenates the text and image modalities as an input to a pre-trained BERT (Devlin et al., 2018) model. ViLBERT (Lu et al., 2019) fuses text and image modalities using co-attentional transformer layers. Other methods such as Pythia (Jiang et al., 2018), VLBERT (Su et al., 2019) and MMBT (Kiela et al., 2019) can benefit from our method, as well as more recent work such as Oscar (Li et al., 2020b) and UNITER (Chen et al., 2020), which use the alignment task for pretraining their models. The currently SOTA In this paper, we choose to show our performance on the two common VisualBERT and ViLBERT models, and the winner of the VQA 2.0 2020 challange, Movie+MCAN (Jiang et al., 2020) , which uses grid features instead of detection features, a modulated convolutional bottleneck for the image backbone, and MCAN (Yu et al., 2019) for fusion. A similar method was introduced by Nguyen et al. (2020). Our method is also applicable to methods such as Pythia (Jiang et al., 2018) and MMBT (Kiela et al., 2019).
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: (a) Cross-modal alignment architecture. We use a pre-trained ResNet-152 and BERT as feature extractors with an in-batch hinge loss. (b) Sample query image and retrieved captions from the COCO dataset. Ground truth captions are colored in blue (best viewed in color).
|
| 33 |
+
|
| 34 |
+
# 3 METHOD
|
| 35 |
+
|
| 36 |
+
Our methodology is composed of two disjoint parts: (i) for a given external knowledge source $\kappa$ , consisting of $m$ modalities, we train a model (i.e., the Retriever) to align between the different modalities. (ii) Given a knowledge source $\kappa$ and an alignment model, we train a downstream model (i.e., the Reader) by augmenting its inputs with extra data from $\kappa$ .
|
| 37 |
+
|
| 38 |
+
# 3.1 CROSS-MODAL ALIGNMENT
|
| 39 |
+
|
| 40 |
+
Let $\kappa$ be a knowledge source consisting of $m$ modalities, where each sample $s _ { i } = ( s _ { i } ^ { 0 } , \ldots , s _ { i } ^ { m } ) \in K$ is a tuple of $m$ elements, corresponding to different modalities. Our alignment model encompasses $m$ encoders $E _ { m }$ , each composed of a feature-extraction module $F _ { m }$ , projection layer $P _ { m }$ , shared Transformer encoding layer $T$ with attention pooling, and a normalization layer $\mathcal { N }$ :
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
E _ { m } ( x ) = \mathcal { N } ( T ( P _ { m } ( F _ { m } ( x ) ) ) )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
From this point, we will consider the two-modality case of images and captions as illustrated in Fig. 1. For text and image feature extractors, $F _ { 1 }$ and $F _ { 2 }$ , we use a pre-trained BERT masked language model Devlin et al. (2018), and a pre-trained ResNet152 CNN backbone on ImageNet, respectively. The images are represented with convolutional grid features, chosen for robustness and speed, and these are flattened across the spatial dimension. The projection layers $P _ { m }$ project each modality to a constant dimension $d$ . The projected sequences are then forwarded to a shared Transformerencoding layer, and aggregated by an attention pooling layer, resulting in a vector representation for each modality. Finally, we normalize each vector using an L2 normalizer, projecting all embeddings to the unit-sphere. Following Faghri et al. (2017), we only normalize the text embeddings because of image-caption imbalance (see Sec. 4.1).
|
| 47 |
+
|
| 48 |
+
We train our dense cross-modal retriever (DXR) using a contrastive loss, specifically using an inbatch hinge penalty with hard negatives (Faghri et al., 2017). Given a batch, consisting of $b$ samples, $s _ { 1 } \ldots s _ { b }$ , for each sample $s _ { i }$ , let $\mathbf { \bar { \mathbf { \rho } } } _ { s _ { i } ^ { 1 } }$ and $s _ { i } ^ { 2 }$ be the positive pairs and $s _ { i } ^ { 1 }$ and $s _ { j \neq i } ^ { 2 }$ the negative pairs. We compute the pair-wise similarity between the two modalities, using a dot product, denoted by $\pi ( s _ { i } ^ { 1 } , s _ { j } ^ { 2 } ) = \langle s _ { i } ^ { 1 } , \bar { s } _ { j } ^ { 2 } \rangle$ . The hard-negative in-batch hinge loss is then defined as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\begin{array} { l c r } { { \displaystyle s _ { i } ^ { 2 ^ { \prime } } = \operatorname* { m a x } _ { j \neq i } \pi ( s _ { i } ^ { 1 } , s _ { j } ^ { 2 } ) } } & { { ( 2 ) } } & { { s _ { i } ^ { 1 ^ { \prime } } = \operatorname* { m a x } _ { j \neq i } \pi ( s _ { j } ^ { 1 } , s _ { i } ^ { 2 } ) } } \\ { { \displaystyle \mathscr { L } _ { h a r d } = \sum _ { i } [ \alpha + \pi ( s _ { i } ^ { 1 } , s _ { i } ^ { 2 ^ { \prime } } ) - \pi ( s _ { i } ^ { 1 } , s _ { i } ^ { 2 } ) ] + \sum _ { i } [ \alpha + \pi ( s _ { i } ^ { 1 ^ { \prime } } , s _ { i } ^ { 2 } ) - \pi ( s _ { i } ^ { 1 } , s _ { i } ^ { 2 } ) ] } } & { { } } \end{array}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $s _ { i } ^ { 1 ^ { \prime } }$ and $s _ { i } ^ { 2 ^ { \prime } }$ are the hardest samples inside the batch, and $\alpha$ is the margin constant.
|
| 55 |
+
|
| 56 |
+
# 3.2 INDEXING AND RETRIEVING
|
| 57 |
+
|
| 58 |
+
Following Lewis et al. (2020), we use FAISS (Johnson et al., 2017) as our indexer platform for fast KNN queries. Given a knowledge source $\kappa$ , we construct an index by computing the embeddings of each sample in $\kappa$ using some alignment model (the Retriever), which can be trained on any arbitrary knowledge source. We introduce with two variants: we either construct separate indices $I _ { \kappa } ^ { m }$ for each of the modalities; or we construct one joint index $I _ { \mathcal { K } }$ that encompasses all modalities and where a KNN query will return a mixed modality result. Fig. 2 illustrates the two independent features of the alignment model and external knowledge source.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Illustration of our end-to-end framework. The trained cross-modal alignment is used to extract features as queries to a FAISS indexer. The $k$ retrieved indices are used to access data from the external knowledge source, and augment the input by appending each of the $k$ retrievals to the relative modality. For VQA, we only query the input image and retrieve $k$ captions.
|
| 62 |
+
|
| 63 |
+
The retrieval process then consists of input query $q$ , encoder $E _ { m }$ and indexer $I _ { \mathcal { K } }$ (or $I _ { \mathcal { K } } ^ { m } .$ ). $I _ { \mathcal { K } }$ takes as an input an embedding query $e _ { q } = E _ { m } ( q )$ and $k$ , and returns the $k$ -nearest indices $i _ { 1 } \ldots i _ { k }$ , corresponding to the $k$ -nearest embeddings. We then index data from $\kappa$ , resulting in $m$ retrieval sets $r ^ { m } = \mathsf { \bar { ( } } r _ { 1 } ^ { m } \ldots \mathsf { \bar { ( } } r _ { n _ { m } } ^ { m } )$ , one for each modality, each consisting of varying number of samples $n _ { m }$ , where $\textstyle \sum _ { i = 1 } ^ { m } n _ { m } = k$ . When using $I _ { \kappa } ^ { m }$ , a single modality is returned, resulting in $r ^ { m } = ( r _ { 1 } ^ { m } \ldots r _ { k } ^ { m } )$ : For simplicity, we define the retriever by $R ( q , E _ { m } , I _ { K } , k ) : = \{ r ^ { 1 } , \ldots , r ^ { m } \}$ .
|
| 64 |
+
|
| 65 |
+
# 3.3 END-TO-END FUSION
|
| 66 |
+
|
| 67 |
+
Let $M$ be any multi-modal reader model, applied to a specific downstream task that takes as an input $x = ( x ^ { 1 } , \ldots , x ^ { m } )$ consisting of $m$ modalities and outputs prediction $y$ . The method augments the input $x$ by concatenating the retrieved samples to their corresponding input modalities, resulting in the augmented input $x ^ { \prime }$ :
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
x ^ { \prime } = ( x ^ { 1 } \circ r _ { 1 } ^ { 1 } \circ \cdot \cdot \cdot \circ r _ { n _ { 1 } } ^ { 1 } , \ . . . , x ^ { m } \circ r _ { 1 } ^ { m } \circ \cdot \cdot \cdot \circ r _ { n _ { m } } ^ { m } )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The resulting end-to-end training of model $M$ is then defined by some loss function $\mathcal { L }$ , minimizing $\mathcal { L } ( M ( x ^ { \prime } ) , y )$ , with the same hyperparameters as in the non-retrieval augmented case. Fig. 2 illustrates the complete model.
|
| 74 |
+
|
| 75 |
+
# 3.4 TIME-COMPLEXITY
|
| 76 |
+
|
| 77 |
+
As introduces in Sec. 2, we consider two types of retrievers, (i) methods such as ours, that use Maximum Inner Product Search (MIPS), where each modality is computed independently, and (ii) methods that have entangled computation of similarity between the different modalities, e.g.they cannot compute an independent embedding. Assuming a knowledge-source of size $\cdot$ , and a forward-pass with $\cdot$ time-complexity. In type (i), the embeddings of the entire knowledge source need to be computed only once, as well as the embeddings of the query sample. In our experiments, we use FAISS with “Hierarchical Navigable Small World” search, and as shown by Johnson et al. (2017), this searching method takes $\_$ , where $\cdot$ and $\cdot$ are constants, and $D$ is the degree of the graph. Therefore, the total time complexity of retrieving is $O ( A D [ \log N ] v )$ . On the other hand, methods of type (ii) must compute pairwise similarities between a query sample, and all samples in the dataset, resulting in a $O ( N )$ run time for searching the most similar sample.
|
| 78 |
+
|
| 79 |
+
As a results, type (ii) methods are not applicable to our end-to-end fusion pipeline, where for each sample we query, a $O ( N )$ is applied, which results in an inefficient and non-scalable method. On the other hand, our method does not impose significant overhead.
|
| 80 |
+
|
| 81 |
+
# 4 EXPERIMENTS
|
| 82 |
+
|
| 83 |
+
In this section, we describe the two experimental settings of the alignment model and the end-toend downstream task training and evaluation. All models and experiments are implemented and performed with the MMF library (Singh et al., 2020a).
|
| 84 |
+
|
| 85 |
+
# 4.1 DATASETS
|
| 86 |
+
|
| 87 |
+
We use three common datasets for training and evaluating retrieval and VQA tasks. Flickr30K (Young et al., 2014) is composed of 30,000 images, with 5 captions each. Following Karpathy & Fei-Fei (2015), we use 1000 images for validation and 1000 images for testing. COCO (Chen et al., 2015) is a well-known dataset that contains 120,000 images, with 5 captions each. We use the splits from Karpathy & Fei-Fei (2015) as well, resulting in 80K images for training, 5K images for validation and 5K images for testing. Following Faghri et al. (2017), we add an additional 30K images for training, and uses the same 1K and 5K splits. Conceptual Captions (Sharma et al., 2018) is a dataset that contains image-caption pairs, composed of 3M samples for training and 100K for validation, which we use to test our retrieval model.
|
| 88 |
+
|
| 89 |
+
The proposed datasets differ in two major axes (i) Size - The largest knowledge-source we use is CC, which contains 3M image-caption pairs, while COCO and Flickr30K are smaller in one and two orders of magnitude, respectively. (ii) Domain gap - As shown in (Singh et al., 2020b), CC datasets differs in both visual and textual domain from the VQA task, while COCO has the best domain match in both. Flickr30K datasets, on the other hand, is very similar to COCO, but suffers from short number of samples in an order of magnitude compared to COCO.
|
| 90 |
+
|
| 91 |
+
# 4.2 CROSS-MODAL RETRIEVAL
|
| 92 |
+
|
| 93 |
+
In the cross-modal retrieval task, we deal with two modalities: images and captions. Bi-directional retrieval is evaluated, denoted as Text Image and Image Text, where the left-hand-side indicates the query and the other indicates the retrieved domain. For fair comparison, we only report results for methods that use grid-features and vector representations, as noted in ${ \tt S e c 3 . 2 }$ and 3.4. For a full comparison with other previous methods, please see Appendix A. Models are trained for 100K iterations with a warm-up of 2k iterations, batch size of 256, and Adam optimizer with learning-rate of 0.0001 where the (pre-trained unimodal) feature encoder’s learning-rate is multiplied by 0.1. The hinge-loss margin hyperparameter $m$ is set to 0.2.
|
| 94 |
+
|
| 95 |
+
# 4.3 DOWNSTREAM TASKS
|
| 96 |
+
|
| 97 |
+
After training the alignment models for each dataset—Flickr30K, COCO and CC—we build indices for each, as defined in Sec 3.2. Note that for COCO, we only use the training set for indexing, while for Flickr30K and CC, we use the entire set of train/val/test. This is done for fair comparison with the VQA task, which uses the COCO training-set images for training. Our experiments focus on VQA as the downstream task, however we note that extension to other multi-modal tasks is straightforward. The inputs of the VQA task are image and text tuples, and it is presented as a classification problem over a set of answers. In VQA, we observe that information regarding the content of the image, such as the amount, color and location of objects is very correlated with the question and answer. Therefore, captions serve as good auxiliary information, while similar/retrieved images (e.g., to which the question does not directly refer) are less informative. For that reason, we use the separate indices variant, retrieving text captions from images to yield a cross-modal image to text translation. We experiment with all three datasets, evaluating different training and inference variants.
|
| 98 |
+
|
| 99 |
+
# 5 RESULTS
|
| 100 |
+
|
| 101 |
+
# 5.1 CROSS-MODAL RETRIEVAL
|
| 102 |
+
|
| 103 |
+
Tab. 1 and 2 show retrieval results on Flickr30K and COCO, comparing similar methods that use grid-features and vector representations for the embedding space. Reported numbers correspond to Recall-at-1/5/10 on the test-sets. As can be seen, our method significantly outperforms previous work in both datasets. We refer to Appendix A for a comparison with additional methods. While CC is not commonly used in the retrieval literature, we use it for our downstream task. Using DXR, we obtain the following results for CC: $\mathbb { R } \ @ 1$ : $2 5 . 1 \ : \mathrm { R } @ 5 \colon 5 0 .$ .1 and $\mathrm { R @ 1 0 }$ : 61.9 for Text Image, and $\mathrm { R } @ 1 \colon 2 5 . 4 \mathrm { R } @ 5 \colon \bar { 5 } 0 . 9$ and $\operatorname { R } @ 1 0 \colon 6 1 . 8$ for Image Text. The alignment model trained on CC is used for training in the downstream VQA task. We notice that performance degrades as the dataset size increases, which could affect the downstream task since we query from the entire dataset.
|
| 104 |
+
|
| 105 |
+
Table 1: Retrieval results for Flickr30K, comparing only methods that use raw images as input, and vector representations for the embedding space. Additional methods can be found in Appendix A.
|
| 106 |
+
|
| 107 |
+
<table><tr><td></td><td colspan="3">Text→Image</td><td colspan="3">Image→ Text</td></tr><tr><td>Method</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>RRF</td><td>35.4</td><td>68.3</td><td>79.9</td><td>47.6</td><td>77.4</td><td>87.1</td></tr><tr><td>CMPM</td><td>37.3</td><td>65.7</td><td>75.5</td><td>49.6</td><td>76.8</td><td>86.1</td></tr><tr><td>DPC</td><td>39.1</td><td>69.2</td><td>69.2</td><td>55.6</td><td>81.9</td><td>89.5</td></tr><tr><td>VSE++</td><td>39.6</td><td>69.6</td><td>79.5</td><td>52.9</td><td>79.1</td><td>87.2</td></tr><tr><td>DXR</td><td>50.6</td><td>78.8</td><td>86.7</td><td>65.1</td><td>87.3</td><td>92.6</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 2: Retrieval results for COCO, comparing only methods that use raw images as input, and vector representations for the embedding space. Additional methods can be found in Appendix A.
|
| 110 |
+
|
| 111 |
+
<table><tr><td></td><td colspan="6">COCO 1K</td><td colspan="6">COCO 5K</td></tr><tr><td></td><td colspan="2">Text → Image</td><td colspan="2"></td><td colspan="2">Image→ Text</td><td colspan="2">Text→Image</td><td colspan="2"></td><td colspan="2">Image→ Text</td></tr><tr><td>Method</td><td></td><td></td><td>R@1 R@5 R@10</td><td></td><td>R@1 R@5 R@10</td><td></td><td>R@1 R@5 R@10</td><td></td><td></td><td>R@1 R@5 R@10</td><td></td><td></td></tr><tr><td>DPC</td><td>47.1</td><td>79.9</td><td>90.0</td><td>65.6</td><td>89.8</td><td>95.5</td><td>25.3</td><td>53.4</td><td>66.4</td><td>41.2</td><td>70.5</td><td>81.1</td></tr><tr><td>VSE++</td><td>52.0</td><td>83.1</td><td>92.0</td><td>64.6</td><td>89.1</td><td>95.7</td><td>30.3</td><td>59.1</td><td>72.4</td><td>41.3</td><td>69.2</td><td>81.2</td></tr><tr><td>CMPM</td><td>44.6</td><td>78.8</td><td>89.0</td><td>56.1</td><td>86.3</td><td>92.9</td><td>22.9</td><td>50.2</td><td>63.8</td><td>31.1</td><td>60.7</td><td>73.9</td></tr><tr><td>DXR</td><td>56.8</td><td>88.2</td><td>94.9</td><td>67.0</td><td>93.0</td><td>97.6</td><td>33.9</td><td>64.9</td><td>77.4</td><td>44.9</td><td>75.2</td><td>84.7</td></tr></table>
|
| 112 |
+
|
| 113 |
+
Table 3: VQA Results for three different reader models on COCO val-set. Vanilla - models use pre-trained BERT model. PT - Pre-Training with the knowledge source. XTRA-10C - training via our method using the knowledge source indicated and alignment model trained on that knowledge source, using 10 retrieved captions. 5-GT - training with the 5 ground truth captions.
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Knowledge Source</td><td>Training Type</td><td>Visual BERT</td><td>ViLBERT</td><td>Movie+MCAN</td></tr><tr><td>Flickr30K</td><td>XTRA 10-C</td><td>66.77</td><td>67.32</td><td>69.70</td></tr><tr><td rowspan="3">CC</td><td>PT</td><td>64.34</td><td>68.14</td><td></td></tr><tr><td>XTRA-10C</td><td>67.49</td><td>67.37</td><td>69.02</td></tr><tr><td>PT + XTRA-10C</td><td>67.53</td><td>69.17</td><td></td></tr><tr><td rowspan="3">COCO</td><td>PT</td><td>64.54</td><td>67.58</td><td>=</td></tr><tr><td>XTRA-10C</td><td>68.98</td><td>69.07</td><td>71.52</td></tr><tr><td>PT + XTRA-10C</td><td>67.71</td><td>69.90</td><td>-</td></tr><tr><td colspan="2">Vanilla</td><td>63.54</td><td>67.56</td><td>71.16</td></tr><tr><td colspan="2">5-GT</td><td>69.61</td><td>71.50</td><td>71.80</td></tr></table>
|
| 116 |
+
|
| 117 |
+
# 5.2 VISUAL QUESTION ANSWERING
|
| 118 |
+
|
| 119 |
+
Our main results show performance on the VQA val-set, experimenting with three common VQA methods: VisualBERT (Li et al., 2019b), ViLBERT (Lu et al., 2019), and the currently stateof-the-art winner of the VQA 2.0 challenge, Movie+MCAN (Nguyen et al., 2020), each along with three different knowledge sources (COCO, CC and Flickr30K). Following Jiang et al. (2020), we use the val-set to assist in our exhaustive ablation studies, however we report our final SOTA result on the VQA test-std split. Tab. 3 summarizes four different training settings: (i) vanilla - models using pre-trained BERT; (ii) PT - Task agnostic pre-Training with the knowledge source dataset (using masked language modeling); (iii) 5-GT - training with the 5 ground truth captions from COCO; (iv) XTRA-10C - training via our method, using the knowledge source indicated and alignment model trained on that source, using 10 retrieved captions.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 3: Two Hot-Swap configurations of the knowledge source during inference. (a) both the alignment model and the knowledge source are replaced with new ones built using a new dataset. (b) only the knowledge source is replaced, and the indexer is built using the old alignment model.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: Hot-Swap results. Each row corresponds to a different reader model. Each graph shows (a) Training with different amount of retrieved captions. (b) Using the trained model with 10-cap, we inference with different amount of captions. (c) Hot swapping between knowledge sources.
|
| 126 |
+
|
| 127 |
+
We see that using the five ground truth (GT) COCO captions as additional data (bottom row of Tab. 3), sets a soft upper bound for our approach. On one hand, the GT captions contain relevant information about the content of the image; on the other hand, other captions from the knowledge source may additionally serve as rich, useful descriptions. We also see that our method significantly increases performance across all baselines, even with respect to pre-training. This suggests that our method serves as a good alternative for pre-training. Our best model, Movie+MCAN $\cdot$ XTRA-10C, outperform Movie+MCAN on $\cdot$ test-std, Our best model sets a new state-of-the-art on VQA2.0 test-std, using Movie+MCAN+XTRA-10C, obtaining a score of 73.12 (with single model performance).
|
| 128 |
+
|
| 129 |
+
# 5.3 HOT SWAP
|
| 130 |
+
|
| 131 |
+
Our method is devised such that querying and retrieving from the knowledge source is independent of the downstream model, enabling the swap of the alignment model and/or knowledge source during inference. This affords interesting explorations. We describe two forms of “hot swapping”: (i) the entire knowledge source with its trained alignment model are replaced with a new one and corresponding alignment model – we refer to this as “out-of-domain”; (ii) the knowledge source used for retrieving is swapped, but the alignment model remains the same as was originally trained with the downstream model. In this case, we build a new retriever for the new knowledge source, using the original alignment model – we call this “in-domain”. “in/out-of-domain” refers to the alignment domain with which the downstream model was trained. Fig. 3 illustrates the two cases.
|
| 132 |
+
|
| 133 |
+
In Fig. 4 we show different inference results for hot swapping. All models in this experiment are trained using 10 retrieved cations. The title of each graph represents the trained model, followed by the trained knowledge source and the knowledge source to which we swap. In addition, we show inference results for training with the swapped knowledge source, e.g. training with CC knowledge source and alignment model from scratch, using 10 retrievals. As can be seen, “in-domain” hot swapping performance is significantly higher than “out-of-domain”. We hypothesize that the reader model has learned an implicit structure of the alignment space. Surprisingly, when training with COCO as the knowledge source, “in-domain” hot swapping performs similarly, for the same amount of trained retrievals (10), as training with an alternative knowledge source and alignment model. On the other hand, we observe that this suffers from a decrease in generalization due to different amounts of retrieval during inference-time. In the other direction, hot swapping to COCO from CC or Flickr30K does not result in the same performance as training with COCO as the knowledge source and alignment model, yet, performance and generalization do not degrade. Qualitative results of “in-domain” hot swapping are presented in Fig 5. As can be observed, novel information such as the fact that the image shows a “cobblestone street” is retrieved from CC without having to train the alignment model on that source.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Query Image COCO val-set</td><td>No Hotswap COCO train-set</td><td>Retrieved Captions Flickr30KHotswap train+val+test sets</td><td>CC Hotswap train+val sets</td></tr><tr><td></td><td>A dog that is lying down on a sidewalk</td><td>A dog asleep on the streets</td><td>A dog lies down on a cobblestone street</td></tr><tr><td></td><td>Adog withamuzleonislyingonthesidewalkAtanmale bulldogsleepingonasidewalkThedogislyingonthecobblestonestreet</td><td></td><td></td></tr><tr><td></td><td>A happy stray puppy lies in the street</td><td>Cute dog sleeping on the sidewalk</td><td>A dog laying on the side of the streets</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td>A dog is laying and resting on a walkways</td><td>A dog lying on the sidewalk</td><td>A dog with a collar on lying on the streets</td></tr></table>
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Sample top-4 result for “in-domain” Hot-Swap. The model was trained using COCO as the knowledge source, and 10 retrieved captions. Left - Query image from VQA val-set. Columns refer to the different hot-swaps, showing retrieved captions.
|
| 139 |
+
Figure 6: Ablation study of our method. (a) - Training with different amount of retrieved captions. (b) - Using the trained model with 10-cap, we inference with different amount of captions.
|
| 140 |
+
|
| 141 |
+
# 5.4 ABLATION STUDY
|
| 142 |
+
|
| 143 |
+
In this study, we explore the use of different amounts of retrieval during training and inference, as well as doing inference without retrieving - which we name unplugged. We further explore the relationship between pre-training and XTRA.
|
| 144 |
+
|
| 145 |
+
Number of Retrievals We experiment with different amounts of retrieved captions during training and inference. In Fig 6 (a), we show the performance of our method when training with different amounts of retrieval, and different knowledge sources. As can be observed, training with 10 captions and COCO as the knowledge source results in the best performance. In Fig 6 (b), we show the inference performance for models trained using 10 retrievals. In addition, we show the inference performance of the same model, trained with random amounts of retrieval, between 1 and 20, on the COCO dataset (COCO 20R-C). With this, the best performance is given when we inference with the same amount of trained retrievals, and this then degrades as the number of retrievals differ from how the model was trained. We also see that training with varying number of retrievals achieves better generalization to different amounts of retrievals during inference, as can be seen in Fig 6 (b), COCO 20R-C, where performance is maintained up to 60 retrievals during inference.
|
| 146 |
+
|
| 147 |
+
Unplugged Performance One interesting observation we make is the ability to ”unplug” the knowledge source by not retrieving during inference-time. Tab. 4 shows a noticeable decrease in performance, indicating the dependency of the reader on the retrieved data during training. When training with COCO as the knowledge source, introducing captions that are very related to the input images is biasing the model to depend on the retrieved captions. For CC and Flickr30K, the domain
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>COCO</td><td>CC</td><td>Flickr30K</td></tr><tr><td>Visual BERT</td><td>58.77 (68.98)↓10.21</td><td>63.15 (67.49) ↓ 4.34</td><td>61.86 (66.77) ↓ 4.91</td></tr><tr><td>ViLBERT</td><td>45.60 (69.07) ↓ 23.47</td><td>63.50 (67.37) ↓ 3.87</td><td>59.34 (67.32) ↓ 7.98</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 4: VQA performance using models trained with 10 retrieved caption, and evaluating without any retrievals (”unplugged”). The highest decrease in performance occurs for the in-domain (COCO) knowledge source where retrieved examples are most informative.
|
| 152 |
+
|
| 153 |
+
gap between the downstream task and the knowledge source lessens this gap in unplugged performance. Surprisingly, while ViLBERT performance is generally better than Visual BERT, using our method, the opposite is true when unplugging the knowledge source.
|
| 154 |
+
|
| 155 |
+
External Knowledge Source & Pre-training The use of a retrieval mechanism over external knowledge sources raises inriguing questions, e.g.: 1) Is augmentation better than pre-training?; and 2) Can pre-training help the external knowledge source? To address these questions, we experimented with two different pre-training datasets commonly used for VQA - COCO and CC. Tab. 3 suggests that for the COCO dataset, using our method is significantly better than pre-training alone, while using pre-training followed by XTRA causes the performance to vary with respect to the reader architecture (e.g., pre-training helps XTRA with ViLBERT, but not with VisualBERT). Tab. 3 also shows that fine-tuning our method after pre-training on the same knowledge source yields better performance over pre-training across all knowledge sources and architectures.
|
| 156 |
+
|
| 157 |
+
# 6 CONCLUSION
|
| 158 |
+
|
| 159 |
+
In this work, we presented a novel approach that proposes the use of external knowledge sources in multi-modal prediction models with transformer architectures. We trained a state-of-the-art alignment model, DXR, for performing retrieval over external knowledge sources. We showed that our method XTRA yields gains in performance when using an in-domain knowledge source on VQA. We conducted a variety of experiments to show the sensitivity and effects of the used knowledge source with various choices in hyperparameters which shed further light on the different aspects of the model. Future research and applications of our method include interpretability of retrieved data and predictions for verification processes, the demonstration of increased information security by hot-swapping, and unplugged versions of models and new architectures that take advantage of out-of-domain knowledge source. We hope that our approach inspires further work in the direction of hybrid parametric non-parametric models for multi-modal problems.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
Xinlei Chen, Abhinav Shrivastava, and Abhinav Gupta. Neil: Extracting visual knowledge from web data. In Proceedings of the IEEE international conference on computer vision, pp. 1409–1416, 2013.
|
| 164 |
+
Xinlei Chen, Hao Fang, Tsung-Yi Lin, Ramakrishna Vedantam, Saurabh Gupta, Piotr Dollar, and ´ C Lawrence Zitnick. Microsoft coco captions: Data collection and evaluation server. arXiv preprint arXiv:1504.00325, 2015.
|
| 165 |
+
Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. Uniter: Universal image-text representation learning. In European Conference on Computer Vision, pp. 104–120. Springer, 2020.
|
| 166 |
+
Jacob Devlin, Saurabh Gupta, Ross Girshick, Margaret Mitchell, and C Lawrence Zitnick. Exploring nearest neighbor approaches for image captioning. arXiv preprint arXiv:1505.04467, 2015.
|
| 167 |
+
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.
|
| 168 |
+
Santosh K Divvala, Ali Farhadi, and Carlos Guestrin. Learning everything about anything: Weblysupervised visual concept learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3270–3277, 2014.
|
| 169 |
+
|
| 170 |
+
Fartash Faghri, David J Fleet, Jamie Ryan Kiros, and Sanja Fidler. Vse $^ { + + }$ : Improving visualsemantic embeddings with hard negatives. arXiv preprint arXiv:1707.05612, 2017.
|
| 171 |
+
|
| 172 |
+
Angela Fan, Claire Gardent, Chloe Braud, and Antoine Bordes. Augmenting transformers with knn-based composite memory for dialogue. arXiv preprint arXiv:2004.12744, 2020.
|
| 173 |
+
|
| 174 |
+
Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
|
| 175 |
+
|
| 176 |
+
Yan Huang, Qi Wu, Chunfeng Song, and Liang Wang. Learning semantic concepts and order for image and sentence matching. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6163–6171, 2018.
|
| 177 |
+
|
| 178 |
+
Gautier Izacard and Edouard Grave. Leveraging passage retrieval with generative models for open domain question answering. arXiv preprint arXiv:2007.01282, 2020.
|
| 179 |
+
|
| 180 |
+
Huaizu Jiang, Ishan Misra, Marcus Rohrbach, Erik Learned-Miller, and Xinlei Chen. In defense of grid features for visual question answering. arXiv preprint arXiv:2001.03615, 2020.
|
| 181 |
+
|
| 182 |
+
Yu Jiang, Vivek Natarajan, Xinlei Chen, Marcus Rohrbach, Dhruv Batra, and Devi Parikh. Pythia v0. 1: the winning entry to the vqa challenge 2018. arXiv preprint arXiv:1807.09956, 2018.
|
| 183 |
+
|
| 184 |
+
Jeff Johnson, Matthijs Douze, and Herve J ´ egou. Billion-scale similarity search with gpus. ´ arXiv preprint arXiv:1702.08734, 2017.
|
| 185 |
+
|
| 186 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3128–3137, 2015.
|
| 187 |
+
|
| 188 |
+
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Ledell Wu, Sergey Edunov, Danqi Chen, and ˘ Wen-tau Yih. Dense passage retrieval for open-domain question answering. arXiv preprint arXiv:2004.04906, 2020.
|
| 189 |
+
|
| 190 |
+
Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. Generalization through memorization: Nearest neighbor language models. arXiv preprint arXiv:1911.00172, 2019.
|
| 191 |
+
|
| 192 |
+
Douwe Kiela, Suvrat Bhooshan, Hamed Firooz, and Davide Testuggine. Supervised multimodal bitransformers for classifying images and text. arXiv preprint arXiv:1909.02950, 2019.
|
| 193 |
+
|
| 194 |
+
Kuang-Huei Lee, Xi Chen, Gang Hua, Houdong Hu, and Xiaodong He. Stacked cross attention for image-text matching. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 201–216, 2018.
|
| 195 |
+
|
| 196 |
+
Patrick Lewis, Ethan Perez, Aleksandara Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Kuttler, Mike Lewis, Wen-tau Yih, Tim Rockt ¨ aschel, et al. Retrieval-augmented gener- ¨ ation for knowledge-intensive nlp tasks. arXiv preprint arXiv:2005.11401, 2020.
|
| 197 |
+
|
| 198 |
+
Gen Li, Nan Duan, Yuejian Fang, Ming Gong, Daxin Jiang, and Ming Zhou. Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training. In AAAI, pp. 11336– 11344, 2020a.
|
| 199 |
+
|
| 200 |
+
Kunpeng Li, Yulun Zhang, Kai Li, Yuanyuan Li, and Yun Fu. Visual semantic reasoning for imagetext matching. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4654–4662, 2019a.
|
| 201 |
+
|
| 202 |
+
Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019b.
|
| 203 |
+
|
| 204 |
+
Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In European Conference on Computer Vision, pp. 121–137. Springer, 2020b.
|
| 205 |
+
|
| 206 |
+
Yu Liu, Yanming Guo, Erwin M Bakker, and Michael S Lew. Learning a recurrent residual fusion network for multimodal matching. In Proceedings of the IEEE International Conference on Computer Vision, pp. 4107–4116, 2017.
|
| 207 |
+
|
| 208 |
+
Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems, pp. 13–23, 2019.
|
| 209 |
+
|
| 210 |
+
Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. Ok-vqa: A visual question answering benchmark requiring external knowledge. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3195–3204, 2019.
|
| 211 |
+
|
| 212 |
+
Nicola Messina, Giuseppe Amato, Andrea Esuli, Fabrizio Falchi, Claudio Gennaro, and Stephane ´ Marchand-Maillet. Fine-grained visual textual alignment for cross-modal retrieval using transformer encoders. arXiv preprint arXiv:2008.05231, 2020a.
|
| 213 |
+
|
| 214 |
+
Nicola Messina, Fabrizio Falchi, Andrea Esuli, and Giuseppe Amato. Transformer reasoning network for image-text matching and retrieval. arXiv preprint arXiv:2004.09144, 2020b.
|
| 215 |
+
|
| 216 |
+
Medhini Narasimhan and Alexander G Schwing. Straight to the facts: Learning knowledge base retrieval for factual visual question answering. In Proceedings of the European conference on computer vision (ECCV), pp. 451–468, 2018.
|
| 217 |
+
|
| 218 |
+
Medhini Narasimhan, Svetlana Lazebnik, and Alexander Schwing. Out of the box: Reasoning with graph convolution nets for factual visual question answering. In Advances in neural information processing systems, pp. 2654–2665, 2018.
|
| 219 |
+
|
| 220 |
+
Duy-Kien Nguyen, Vedanuj Goswami, and Xinlei Chen. Revisiting modulated convolutions for visual counting and beyond. arXiv preprint arXiv:2004.11883, 2020.
|
| 221 |
+
|
| 222 |
+
Fereshteh Sadeghi, Santosh K Kumar Divvala, and Ali Farhadi. Viske: Visual knowledge extraction and question answering by visual verification of relation phrases. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1456–1464, 2015.
|
| 223 |
+
|
| 224 |
+
Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2556–2565, 2018.
|
| 225 |
+
|
| 226 |
+
Amanpreet Singh, Vedanuj Goswami, Vivek Natarajan, Yu Jiang, Xinlei Chen, Meet Shah, Marcus Rohrbach, Dhruv Batra, and Devi Parikh. Mmf: A multimodal framework for vision and language research. https://github.com/facebookresearch/mmf, 2020a.
|
| 227 |
+
|
| 228 |
+
Amanpreet Singh, Vedanuj Goswami, and Devi Parikh. Are we pretraining it right? digging deeper into visio-linguistic pretraining. arXiv preprint arXiv:2004.08744, 2020b.
|
| 229 |
+
|
| 230 |
+
Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. Vl-bert: Pre-training of generic visual-linguistic representations. arXiv preprint arXiv:1908.08530, 2019.
|
| 231 |
+
|
| 232 |
+
Pat Verga, Haitian Sun, Livio Baldini Soares, and William W Cohen. Facts as experts: Adaptable and interpretable neural memory over symbolic knowledge. arXiv preprint arXiv:2007.00849, 2020.
|
| 233 |
+
|
| 234 |
+
Peng Wang, Qi Wu, Chunhua Shen, Anton van den Hengel, and Anthony Dick. Explicit knowledgebased reasoning for visual question answering. arXiv preprint arXiv:1511.02570, 2015.
|
| 235 |
+
|
| 236 |
+
Peng Wang, Qi Wu, Chunhua Shen, Anthony Dick, and Anton van den Hengel. Fvqa: Fact-based visual question answering. IEEE transactions on pattern analysis and machine intelligence, 40 (10):2413–2427, 2018.
|
| 237 |
+
|
| 238 |
+
Zihao Wang, Xihui Liu, Hongsheng Li, Lu Sheng, Junjie Yan, Xiaogang Wang, and Jing Shao. Camp: Cross-modal adaptive message passing for text-image retrieval. In Proceedings of the IEEE International Conference on Computer Vision, pp. 5764–5773, 2019.
|
| 239 |
+
|
| 240 |
+
Xi Wei, Tianzhu Zhang, Yan Li, Yongdong Zhang, and Feng Wu. Multi-modality cross attention network for image and sentence matching. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10941–10950, 2020.
|
| 241 |
+
|
| 242 |
+
Yiling Wu, Shuhui Wang, Guoli Song, and Qingming Huang. Learning fragment self-attention embeddings for image-text matching. In Proceedings of the 27th ACM International Conference on Multimedia, pp. 2088–2096, 2019.
|
| 243 |
+
|
| 244 |
+
Peter Young, Alice Lai, Micah Hodosh, and Julia Hockenmaier. From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions. Transactions of the Association for Computational Linguistics, 2:67–78, 2014.
|
| 245 |
+
|
| 246 |
+
Zhou Yu, Jun Yu, Yuhao Cui, Dacheng Tao, and Qi Tian. Deep modular co-attention networks for visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6281–6290, 2019.
|
| 247 |
+
|
| 248 |
+
Ying Zhang and Huchuan Lu. Deep cross-modal projection learning for image-text matching. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 686–701, 2018.
|
| 249 |
+
|
| 250 |
+
Zhedong Zheng, Liang Zheng, Michael Garrett, Yi Yang, and Yi-Dong Shen. Dual-path convolutional image-text embedding. corr abs/1711.05535 (2017). arXiv preprint arXiv:1711.05535, 2017.
|
| 251 |
+
|
| 252 |
+
Yuke Zhu, Alireza Fathi, and Li Fei-Fei. Reasoning about object affordances in a knowledge base representation. In European conference on computer vision, pp. 408–424. Springer, 2014.
|
| 253 |
+
|
| 254 |
+
Yuke Zhu, Ce Zhang, Christopher Re, and Li Fei-Fei. Building a large-scale multimodal knowledge ´ base system for answering visual queries. arXiv preprint arXiv:1507.05670, 2015.
|
| 255 |
+
|
| 256 |
+
Yuke Zhu, Joseph J Lim, and Li Fei-Fei. Knowledge acquisition for visual question answering via iterative querying. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1154–1163, 2017.
|
| 257 |
+
|
| 258 |
+
Table 5: Retrieval results for Flickr30K. Top - methods that use raw images as input, and vector representations for the embedding space. Bottom Methods that use detection features or sequence similarity measures.
|
| 259 |
+
|
| 260 |
+
<table><tr><td colspan="3">Text →Image</td><td colspan="3">Image→Text</td><td rowspan="2">R@10</td></tr><tr><td>Method</td><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td></tr><tr><td>RRF</td><td>35.4</td><td>68.3</td><td>79.9</td><td>47.6</td><td>77.4</td><td>87.1</td></tr><tr><td>CMPM</td><td>37.3</td><td>65.7</td><td>75.5</td><td>49.6</td><td>76.8</td><td>86.1</td></tr><tr><td>DPC</td><td>39.1</td><td>69.2</td><td>69.2</td><td>55.6</td><td>81.9</td><td>89.5</td></tr><tr><td>VSE++</td><td>39.6</td><td>69.6</td><td>79.5</td><td>52.9</td><td>79.1</td><td>87.2</td></tr><tr><td>DXR</td><td>50.6</td><td>78.8</td><td>86.7</td><td>65.1</td><td>87.3</td><td>92.6</td></tr><tr><td>TERN</td><td>41.1</td><td>71.9</td><td>81.2</td><td>53.2</td><td>79.4</td><td>86.0</td></tr><tr><td>SCO</td><td>41.1</td><td>70.5</td><td>80.1</td><td>55.5</td><td>82.0</td><td>89.3</td></tr><tr><td>SAEM</td><td>52.4</td><td>81.1</td><td>88.1</td><td>69.1</td><td>91.0</td><td>95.1</td></tr><tr><td>SCAN</td><td>48.6</td><td>77.7</td><td>85.2</td><td>67.4</td><td>90.3</td><td>95.8</td></tr><tr><td>CAMP</td><td>51.5</td><td>77.1</td><td>85.3</td><td>68.1</td><td>89.7</td><td>95.2</td></tr><tr><td>VSRN</td><td>54.7</td><td>81.8</td><td>88.2</td><td>71.3</td><td>90.6</td><td>96.0</td></tr><tr><td>TERAN</td><td>56.5</td><td>81.2</td><td>88.2</td><td>70.8</td><td>90.9</td><td>95.5</td></tr><tr><td>MMCA</td><td>54.8</td><td>81.4</td><td>87.8</td><td>74.2</td><td>92.8</td><td>96.4</td></tr><tr><td>Unicoder-VL</td><td>71.5</td><td>90.9</td><td>94.9</td><td>86.2</td><td>96.3</td><td>99.0</td></tr><tr><td>UNITER</td><td>73.6</td><td>93.0</td><td>95.9</td><td>88.2</td><td>98.4</td><td>99.0</td></tr></table>
|
| 261 |
+
|
| 262 |
+
Table 6: Retrieval results for COCO. Top - methods that use raw images as input, and vector representations for the embedding space. Bottom Methods that use detection features or sequence similarity measures.
|
| 263 |
+
|
| 264 |
+
<table><tr><td></td><td colspan="6">COCO 1K</td><td colspan="6">COCO 5K</td></tr><tr><td></td><td colspan="3">Text →Image</td><td colspan="3">Image→ Text</td><td colspan="3">Text → Image</td><td colspan="3">Image-→ Text</td></tr><tr><td>Method</td><td></td><td></td><td>R@1 R@5 R@10</td><td></td><td></td><td>R@1 R@5 R@10</td><td>R@1 R@5 R@10</td><td></td><td></td><td>R@1 R@5 R@10</td><td></td><td></td></tr><tr><td>DPC</td><td>47.1</td><td>79.9</td><td>90.0</td><td>65.6</td><td>89.8</td><td>95.5</td><td>25.3</td><td>53.4</td><td>66.4</td><td>41.2</td><td>70.5</td><td>81.1</td></tr><tr><td>VSE++</td><td>52.0</td><td>83.1</td><td>92.0</td><td>64.6</td><td>89.1</td><td>95.7</td><td>30.3</td><td>59.1</td><td>72.4</td><td>41.3</td><td>69.2</td><td>81.2</td></tr><tr><td>CMPM</td><td>44.6</td><td>78.8</td><td>89.0</td><td>56.1</td><td>86.3</td><td>92.9</td><td>22.9</td><td>50.2</td><td>63.8</td><td>31.1</td><td>60.7</td><td>73.9</td></tr><tr><td>DXR</td><td>56.8</td><td>88.2</td><td>94.9</td><td>67.0</td><td>93.0</td><td>97.6</td><td>33.9</td><td>64.9</td><td>77.4</td><td>44.9</td><td>75.2</td><td>84.7</td></tr><tr><td>TERN</td><td>51.9</td><td>85.6</td><td>93.6</td><td>63.7</td><td>90.5</td><td>96.2</td><td>28.7</td><td>59.7</td><td>72.7</td><td>38.4</td><td>69.5</td><td>81.3</td></tr><tr><td>SCO</td><td>56.7</td><td>87.5</td><td>94.8</td><td>69.9</td><td>92.9</td><td>97.5</td><td>33.1</td><td>62.9</td><td>75.5</td><td>42.8</td><td>72.3</td><td>83.0</td></tr><tr><td>SAEM</td><td>57.8</td><td>88.6</td><td>94.9</td><td>71.2</td><td>94.1</td><td>97.7</td><td>1</td><td>-</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>SCAN</td><td>58.8</td><td>88.4</td><td>94.8</td><td>72.7</td><td>94.8</td><td>98.4</td><td>38.6</td><td>69.3</td><td>80.4</td><td>50.4</td><td>82.2</td><td>90.0</td></tr><tr><td>CAMP</td><td>58.5</td><td>87.9</td><td>95.0</td><td>72.3</td><td>94.8</td><td>98.3</td><td>39.0</td><td>68.9</td><td>80.2</td><td>50.1</td><td>82.1</td><td>89.7</td></tr><tr><td>VSRN</td><td>62.8</td><td>89.7</td><td>95.1</td><td>76.2</td><td>94.8</td><td>98.2</td><td>40.5</td><td>70.6</td><td>81.1</td><td>53.0</td><td>81.1</td><td>89.4</td></tr><tr><td>TERAN</td><td>65.0</td><td>91.2</td><td>96.4</td><td>77.7</td><td>95.9</td><td>98.6</td><td>42.6</td><td>72.5</td><td>82.9</td><td>55.6</td><td>83.9</td><td>91.6</td></tr><tr><td>MMCA</td><td>61.6</td><td>89.8</td><td>95.2</td><td>74.8</td><td>95.6</td><td>97.7</td><td>38.7</td><td>69.7</td><td>80.8</td><td>54.0</td><td>82.5</td><td>90.7</td></tr><tr><td>Unicoder-VL</td><td>69.7</td><td>93.5</td><td>97.2</td><td>84.3</td><td>97.3</td><td>99.3</td><td>46.7</td><td>76.0</td><td>85.3</td><td>62.3</td><td>87.1</td><td>92.8</td></tr><tr><td>UNITER</td><td>1</td><td>=</td><td>1</td><td>1</td><td>=</td><td>1</td><td>51.7</td><td>78.4</td><td>86.9</td><td>66.6</td><td>89.4</td><td>94.2</td></tr><tr><td>Oscar</td><td>78.2</td><td>95.8</td><td>98.3</td><td>89.8</td><td>98.8</td><td>99.7</td><td>57.5</td><td>82.8</td><td>89.8</td><td>73.5</td><td>92.2</td><td>96.0</td></tr></table>
|
| 265 |
+
|
| 266 |
+
# A RETRIEVAL
|
| 267 |
+
|
| 268 |
+
Tab. 6 shows a complete comparison of the different alignment methods in the cross-modal alignment literature. The top part corresponds to methods which use vector representations, grid-features, and do not share information between the modality branches. The bottom part shows the rest of the methods.
|