ZHANGYUXUAN-zR commited on
Commit
e606aa7
·
verified ·
1 Parent(s): 69311c1

Add files using upload-large-folder tool

Browse files
parse/train/BywyFQlAW/BywyFQlAW.md ADDED
@@ -0,0 +1,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MINIMAX CURRICULUM LEARNING:MACHINE TEACHING WITH DESIRABLE DIFFICULTIESAND SCHEDULED DIVERSITY
2
+
3
+ Tianyi Zhou & Jeff Bilmes University of Washington, Seattle {tianyizh,bilmes}@uw.edu
4
+
5
+ # ABSTRACT
6
+
7
+ We introduce and study minimax curriculum learning (MCL), a new method for adaptively selecting a sequence of training subsets for a succession of stages in machine learning. The subsets are encouraged to be small and diverse early on, and then larger, harder, and allowably more homogeneous in later stages. At each stage, model weights and training sets are chosen by solving a joint continuousdiscrete minimax optimization, whose objective is composed of a continuous loss (reflecting training set hardness) and a discrete submodular promoter of diversity for the chosen subset. MCL repeatedly solves a sequence of such optimizations with a schedule of increasing training set size and decreasing pressure on diversity encouragement. We reduce MCL to the minimization of a surrogate function handled by submodular maximization and continuous gradient methods. We show that MCL achieves better performance and, with a clustering trick, uses fewer labeled samples for both shallow and deep models. Our method involves repeatedly solving constrained submodular maximization of an only slowly varying function on the same ground set. Therefore, we develop a heuristic method that utilizes the previous submodular maximization solution as a warm start for the current submodular maximization process to reduce computation while still yielding a guarantee.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Inspired by the human interaction between teacher and student, recent studies (Khan et al., 2011; Basu & Christensen, 2013; Spitkovsky et al., 2009) support that learning algorithms can be improved by updating a model on a designed sequence of training sets, i.e., a curriculum. This problem is addressed in curriculum learning (CL) (Bengio et al., 2009), where the sequence is designed by a human expert or heuristic before training begins. Instead of relying on a teacher to provide the curriculum, self-paced learning (SPL) (Kumar et al., 2010; Tang et al., 2012a; Supancic III & Ramanan, 2013; Tang et al., 2012b) chooses the curriculum during the training process. It does so by letting the student (i.e., the algorithm) determine which samples to learn from based on their hardness. Given a training set $\mathcal { D } = \{ ( \bar { x } _ { 1 } , y _ { 1 } ) , \dots , ( x _ { n } , y _ { n } ) \}$ of $n$ samples and loss function $L ( y _ { i } , f ( x _ { i } , w ) )$ , where $x _ { i } \in \mathbb { R } ^ { m }$ represents the feature vector for the $i ^ { t h }$ sample, $y _ { i }$ is its label, and $f ( x _ { i } , w )$ is the predicted label provided by a model with weight $w$ , SPL performs the following:
12
+
13
+ $$
14
+ \operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } \operatorname* { m i n } _ { \nu \in [ 0 , 1 ] ^ { n } } \left[ \sum _ { i = 1 } ^ { n } \nu _ { i } L \left( y _ { i } , f ( x _ { i } , w ) \right) - \lambda \sum _ { i = 1 } ^ { n } \nu _ { i } \right] .
15
+ $$
16
+
17
+ SPL jointly learns the model weights $w$ and sample weights $\nu$ , which end up being 0-1 indicators of selected samples, and it does so via alternating minimization. Fixing $w$ , minimization w.r.t. $\nu$ selects samples with loss $L ( y _ { i } , f ( x _ { i } , w ) ) < \lambda$ , where $\lambda$ is a “hardness parameter” as it corresponds to the hardness as measure by the current loss (since with large $\lambda$ , samples with greater loss are allowed in). Self-paced curriculum learning (Jiang et al., 2015) introduces a blending of “teacher mode” in CL and “student mode” in SPL, where the teacher can define a region of $\nu$ by attaching a linear constraint a negative group $a ^ { T } \nu \leq c$ to Eq. (1). SPL wegularization term $\begin{array} { r } { - \gamma \| \nu \| _ { 2 , 1 } \triangleq - \gamma \sum _ { j = 1 } ^ { b } \| \nu ^ { ( j ) } \| _ { 2 } } \end{array}$ ., 2014), adds to Eq. (1), where the samples are divided into $b$ groups beforehand and $\nu ^ { ( j ) }$ is the weight vector for the $j ^ { t h }$ group. Samples coming from different groups are thus preferred, to the extent that $\gamma > 0$ is large.
18
+
19
+ CL, SPL, and SPLD can be seen as a form of continuation scheme (Allgower & Georg, 2003) that handles a hard task by solving a sequence of tasks moving from easy to hard; the solution to each task is the warm start for the next slightly harder task. That is, each task, in the present case, is determined by the training data subset and other training hyperparameters, and the resulting parameters at the end of a training round are used as the initial parameters for the next training round. Such continuation schemes can reduce the impact of local minima within neural networks (Bengio et al., 2013; Bengio, 2014). With SPL, after each round of alternating minimization to optimize Eq. (1), $\lambda$ is increased so that the next round selects samples that have a larger loss, a process (Khan et al., 2011; Tang et al., 2012b; Basu & Christensen, 2013) that can both help avoid local minima and reduce generalization error. In SPLD, $\gamma$ is also increased between training rounds, increasingly preferring diversity. In each case, each round results in a fully trained model for the currently selected training samples.
20
+
21
+ Selection of training samples has been studied in other settings as well, often with a different motivation. In active learning (AL) (Settles, 2010) and experimental design (Montgomery, 2006), the learner can actively query labels of samples from an unlabeled pool during the training process, and the goal is to reduce annotation costs. The aim is to achieve the same or better performance using fewer labeled samples by ruling out uninformative ones. Diversity modeling was introduced to AL in (Wei et al., 2015). It uses submodular maximization to select diverse training batches from the most uncertain samples. However, changing the diversity during the learning process has not been investigated as far as we know. In boosting (Schapire, 1990; Freund & Schapire, 1997), the goal is to learn an ensemble of weak classifiers sequentially; it does this by assigning weights to all samples, with larger weights given to samples having larger loss measured by an aggregation of previously trained models. Both active learning and boosting favor samples that are difficult to predict, since they are the most informative to learn. For example, uncertainty sampling (Culotta & McCallum, 2005; Scheffer et al., 2001; Dagan & Engelson, 1995; Dasgupta & Hsu, 2008) selects samples that are most uncertain, while query by committee (Seung et al., 1992; Dagan & Engelson, 1995; Abe & Mamitsuka, 1998) selects the ones that multiple models most disagree on. With machine teaching (Khan et al., 2011; Zhu, 2015; Patil et al., 2014; Zhu et al., 2018), a separate teacher helps the training procedure find a good model.
22
+
23
+ The SPL approach starts with a smaller set of easy samples and gradually increases the difficulty of the chosen samples as measured by the sample loss of the model produced by previous round’s training. One of the difficulties of this approach is the following: since for any given value of $\lambda$ the relatively easiest samples are chosen, there is a good chance that the process can repeatedly select a similar training set over multiple rounds and therefore can learn slowly. This is precisely the problem that SPLD address — by concomitantly increasing the desired diversity over rounds, the sample selection procedure chooses from an increasingly diverse set of different groups, as measured by $\| \nu \| _ { 2 , 1 }$ . Therefore, in SPLD, early stages train on easier not necessarily diverse samples and later stages train on harder more diverse samples.
24
+
25
+ There are several challenges remaining with SPLD, however. One is that in early stages, it is still possible to repeatedly select a similar training set over multiple rounds since diversity might not increase dramatically between successive rounds. Potentially more problematically, it is not clear that having a large diversity selection weight in late stages is desirable. For example, with a reasonably trained model, it might be best to select primarily the hardest samples in the part of the space near the difficult regions of the decision boundaries. With a high diversity weight, samples in these difficult decision boundary regions might be avoided in favor of other samples perhaps already well learnt and having a large margin only because they are diverse, thereby leading to wasted effort. At such point, it would be beneficial to choose points having small margin from the same region but that might not have the greatest diversity, especially when using only a simple notion of diversity such as the group sparse norm $\lVert \boldsymbol { v } \rVert _ { 2 , 1 }$ . Also, it is possible that late stages of learning can select outliers only because they are both hard and diverse. Lastly, the SPL/SPLD min-min optimization involves minimizing a lower bound of the loss, while normally one would, if anything, wish to minimize the loss directly or at least an upper bound.
26
+
27
+ Motivated by these issues, we introduce a new form of CL that chooses the hardest diverse samples in early rounds of training and then actually decreases, rather than increases, diversity as training rounds proceed. Our contention is that diversity is more important during the early phases of training when only relatively few samples are selected. Later rounds of training will naturally have more diversity opportunity simply because the size of the selected samples is much larger. Also, to avoid successive rounds selecting similar sets of samples, our approach selects the hardest, rather than the easiest, samples at each round. Hence, if a set of samples is learnt well during one training round, those samples will tend to be ill-favored in the next round because they become easier. We also measure hardness via the loss function, but the selection is always based on the hardest and most diverse samples of a given size $k$ , where the degree of diversity is controlled by a parameter $\lambda$ , and where the group sparse norm is also submodular where diversity is measured by an arbitrary non-monotone submodular function. In fact, for binary variables $\textstyle \| \nu \| _ { 2 , 1 } = \sum _ { j = 1 } ^ { b } { \sqrt { | C _ { j } \cap A | } } = F ( A )$ where $A$ is the set for which $\nu$ is the characteristic vector, and $C _ { j }$ is the set of samples in the $j ^ { \mathrm { t h } }$ group. Our approach allows the full expressive class of submodular functions to be used to measure diversity since the selection phases is based on submodular optimization.
28
+
29
+ Evidence for the naturalness of such hardness and diversity adjustment in a curriculum can also be found in human education. For example, courses in primary school usually cover a broad, small, and relatively easy range of topics, in order to expose the young learner to a diversity of knowledge early on. In college and graduate school, by contrast, students focus on advanced deeper knowledge within their majors. As another example, studies of bilingualism (Bialystok et al., 2012; Li et al., 2014; Mechelli et al., 2004; Kovacs & Mehler, 2009) show that learning multiple languages in childhood is ´ beneficial for future brain development, but early-age multi-lingual learning is usually not advanced or concentrated linguistically for any of the languages involved. Still other studies argue that difficulty can be desired at early human learning stages (Bjork & Bjork, 1992; McDaniel & Butler, 2011).
30
+
31
+ # 1.1 OUR APPROACH: MINIMAX CURRICULUM LEARNING
32
+
33
+ We introduce a new form of curriculum learning called minimax curriculum learning (MCL). MCL increases desired hardness and reduces diversity encouragement over rounds of training. This is accomplished by solving a sequence of minimax optimizations, each of which having the form:
34
+
35
+ $$
36
+ \operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( A ) .
37
+ $$
38
+
39
+ The objective is composed of the loss on a subset $A$ of samples evaluating their hardness and a normalized monotone non-decreasing submodular function $\Dot { F : } 2 ^ { V } \to \mathbb { R _ { + } }$ measuring $A$ ’s diversity, where $V$ is the ground set of all available samples. A larger loss implies that the subset $A$ has been found harder to learn, while a larger $F ( A )$ indicates greater diversity. The weight $\lambda$ controls the trade-off between hardness and diversity, while $k$ , the size of the resulting $A$ , determines the number of samples to simultaneously learn and hence is a hardness parameter.
40
+
41
+ It is important to realize that $F ( A )$ is not a parameter regularizer (e.g., $\ell _ { 1 }$ or $\ell _ { 2 }$ regularization on the parameters $w$ ) but rather an expression of preference for a diversity of training samples. In practice, one would add to Eq. (2) an appropriate parameter regularizer as we do in our experiments (Section 3).
42
+
43
+ Like SPL/SPLD, learning rounds are scheduled, here each round with increasing $k$ and decreasing $\lambda$ . Unlike SPL/SPLD, we explicitly schedule the number of selected samples via $k$ rather than indirectly via a hardness parameter. This makes sense since we are always choosing the hardest $k$ samples at a given $\lambda$ diversity preference, so there is no need for an explicit real-valued hardness parameter as in SPL/SPLD. Also, the MCL optimization minimizes an upper bound of the loss on any size $k$ subset of training samples.
44
+
45
+ The function $F ( \cdot )$ may be chosen from the large expressive family of submodular functions, all of which are natural for measuring diversity, and all having the following diminishing returns property: given a finite ground set $V$ , and any $A \subseteq B \subseteq V$ and a $v \not \in B$ ,
46
+
47
+ This implies $v$ is no less valuable to the smaller set $A$ than to the larger set $B$ . The marginal gain of $v$ conditioned on $A$ is denoted $f ( v | A ) \triangleq f ( v \cup A ) - f ( A )$ and reflects the importance of $v$ to $A$ . Submodular functions (Fujishige, 2005) have been widely used for diversity models (Lin et al., 2009; Lin & Bilmes, 2011; Batra et al., 2012; Prasad et al., 2014; Gillenwater et al., 2012; Iyer & Bilmes, 2015; Bilmes & Bai, 2017).
48
+
49
+ Although Eq. (2) is a hybrid optimization involving both continuous variables $w$ and discrete variables $A$ , it can be reduced to the minimization of a piecewise function, where each piece is defined by a subset $A$ achieving the maximum in a region around $w$ . Each piece is convex when the loss is convex, so various off-the-shelf algorithms can be applied once $A$ has been computed. However, the number of possible sets $A$ is $\textstyle { \binom { n } { k } }$ , and enumerating them all to find the maximum is intractable. Thanks to submodularity, fast approximate algorithms (Nemhauser et al., 1978; Minoux, 1978; Mirzasoleiman et al., 2015) exist to find an approximately optimal $A$ . Therefore, the outer optimization over $w$ will need to minimize an approximation of the piecewise function defined by an approximate $A$ computed via submodular maximization.
50
+
51
+ # 2 MINIMAX CURRICULUM LEARNING AND MACHINE TEACHING
52
+
53
+ The minimax problem in Eq. (2) can be seen as a two-person zero-sum game between a teacher (the maximizer) and a student (the minimizer): the teacher chooses training set $A$ based on the student’s feedback about the hardness (i.e., the loss achieved by current model $w$ ) and how diverse according to the teacher $( \lambda F ( A ) )$ , while the student updates $w$ to reduce the loss on training set $A$ (i.e., learn $A$ ) given by the teacher. Similar teacher-student interaction also exist in real life. In addition, the teacher usually introduces concepts at the beginning and asks a small number of easy questions from a diverse range of topics and receives feedback from the student, and then further trains the student on the topics the student finds difficult while eschewing topics the student has mastered.
54
+
55
+ MCL’s minimax formulation is different from the min-min formulation used in SPL/SPLD. For certain losses and models, $L ( y _ { i } , f ( x _ { i } , w ) )$ is convex in $w$ . The min-min formulation, however, is only bi-convex and requires procedures such as alternative convex search (ACS) as in (Bazaraa et al., 1993). Furthermore, diversity regularization of $\nu$ in SPLD leads to the loss of bi-convexity altogether.
56
+
57
+ Minimizing the worst case loss, as in MCL, is a widely used strategy in machine learning (Lanckriet et al., 2003; Farnia & Tse, 2016; Shalev-Shwartz & Wexler, 2016) to achieve better generalization performance and model robustness, especially when strong assumptions cannot be made about the data distribution. Compared to SPL/SPLD, MCL is also better in that the outer minimization over $w$ in Eq. (2) is a convex program, and corresponds to minimizing the objective $g ( w )$ in Eq. (4). On the other hand, querying $g ( w )$ requires submodular maximization which can only be solved approximately.
58
+
59
+ The goal of this section, therefore, is to address the minimax problem in Eq. (2), i.e., the minimization $\operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } g ( w )$ of the following objective $g ( w )$ .
60
+
61
+ $$
62
+ g ( w ) \triangleq \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( A )
63
+ $$
64
+
65
+ If the loss function $L ( y _ { i } , f ( x _ { i } , w ) )$ is convex w.r.t. $w$ , then $g ( w )$ is convex but, as mentioned above, enumerating all subsets is intractable. Defining the discrete objective $G _ { w } : 2 ^ { V } \to \mathbb { R } _ { + }$ where
66
+
67
+ $$
68
+ G _ { w } ( A ) \triangleq \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( A ) .
69
+ $$
70
+
71
+ shows that computing $g ( w )$ in involves a discrete optimization over $G _ { w } ( A )$ , a problem that is submodular since $G _ { w } ( A )$ is weighted sum of a non-negative (since loss is non-negative) modular and a submodular function, and thus $G _ { w }$ is monotone non-decreasing submodular. Thus, the fast greedy procedure mentioned earlier can be used to approximately optimizes $G _ { w } ( A )$ for any $w$ .
72
+
73
+ Let $\hat { A } _ { w } \subseteq V$ be the $k$ -constrained greedy approximation to maximizing $G _ { w } ( A )$ . We define the following approximate objective:
74
+
75
+ $$
76
+ \hat { g } ( w ) \triangleq \sum _ { i \in \hat { A } _ { w } } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( \hat { A } ) ,
77
+ $$
78
+
79
+ and note that it satisfies $\alpha g ( w ) \leq \hat { g } ( w ) \leq g ( w )$ where $\alpha$ is the approximation factor of submodular optimization. For $\tilde { w }$ within a region around $w$ , $\hat { g } ( \tilde { w } )$ will utilize the same set $\hat { A } _ { w }$ . Therefore, $\hat { g } ( w )$ is piecewise convex, if the loss function $L ( y _ { i } , f ( x _ { i } , w ) )$ is convex w.r.t. $w$ , and different regions of within $\mathbb { R } ^ { m }$ are associated with different $\hat { A }$ although not necessarily the same regions or sets that define $g ( w )$ . We show in Section 2.2 that minimizing $\hat { g } ( w )$ offers an approximate solution to Eq. (2).
80
+
81
+ With $\hat { g } ( w )$ given, our algorithm is simply gradient descent for minimizing $\hat { g } ( w )$ , where many off-the-shelf methods can be invoked, e.g., SGD, momentum methods, Nesterov’s accelerated gradient (Nesterov, 2005), Adagrad (Duchi et al., 2011), etc. The key problem is how to obtain $\hat { g } ( w )$ , which depends on suboptimal solutions in different regions of $w$ . It is not necessary, however, to run submodular maximization for every region of $w$ . Since we use gradient descent, we only need to know $\hat { g } ( w )$ for $w$ on the optimization path. At the beginning of each iteration, we fix $w$ and use submodular maximization to achieve the $\hat { A } _ { w }$ that defines $\hat { g } ( w )$ . Then a gradient update step is applied to $\hat { g } ( w )$ . Let $A _ { w } ^ { \ast }$ represent the optimal solution to Eq. (5), then $\hat { A } _ { w }$ satisfies $G ( { \hat { A } } ) \geq \alpha G ( A ^ { * } )$ .
82
+
83
+ # Algorithm 1 Minimax Curriculum Learning (MCL)
84
+
85
+ 1: input: $\pi ( \cdot , \eta )$ , $\gamma , p , \Delta , \tilde { \alpha }$
86
+ 2: output: $w _ { T } ^ { 0 }$
87
+ 3: initialize: $\tau \gets 1$ , $w _ { \tau } ^ { 0 }$ , λ , k ,
88
+ 4: while not “converged” do
89
+ 5: for $t \in \{ 0 , \cdots , \bar { p } \}$ do
90
+ 6: $\begin{array} { r } { G ( A ) \gets \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w _ { \tau } ^ { t } ) \right) + \lambda F ( A ) \colon } \end{array}$
91
+ 7: Aˆ ← WS-SUBMODULARMAX(G, k, A,ˆ α˜);
92
+ 8: $\begin{array} { r } { \nabla \hat { g } ( w _ { \tau } ^ { t } ) = \frac { \partial } { \partial w } \sum _ { i \in \hat { A } } L \left( y _ { i } , f ( x _ { i } , w _ { \tau } ^ { t } ) \right) } \end{array}$ ;
93
+ 9: $\boldsymbol { w } _ { \tau } ^ { t + 1 } \boldsymbol { w } _ { \tau } ^ { t } + \pi ( \{ \boldsymbol { w } _ { \tau } ^ { 1 : t } \} , \{ \boldsymbol { \nabla } \hat { g } ( \boldsymbol { w } _ { \tau } ^ { 1 : t } ) \} , \eta )$ ;
94
+ 10: end for
95
+ 11: $w _ { \tau + 1 } ^ { 0 } w _ { \tau } ^ { p }$ , $\lambda ( 1 - \gamma ) \cdot \lambda , k k + \Delta , \tau \tau + 1 ;$
96
+ 12: end while
97
+
98
+ Algorithm 1 details MCL. Lines 5-10 solve the optimization in Eq. (2) with $\lambda$ and $k$ scheduled in line 11. Lines 6-7 finds an approximate $\hat { A }$ via submodular maximization, discussed further in Section 2.1. Lines 8-9 update $w$ for the current $\hat { A }$ by gradient descent $\pi ( \cdot , \eta )$ with learning rate $\eta$ . The inner optimization stops after $p$ steps and then $\lambda$ is reduced by factor $1 - \gamma$ where $\gamma \in [ 0 , 1 ]$ and $k$ is increased by $\Delta$ . The outer optimization stops after $T$ steps when a form of “convergence”, described below, is achieved. Given $\hat { A } _ { w } , \hat { g } ( w )$ has gradient
99
+
100
+ $$
101
+ \nabla \widehat { g } ( w ) = \frac { \partial } { \partial w } \sum _ { i \in \widehat { A } _ { w } } L \left( y _ { i } , f ( x _ { i } , w ) \right) ,
102
+ $$
103
+
104
+ and thus gradient descent method can update $w$ . For example, we can treat $\hat { A }$ as a batch if $k$ is small, and update $w$ by $w w - \eta \nabla \hat { g } ( w )$ with learning rate $\eta$ . For large $\hat { A } _ { w }$ , we can use SGD that applies an update rule to mini-batches within $\hat { A } _ { w }$ . More complex gradient descent rules $\pi ( \cdot , \eta )$ can take historical gradients and $w _ { \tau } ^ { t }$ ’s into account leading to $\boldsymbol { w } ^ { t + 1 } \boldsymbol { w } ^ { t } + \pi ( \{ \boldsymbol { w } ^ { 1 : t } \} , \{ \nabla \hat { g } ( \boldsymbol { w } ^ { 1 : t } ) \} , \eta )$ .
105
+
106
+ Considering the outer loop as well, the algorithm approximately solves a sequence of Eq. (2)s with decreasing $\lambda$ and increasing $k$ , where the previous solutions act as a warm start for the next iterations. This corresponds to repeatedly updating the model $w$ on a sequence of training sets $\hat { A }$ that changes from small, diverse, and hard to large.
107
+
108
+ # 2.1 SUBMODULAR MAXIMIZATION
109
+
110
+ Although solving Eq. (5) exactly is NP-hard, a near-optimal solution can be achieved by the greedy algorithm, which offers a worst-case approximation factor of $\alpha = 1 - e ^ { - 1 }$ (Nemhauser et al., 1978). The algorithm starts with $A \emptyset$ , and selects next the element with the largest marginal gain $f ( v | A )$ from $\bar { V } \backslash A$ , i.e., $A A \cup \{ v ^ { * } \}$ where $v ^ { * } \in \mathrm { a r g m a x } _ { v \in V \setminus A } f ( v | A )$ , and this repeats until $| A | = k$ . It is simple to implement, fast, and usually outperforms other methods, e.g., those based on integer linear programming. It requires $\mathcal { O } ( n k )$ function evaluations for ground set size $| V | = n$ . Since Algorithm 1 runs greedy $T p$ times, it is useful for the greedy procedure to be as fast as possible. The accelerated, or lazy, greedy algorithm (Minoux, 1978) reduces the number of evaluations per step by updating a priority queue of marginal gains, while having the same output and guarantee as the original (thanks to submodularity) and offers significant speedups. Still faster variants are also available Mirzasoleiman et al. (2015; 2016). Our own implementation takes advantage of the fact that line 7 of Algorithm 1 repeatedly solves submodular maximization over a sequence of submodular functions that are changing only slowly, and hence the previous set solution can be used as a warm start for the current algorithm, a process we call WS-SUBMODULARMAX outlined in Algorithm 2.
111
+
112
+ The greedy procedure offers much better approximation factors than $1 - e ^ { - 1 }$ when the objective $G ( A )$ is close to modular. Specifically, the approximation factor becomes $\alpha = ( 1 - e ^ { - \kappa _ { G } } ) / \kappa _ { G }$ (Conforti & Cornuejols, 1984), which depends on the curvature $\kappa _ { G } \in [ 0 , 1 ]$ of $G ( A )$ defined as
113
+
114
+ $$
115
+ \kappa _ { G } \triangleq 1 - \operatorname* { m i n } _ { j \in V } \frac { G ( j | V \backslash j ) } { G ( j ) } .
116
+ $$
117
+
118
+ When $\kappa _ { G } = 0$ , $G$ is modular, and when $\kappa _ { G } = 1$ , $G$ is fully curved and the above bound recovers $1 - e ^ { - 1 }$ . $G ( A )$ becomes more modular as the outer loop proceeds since $\lambda$ decreases. Therefore, the approximation improves with the number of outer loops. In fact, we have:
119
+
120
+ Lemma 1. Let $G ( A ) = L ( A ) + \lambda F ( A )$ where $F$ is a monotone non-decreasing submodular function with curvature $\kappa _ { F }$ , $L$ is a non-negative modular function, and $\lambda \geq 0$ . Then $\kappa _ { G } \leq \kappa _ { F } / ( c _ { 1 } / \lambda + 1 )$ where $c _ { 1 } = \operatorname* { m i n } _ { j \in V } L ( j ) / F ( j )$ .
121
+
122
+ The proof is given in Appendix 4.1. In MCL, therefore, the submodular approximation improves $( \alpha 1 )$ ) as $\lambda$ grows, and the surrogate function $\hat { g } ( w )$ correspondingly approaches the true convex objective $g ( w )$ .
123
+
124
+ # 2.2 CONDITIONS AT CONVERGENCE
125
+
126
+ In this section, we study how close the solution $\hat { w }$ is of applying gradient descent to $\hat { g } ( w )$ , where we assume $p$ is large enough so that a form of convergence occurs. Specifically, in Theorem 1, we analyze the upper bound on $\lVert \hat { w } - w ^ { * } \rVert _ { 2 } ^ { 2 }$ based on two assumptions: 1) the loss $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ being $\beta$ -strongly convex w.r.t. $w$ ; and 2) $\hat { w }$ is achieved by running gradient descent in lines 6-9 of Algorithm 1 until convergence, defined as the gradient reaching zero. In case the loss $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ is convex but not $\beta$ -strongly convex, a commonly used trick to modify it to $\beta$ -strongly convex is to add an $\ell _ { 2 }$ regularization $( \beta / 2 ) \| w \| _ { 2 } ^ { 2 }$ . In addition, for non-convex $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ , it is possible to prove that with high probability, a noise perturbed SGD on $\hat { g } ( w )$ can hit an $\epsilon$ -optimal local solution of $g ( w )$ in polynomial time — we leave this for future work. In our empirical study (Section 3), MCL achieves good performance even when applied to non-convex deep neural networks. The following theorem relies on the fact that the maximum of multiple $\beta$ -strongly convex functions is also $\beta$ -strongly convex, shown in Appendix 4.2.
127
+
128
+ Theorem 1 (Inner-loop convergence). For the minimax problem in Eq. (2) with ground set of samples $V$ and $\lambda \geq 0$ , if the loss function $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ is $\beta$ -strongly convex and $| V | \geq k$ , running lines $^ { 6 - 9 }$ of Algorithm $^ { l }$ until convergence (defined as the gradient reaching zero) yields a solution $\hat { w }$ satisfying
129
+
130
+ $$
131
+ \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 } { k \beta } \left( \frac { 1 } { \alpha } - 1 \right) \cdot g ( w ^ { * } ) ,
132
+ $$
133
+
134
+ $\hat { w }$ is the solution achieved at convergence, $w ^ { * }$ is the optimal solution of the minimax problem in Eq.(2), $g ( w ^ { * } )$ is the objective value achieved on $w ^ { * }$ , and $\alpha$ is the approximation factor that submodular maximization can guarantee for $G ( A )$ .
135
+
136
+ The proof is given in Appendix 4.3.
137
+
138
+ It is interesting to note that the bound depends both on the strong convexity parameter $\beta$ and on the submodular maximization approximation $\alpha$ . As mentioned in Lemma 1, as $\lambda$ gets smaller, the approximation factor $\alpha$ approaches 1 meaning that the bound in Equation (9) improves.
139
+
140
+ We mention the convergence criteria where the gradient reaches zero. While it is possible, in theory, for lines 6-9 of Algorithm 1 to oscillate amongst the non-differentiable boundaries between the convex pieces, with most damped learning rates, this will eventually subside and the algorithm will remain within one convex piece. The reason for this is line 7 of the algorithm always chooses one $\hat { A }$ thereby selecting one convex piece associated with the region around $w _ { \tau } ^ { t }$ , and with only small subsequent adjustments to $w _ { \tau } ^ { t }$ , the same $\hat { A }$ will continue to be selected. Hence, the algorithm will, in such case, reach the minimum of that convex piece where the gradient is zero.
141
+
142
+ We can restate and then simplify the above bound in terms of the resulting parameters, and corresponding $\lambda , k$ values, used at a particular iteration $\tau$ of the outer loop. In the following, $\hat { w } _ { \tau }$ is the solution achieved by Algorithm 1 at the iteration $\tau$ of the outer loop, and the optimal solution of the minimax problem in Eq.(2) with $\lambda , k$ set as in iteration $\tau$ is denoted $w _ { T } ^ { * }$ .
143
+
144
+ Corollary 1. If the loss function $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ is $\beta$ -strongly convex, the submodular function $F ( \cdot )$ has curvature $\kappa _ { F }$ , and if each inner-loop in Algorithm $^ { l }$ runs until convergence, then the solution $\hat { w } _ { \tau }$ at the end of the $\tau ^ { t h }$ iteration of the outer-loop fulfills:
145
+
146
+ $$
147
+ \| \hat { w } _ { \tau } - w _ { \tau } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } } { k \beta ( c _ { 1 } / \lambda + 1 ) } g ( w _ { \tau } ^ { * } ) \leq \frac { 2 \kappa _ { F } } { \beta c _ { 1 } } \times \frac { \lambda } { k } \times g ( w _ { \tau } ^ { * } ) ,
148
+ $$
149
+
150
+ where $\boldsymbol { w } _ { \tau } ^ { * }$ is the optimal solution of the minimax problem in Eq. (2) with $\lambda$ set as in the $\tau ^ { t h }$ outer loop iteration.
151
+
152
+ Thus, if $k$ starts from $k _ { 0 }$ and linearly increases via $k \gets k + \Delta$ (as in line $1 l$ of Algorithm alg:mcl),
153
+
154
+ $$
155
+ \| \hat { w } _ { \tau } - w _ { \tau } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } \lambda _ { 0 } } { \beta c _ { 1 } } \times \frac { ( 1 - \gamma ) ^ { \tau } } { ( k _ { 0 } + \tau \Delta ) } \times \left[ g ( w _ { \infty } ^ { * } ) + \lambda _ { 0 } c _ { 2 } ( 1 - \gamma ) ^ { \tau } \right] ,
156
+ $$
157
+
158
+ Otherwise, if $k$ increases exponentially, i.e., $k \gets ( 1 + \Delta ) \cdot k$ ,
159
+
160
+ $$
161
+ \| \hat { w } _ { \tau } - w _ { \tau } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } \lambda _ { 0 } } { \beta c _ { 1 } k _ { 0 } } \times \left( \frac { 1 - \gamma } { 1 + \Delta } \right) ^ { \tau } \times \left[ g ( w _ { \infty } ^ { * } ) + \lambda _ { 0 } c _ { 2 } ( 1 - \gamma ) ^ { \tau } \right] .
162
+ $$
163
+
164
+ In the above, $\lambda _ { 0 }$ and $k _ { 0 }$ are the initial values for $\lambda$ and $\begin{array} { r l r l } { k , } & { { } \ c _ { 1 } } & { } & { { } = } \end{array}$ $\begin{array} { r l } { \operatorname* { m i n } _ { j \in V , t \in [ 1 , \tau ] } [ L \left( y _ { i } , f ( x _ { i } , \hat { w } _ { \tau } ^ { t } ) \right) / F ( j ) ] , } \end{array}$ , c $\begin{array} { r l r } { \mathrm { ~ \ T ~ _ { 2 } ~ } } & { { } = } & { \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } F ( A ) } \end{array}$ , and $g ( w _ { \infty } ^ { * } )$ $\begin{array} { r } { \operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) . } \end{array}$ .
165
+
166
+ The proof can be found in Appendix 4.5. On the one hand, the upper bound above is in terms of the ratio $\lambda / k$ which improves with larger subset sizes. On the other hand, submodular maximization becomes more expensive with $k$ . Hence, Algorithm 1 chooses a schedule to decrease $\lambda$ exponentially and increase $k$ only linearly. Also, we see that the bound is dependent on the submodular curvature $\kappa _ { F }$ , the strongly-convex constant $\beta$ , and $c _ { 1 }$ which relates the submodular and modular terms (similar to as in Lemma 1). These quantities $( \kappa _ { F } / \beta$ and $c _ { 1 }$ ) might be relevant for other convex-submodular optimization schemes.
167
+
168
+ # 2.3 HEURISTIC IMPROVEMENTS
169
+
170
+ There are several heuristic improvements we employ that are described next.
171
+
172
+ Algorithm 1 stops gradient descent after $p$ steps. A reason for doing this is that $\hat { w } ^ { p }$ can be sufficient as a warm-start for the next iteration if $p$ is large enough. We also have not observed any benefit for larger $p$ , although we do eventually observe convergence empirically when the average loss no longer change appreciably between stages.
173
+
174
+ Also, lines 6-7 of Algorithm 1 require computing the loss on all the samples, and each step of the greedy algorithm needs to, in the worst case, evaluate the marginal gains of all of the unselected samples. Moreover, this is done repeatedly in the inner-most block of two nested loops. Therefore, we use two heuristic tricks to improve efficiency.
175
+
176
+ Fist, rather than selecting individual samples, we first cluster the data and then select clusters, thereby reducing the ground set size from the number of samples to the number of clusters. We replace the per-sample loss $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ with a per-cluster loss $L \left( Y ^ { ( i ) } , f ( X ^ { ( i ) } , w ) \right)$ that we approximate by the loss of the sample closest to the centroid within each cluster:
177
+
178
+ $$
179
+ L \left( Y ^ { ( i ) } , f ( X ^ { ( i ) } , w ) \right) \triangleq \sum _ { j \in C ^ { ( i ) } } L \left( y _ { j } , f ( x _ { j } , w ) \right) \approx | C ^ { ( i ) } | L \left( y ^ { ( i ) } , f ( x ^ { ( i ) } , w ) \right) ,
180
+ $$
181
+
182
+ where $C ^ { ( i ) }$ is the set of indices of the samples in the $i ^ { \mathrm { { t h } } }$ cluster, and $x ^ { ( i ) }$ with label $\boldsymbol y ^ { ( i ) }$ is the sample closest to the cluster centroid. We find that the loss on $\boldsymbol { x } ^ { ( i ) }$ is sufficiently representative to approximately indicate the hardness of the cluster. The set $V$ becomes the set of clusters and $A \subseteq V$ is a set of clusters, and hence the ground set size is reduced speeding up the greedy algorithm. When computing $F ( A )$ , the diversity of selected clusters, cluster centroids again represent the cluster. In line 8, the gradient is computed on all the samples in the selected clusters rather than on only $\boldsymbol { x } ^ { ( i ) }$ at which point the labels of all the samples in the selected clusters are used. Otherwise, when selecting clusters via submodular maximization, the labels of only the centroid samples are needed. Thus, we need only annotate and compute the loss for samples in the selected clusters and the representative centroid samples $\boldsymbol { x } ^ { ( i ) }$ of other clusters. This also reduces the need to label all samples up front as only the labels of the selected clusters, and centroid samples of each cluster, are used (i.e., the clustering process itself does not use the labels).
183
+
184
+ We can further reduce the ground set to save computation during submodular maximization via prefiltering methods that lead either to no (Wei et al., 2014a) or little (Zhou et al., 2017; Mirzasoleiman et al., 2015) reduction in approximation quality. Moreover, as $\lambda$ decreases in the MCL objective and $G ( A )$ becomes more modular, pruning method become more effective. More details are given in Section 4.6.
185
+
186
+ # 3 EXPERIMENTS
187
+
188
+ <table><tr><td>Dataset</td><td rowspan="3">News20</td><td rowspan="3">MNIST</td><td rowspan="3">CIFAR10</td><td rowspan="3">STL10</td><td rowspan="3">SVHN</td><td rowspan="3">Fashion</td></tr><tr><td>Method</td><td></td></tr><tr><td></td><td>0.88</td></tr><tr><td rowspan="5">SGD(random) SPL SPLD</td><td>14.27 15.43</td><td>1.25</td><td>18.52 21.14</td><td>21.76 20.63</td><td>5.20 5.67</td><td>7.79 7.46</td></tr><tr><td>16.23</td><td>1.18</td><td>20.79</td><td>21.25</td><td>5.40</td><td>7.80</td></tr><tr><td>15.99</td><td>1.23</td><td>18.04</td><td>20.50</td><td>5.37</td><td>7.95</td></tr><tr><td>16.54</td><td>0.95</td><td>17.33</td><td>19.70</td><td>4.95</td><td>7.29</td></tr><tr><td>MCL(△=0,λ&gt;0,γ &gt; 0)</td><td>0.82</td><td>16.93</td><td>20.40</td><td>5.29</td><td>7.07</td></tr><tr><td rowspan="3">MCL(△ &gt;0,λ&gt;0,γ = 0) MCL-RAND MCL(△ &gt;0,λ&gt;0,γ &gt;0)</td><td>15.45</td><td></td><td>17.12</td><td>20.42</td><td>5.18</td><td></td></tr><tr><td>16.23 14.12</td><td>0.80 0.75</td><td>12.87</td><td>17.83</td><td>4.19</td><td>6.92</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>6.36</td></tr></table>
189
+
190
+ Table 1: Test error $( \% )$ for different methods (SGD shows the lowest error out of 10 random trials). In this section, we apply different curriculum learning methods to train logistic regression models on 20newsgroups (Lang, 1995), LeNet5 models on MNIST (Lecun et al., 1998), convolutional neural nets (CNNs) with three convolutional layers1 on CIFAR10 (Krizhevsky & Hinton, 2009), CNNs with two convolutional layers 2 on Fashion-MNIST (“Fashion” in all tables) (Xiao et al., 2017), CNNs with six convolutional layers on STL10 (Coates et al., 2011), and CNNs with seven convolutional layers on SVHN (Netzer et al., $2 0 1 1 ) ^ { 3 }$ . Details on the datasets can be found in Table 3 of the appendix. In all cases, we also use $\ell _ { 2 }$ parameter regularization on $w$ with weight $1 e - 4$ (i.e., the weight decay factor of the optimizer).
191
+
192
+ We compare MCL and its variants to SPL (Kumar et al., 2010), SPLD (Jiang et al., 2014) and SGD with a random curriculum (i.e., with random batches). Each method uses mini-batch SGD for $\pi ( \cdot , \eta )$ with the same learning rate strategy to update $w$ . The methods, therefore, differ only in the curriculum (i.e., the sequence of training sets).
193
+
194
+ For SGD, in each iteration, we randomly select 4000 samples (20newsgroups) or 5000 samples (other datasets) and apply mini-batch SGD to the selected samples. In SPL and SPLD, the training set starts from a fixed size $k$ (4000 samples for 20newsgroups, 5000 samples for other datasets), and increases by a factor of $1 + \mu$ (where $\mu = 0 . 1$ ) per round of alternating minimization (i.e., per iteration of the outer loop) 4. We use $\rho$ to denote the number of iterations of the inner loop, which aims to minimize the loss w.r.t. the model $w$ on the selected training set. In SPLD, we also have a weight for the negative group sparsity: it starts from $\xi$ and increases by a factor of 1.1 at each round of alternating minimization (i.e., per iteration of the outer loop). We test five different combinations of $\{ \rho , \mu \}$ and $\{ \rho , \xi \}$ for SPL and SPLD respectively. The best combination with the smallest test error rate is what we report. Neither SPL nor SPLD uses the clustering trick we applied to MCL: they compute the exact loss on each sample in each iteration. Hence, they have more accurate estimation of the hardness on each sample, and require knowing the labels of all samples (selected and unselected) and cannot reduce annotation costs. Note SPLD still needs to run clustering and use the resulted clusters as groups in the group sparsity (which measures diversity in SPLD). We did not select samples with SPL/SPLD as we do with MCL since we wanted to test SPL/SPLD as originally presented — intuitively, SPL/SPLD should if anything only do better without such clustering due to the more accurate sample-specific hardness estimation. The actual clustering, however, used for SPLD’s diversity term is the same as that used for MCL’s cluster samples. We apply the mini-batch $\mathbf { k }$ -means algorithm to the features detailed in the next paragraph to get the clusters used in MCL and SPLD. Although both SPL and SPLD can be reduced to SGD when $\lambda \to \infty$ (i.e., all samples always selected), we do not include this special case because SGD is already a baseline. For SGD with a random curriculum, results of 10 independent trials are reported.
195
+
196
+ In our MCL experiments, we use a simple “feature based” submodular function (Wei et al., 2014b) where $\begin{array} { r } { F ( A ) = \sum _ { u \in \mathcal { U } } \omega _ { u } \sqrt { c _ { u } ( A ) } } \end{array}$ and where $\mathcal { U }$ is a set of features. For a subset $A$ of clusters, $\begin{array} { r } { c _ { u } ( A ) = \sum _ { i \in A } c _ { u } ( i ) } \end{array}$ , where $c _ { u } ( i )$ is the nonnegative feature $u$ of the centroid for cluster $i$ , and can be interpreted as a nonnegative score for cluster $i$ . We use TF-IDF features for 20newsgroup. For the other datasets, we train a corresponding neural networks on a small random subset of training data (e.g., hundreds of samples) for one epoch, and use the inputs to the last fully connected layer (whose outputs are processed by softmax to generate class probabilities) as features. Because we always use ReLU activations between layers, the features are all nonnegative and the submodularity of $F ( A )$ follows as a consequence. These features are also used by mini-batch $k$ -means to generate clusters for MCL and SPLD.
197
+
198
+ <table><tr><td>Dataset</td><td>News20</td><td>MNIST</td><td>CIFAR10</td><td>STL10</td><td>SVHN</td><td>Fashion</td></tr><tr><td>Total time</td><td>2649.19s</td><td>3418.97s</td><td>3677.73s</td><td>2953.47s</td><td>34153.81s</td><td>2927.18s</td></tr><tr><td>WS-SUBMODULARMAX</td><td>62.44s</td><td>35.33s</td><td>127.36s</td><td>206.70s</td><td>1892.62s</td><td>167.55s</td></tr></table>
199
+
200
+ Table 2: Total time (secs.) of MCL $\Delta > 0 , \lambda > 0 , \gamma > 0 \}$ ) and time only on WS-SUBMODULARMAX.
201
+
202
+ For MCL, we set the number of inner loop iterations to $p \leq 5 0$ . For each dataset, we choose $p$ as the number among $\{ 1 0 , 2 0 , 5 0 \}$ that reduces the training loss the most in the first few iterations of the outer loop, and then use that $p$ for the remaining iterations. As shown in Table 4, we use $p = 5 0$ for 20newsgroups, MNIST and Fashion-MNIST, and $p = 2 0$ for the other three datasets.
203
+
204
+ We consider five variants of MCL: 1) MCL( $\Delta = 0$ , $\lambda = 0$ , $\gamma = 0$ ) having neither submodular regularization that promotes diversity nor scheduling of $k$ that increases hardness; 2) MCL( $\Delta = 0$ , $\lambda > 0$ , $\gamma > 0$ ), which decreases diversity by exponentially reducing the weight $\lambda$ of the submodular regularization, but does not have any scheduling of $k$ , i.e., $k$ is fixed during the algorithm; 3) MCL( $\Delta > 0$ , $\lambda > 0$ , $\gamma = 0$ ), which only uses the scheduling of $k$ shown in Algorithm 1, but the diversity weight $\lambda$ is positive and fixed during the algorithm, i.e., with $\gamma = 0$ ; 4) $\mathbf { M C L - R A N D } ( r , q )$ , which randomly samples $r$ clusters as a training set $\hat { A }$ after every $q$ rounds of the outer loop in Algorithm 1, and thus combines both MCL and SGD; 5) $\begin{array} { r } { \mathopen { } \mathclose \bgroup \left. \mathsf { M C L } ( \Delta > 0 , \lambda > 0 , \gamma > 0 ) , \right. } \end{array}$ which uses the scheduling of both $\lambda$ and $k$ shown in Algorithm 1. We tried five different combinations of $\{ q , r \}$ for $\mathbf { M C L - R A N D } ( r , q )$ and five different $\Delta$ values for MCL( $\Delta > 0$ , $\lambda > 0$ , $\gamma > 0$ ), and report the one with the smallest test error. Other parameters, such as the initial values for $\lambda$ and $k$ , the values for $\gamma$ and $p$ , and the total number of clusters are the same for different variants (the exact values of these quantities are given in Table 4 of the Appendix).
205
+
206
+ ![](images/e3c6dafa13951aa9c863b0f7527fdd42f759542a61692f241e984fce5ef4a6d6.jpg)
207
+ Figure 1: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on 20newsgroups (grey curves represents 10 random trials of SGD).
208
+
209
+ In MCL, running greedy is the only extra computation comparing to normal SGD. To show that in our implementation (see Section 4.6) its additional time cost is negligible, we report in Table 2 the total time cost for MCL( $\Delta > 0$ , $\lambda > 0$ , $\gamma > 0$ ) and the time spent on our implementation WS-SUBMODULARMAX.
210
+
211
+ We summarize the main results in Figure 1-8. More results are given at the end of the appendix (Section 4.7). In all figures, grey curves correspond to the ten trials of SGD under a random curriculum. The legend in all figures gives the parameters used for the different methods using the following labels: 1) SPL $( \rho , \mu )$ ; 2) $\operatorname { S P L D } ( \rho , \xi )$ ; and 3) $\mathbf { M C L - R A N D } ( q , r )$ .
212
+
213
+ Figures 1-6 show how the test error changes with (on the left) the number of distinct labeled samples ever needing a loss gradient calculation, and (on the right) the number of training batches, corresponding to training time. Note only MCL and its variants use the clustering trick, while SPL/SPLD need to compute loss on every sample and thus require knowledge of the labels of all samples. The left plot shows only the number of loss gradient calculations needed — 1) in MCL, for those clusters never selected in the curriculum, the loss (and hence the label) of only the centroid sample is needed; 2) in SPL/SPLD, for those samples never selected in the curriculum, their labels are needed only to compute the loss but not the gradient, so they are not reflected in the left plots of all figures because their labels are not used to compute a gradient. Therefore, thanks to the clustering trick, MCL and its variants can train without needing all labels, similar to semi-supervised learning methods. This can help to reduce the annotation costs, if an MCL process is done in tandem with a labeling procedure analogous to active learning. The right plots very roughly indicate convergence rate, namely how the test error decreases as a function of the amount of training.
214
+
215
+ ![](images/d8dacf9ea5ae01fa01c5fa1695bb39cbc373f71344904b62cb1575ebf680e2ff.jpg)
216
+ Figure 2: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on CIFAR10 (grey curves represents 10 random trials of SGD).
217
+
218
+ ![](images/5d78c204fb56b1003fe166668b067442aebd451266c9ceb24aa97af6908261e9.jpg)
219
+ Figure 3: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on Fashion-MNIST (grey curves represents 10 random trials of SGD).
220
+
221
+ ![](images/4081a696daedea81418218e4d97bceadd9d04f9ff6b3d5bb3436d2e38e913498.jpg)
222
+ Figure 4: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on STL10 (grey curves represents 10 random trials of SGD).
223
+
224
+ ![](images/df535970db0872fb6ecab639331f93e3285176293ca69905514a38f972da44be.jpg)
225
+ Figure 5: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on SVHN (grey curves represents 10 random trials of SGD).
226
+
227
+ On all datasets, MCL and most of its variants outperform SPL and SPLD in terms of final test accuracy (shown in Table 1) with comparable efficiency (shown in the right plots of all figures). MCL is slightly slower than SGD to converge in early stages but it can achieve a much smaller error when using the same number of labeled samples for loss gradients. Moreover, when using the same learning rate strategy, they can be more robust to overfitting, as shown in Figure 2. Comparing Figure 1 with Figure 2-6, MCL has the advantage when applied to deep models.
228
+
229
+ ![](images/dc172a41fe6ae822be3f71dfaf9f484b59038639235f088e3768c3dcddeec2f3.jpg)
230
+ Figure 6: Test error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on MNIST (grey curves represents 10 random trials of SGD).
231
+
232
+ ![](images/534a91d4613da600ea51dc1dec1a8773681dfe04771449663f6d3a45fbc1cab0.jpg)
233
+ Figure 7: Number of distinct labeled samples ever needing loss gradient calculation vs. number of training batches for News20 (left), CIFAR10 (middle) and MNIST(right) (grey curves represents 10 random trials of SGD).
234
+
235
+ Among the five variants of MCL, MCL $\lambda > 0$ , $\gamma > 0$ , $\Delta > 0$ ) achieves the fastest convergence speed in later stages and the smallest final test error, while MCL( $\Delta = 0$ , $\lambda = 0 , \Delta = 0 ,$ ) usually achieves the worst performance (the only exception is on News20). Comparison between MCL( $\Delta = 0$ , $\lambda > 0$ , $\gamma > 0 ,$ ) and MCL $\lambda = 0$ , $\gamma = 0$ , $\Delta = 0$ ) shows that decreasing diversity improves the performance. MCL( $\lambda > 0$ , $\gamma > 0$ , $\Delta > 0$ ) always outperforms MCL( $\Delta = 0$ , $\lambda > 0$ , $\gamma > 0$ ). This indicates that increasing $k$ can bring advantages, e.g., more improvements in later stages.
236
+
237
+ ![](images/85ac5f4ea0d948f45dd8c18ceef0bbf300ee2c81717c6ac9584b28270c6aa4f8.jpg)
238
+ Figure 8: Number of distinct labeled samples ever needing loss gradient calculation vs. number of training batches for Fashion-MNIST (left), STL10 (middle) and SVHN (right) (grey curves represents 10 random trials of SGD).
239
+
240
+ MCL( $\lambda > 0$ , $\gamma > 0$ , $\Delta > 0$ ) always outperforms MCL $\Delta > 0$ , $\lambda > 0$ , $\gamma = 0$ ), which supports our claim that it is better to decrease the diversity as training proceeds rather than keeping it fixed. In particular, $\begin{array} { r } { \mathbf { M C L } ( \Delta > 0 , \lambda > 0 , \gamma : } \end{array}$ $\gamma = 0$ ) shows slower convergence than other MCL variants in later stages. In our experiments in the MCL( $\Delta > 0$ , $\lambda > 0 , \gamma = 0 .$ ) case, we needed to carefully choose $\lambda$ and use a relatively large $\Delta$ for it to work at all, as otherwise it would repeatedly choose the same subset (with small $\Delta$ , the loss term decreases as training proceeds, so with fixed $\lambda$ the diversity term comes to dominate the objective). This suggests that a large diversity encouragement is neither necessary nor beneficial when the model matures, possibly since $k$ is large at that point and there is ample opportunity for a diversity of samples to be selected just because $k$ is large, and also since encouraging too much loss-unspecific diversity at that point might only select outliers.
241
+
242
+ The combination of MCL and random curriculum (MCL-RAND) speeds up convergence, and sometimes (e.g., on MNIST, SVHN and Fashion-MNIST) leads to a good final test accuracy, but requires more labeled samples for gradient computation and still cannot outperform MCL $\lambda > 0$ , $\gamma > 0$ , $\Delta > 0$ ). These results indicate that the diversity introduced by submodular regularization does yield improvements, and changing both hardness and diversity improves performance.
243
+
244
+ Figure 7 and Figure 8 shows how the “number of distinct labeled samples ever needing loss gradient calculation” changes as training proceeds. It shows how the different methods trade-off between “training on more new samples” vs. “training on fewer distinct samples more often.” Thanks to the clustering trick, MCL and its variants usually require fewer labeled samples for model training than SGD but more than SPL and SPLD.
245
+
246
+ Acknowledgments This work was done in part while author Bilmes was visiting the Simons Institute for the Theory of Computing in Berkeley, CA. This material is based upon work supported by the National Science Foundation under Grant No. IIS-1162606, the National Institutes of Health under award R01GM103544, and by a Google, a Microsoft, a Facebook, and an Intel research award. This work was supported in part by TerraSwarm, one of six centers of STARnet, a Semiconductor Research Corporation program sponsored by MARCO and DARPA.
247
+
248
+ # REFERENCES
249
+
250
+ Naoki Abe and Hiroshi Mamitsuka. Query learning strategies using boosting and bagging. In ICML, pp. 1–9, 1998.
251
+
252
+ Eugene L. Allgower and Kurt Georg. Introduction to Numerical Continuation Methods. Society for Industrial and Applied Mathematics, 2003.
253
+
254
+ Sumit Basu and Janara Christensen. Teaching classification boundaries to humans. In AAAI, pp. 109–115, 2013.
255
+
256
+ Dhruv Batra, Payman Yadollahpour, Abner Guzman-Rivera, and Gregory Shakhnarovich. Diverse m-best solutions in markov random fields. In ECCV, pp. 1–16, 2012.
257
+
258
+ Mokhtar S. Bazaraa, Hanif D. Sherali, and C. M. Shetty. Nonlinear programming - theory and algorithms (2. ed.). Wiley, 1993.
259
+ Yoshua Bengio. Evolving Culture Versus Local Minima, pp. 109–138. Springer Berlin Heidelberg, 2014.
260
+ Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ ICML, pp. 41–48, 2009.
261
+ Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, 2013.
262
+ Ellen Bialystok, Fergus I. M. Craik, and Gigi Luk. Bilingualism: consequences for mind and brain. Trends in Cognitive Sciences, 16(4):240–250, 2012.
263
+ Jeffrey A. Bilmes and Wenruo Bai. Deep submodular functions. CoRR, abs/1701.08939, 2017. URL http://arxiv.org/abs/1701.08939.
264
+ Robert A Bjork and Elizabeth Ligon Bjork. A new theory of disuse and an old theory of stimulus fluctuation. From learning processes to cognitive processes: Essays in honor of William K. Estes, 2:35–67, 1992.
265
+ Adam Coates, Honglak Lee, and Andrew Y. Ng. An analysis of single-layer networks in unsupervised feature learning. In AISTATS, pp. 215–223, 2011.
266
+ Michele Conforti and Gerard Cornuejols. Submodular set functions, matroids and the greedy algorithm: Tight worst-case bounds and some generalizations of the rado-edmonds theorem. Discrete Applied Mathematics, 7(3):251–274, 1984.
267
+ Aron Culotta and Andrew McCallum. Reducing labeling effort for structured prediction tasks. In AAAI, pp. 746–751, 2005.
268
+ Ido Dagan and Sean P. Engelson. Committee-based sampling for training probabilistic classifiers. In ICML, pp. 150–157, 1995.
269
+ Sanjoy Dasgupta and Daniel Hsu. Hierarchical sampling for active learning. In ICML, pp. 208–215, 2008.
270
+ John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011.
271
+ Farzan Farnia and David Tse. A minimax approach to supervised learning. In NIPS, pp. 4240–4248, 2016.
272
+ U. Feige. A threshold of ln n for approximating set cover. Journal of the ACM (JACM), 1998.
273
+ Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 55(1):119–139, 1997.
274
+ Satoru Fujishige. Submodular functions and optimization. Annals of discrete mathematics. Elsevier, 2005.
275
+ Jennifer Gillenwater, Alex Kulesza, and Ben Taskar. Near-optimal map inference for determinantal point processes. In NIPS, pp. 2735–2743, 2012.
276
+ R. Iyer and J. Bilmes. Algorithms for approximate minimization of the difference between submodular functions, with applications. In UAI, 2012.
277
+ Rishabh Iyer and Jeff A. Bilmes. Submodular point processes with applications in machine learning. In AISTATS, May 2015.
278
+ Rishabh Iyer, Stefanie Jegelka, and Jeff A. Bilmes. Fast semidifferential-based submodular function optimization. In ICML, 2013.
279
+ S. Jegelka and J. Bilmes. Submodularity beyond submodular energies: coupling edges in graph cuts. In Computer Vision and Pattern Recognition (CVPR), 2011.
280
+ Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander G. Hauptmann. Self-paced learning with diversity. In NIPS, pp. 2078–2086, 2014.
281
+ Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G. Hauptmann. Self-paced curriculum learning. In AAAI, pp. 2694–2700, 2015.
282
+ Faisal Khan, Xiaojin (Jerry) Zhu, and Bilge Mutlu. How do humans teach: On curriculum learning and teaching dimension. In NIPS, pp. 1449–1457, 2011.
283
+ Agnes Melinda Kov ´ acs and Jacques Mehler. Flexible learning of multiple speech structures in ´ bilingual infants. Science, 325(5940):611–612, 2009.
284
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
285
+ M. Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In NIPS, pp. 1189–1197, 2010.
286
+ Gert R.G. Lanckriet, Laurent El Ghaoui, Chiranjib Bhattacharyya, and Michael I. Jordan. A robust minimax approach to classification. Journal of Machine Learning Research, 3:555–582, 2003.
287
+ Ken Lang. Newsweeder: Learning to filter netnews. In ICML, pp. 331–339, 1995.
288
+ Yann Lecun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
289
+ Ping Li, Jennifer Legault, and Kaitlyn A. Litcofsky. Neuroplasticity as a function of second language learning: Anatomical changes in the human brain. Cortex, 58:301–324, 2014.
290
+ Hui Lin and Jeff A. Bilmes. A class of submodular functions for document summarization. In ACL, pp. 510–520, 2011.
291
+ Hui Lin, Jeff A. Bilmes, and Shasha Xie. Graph-based submodular selection for extractive summarization. In Proc. IEEE Automatic Speech Recognition and Understanding (ASRU), Merano, Italy, December 2009.
292
+ Mark A McDaniel and Andrew C Butler. A contextual framework for understanding when difficulties are desirable. Successful remembering and successful forgetting: A festschrift in honor of Robert A. Bjork, pp. 175–198, 2011.
293
+ Andrea Mechelli, Jenny T. Crinion, Uta Noppeney, John O’Doherty, John Ashburner, Richard S. Frackowiak, and Cathy J. Price. Neurolinguistics: Structural plasticity in the bilingual brain. Nature, 431(7010):757–757, 2004.
294
+ Michel Minoux. Accelerated greedy algorithms for maximizing submodular set functions. In Optimization Techniques, volume 7 of Lecture Notes in Control and Information Sciences, chapter 27, pp. 234–243. Springer Berlin Heidelberg, 1978.
295
+ Baharan Mirzasoleiman, Ashwinkumar Badanidiyuru, Amin Karbasi, Jan Vondrak, and Andreas ´ Krause. Lazier than lazy greedy. In AAAI, pp. 1812–1818, 2015.
296
+ Baharan Mirzasoleiman, Amin Karbasi, Rik Sarkar, and Andreas Krause. Distributed submodular maximization. Journal of Machine Learning Research, 17(238):1–44, 2016.
297
+ Douglas C. Montgomery. Design and Analysis of Experiments. John Wiley & Sons, 2006.
298
+ M. Narasimhan and J. Bilmes. A submodular-supermodular procedure with applications to discriminative structure learning. In UAI, 2005.
299
+ G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions-I. Mathematical Programming, 14(1):265–294, 1978.
300
+
301
+ Yurii Nesterov. Introductory Lectures on Convex Optimization: A Basic Course. Kluwer Academic Publishers, 2004.
302
+
303
+ Yurii Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1): 127–152, 2005.
304
+
305
+ 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.
306
+
307
+ Kaustubh R Patil, Xiaojin (Jerry) Zhu, Ł ukasz Kopec, and Bradley C Love. Optimal teaching for ´ limited-capacity human learners. In NIPS, pp. 2465–2473, 2014.
308
+
309
+ Adarsh Prasad, Stefanie Jegelka, and Dhruv Batra. Submodular meets structured: Finding diverse subsets in exponentially-large structured item sets. In NIPS, pp. 2645–2653, 2014.
310
+
311
+ Robert E. Schapire. The strength of weak learnability. Machine Learning, 5(2):197–227, 1990.
312
+
313
+ Tobias Scheffer, Christian Decomain, and Stefan Wrobel. Active hidden markov models for information extraction. In CAIDA, pp. 309–318, 2001.
314
+
315
+ Burr Settles. Active learning literature survey. Technical report, University of Wisconsin, Madison, 2010.
316
+
317
+ H. S. Seung, M. Opper, and H. Sompolinsky. Query by committee. In COLT, pp. 287–294, 1992.
318
+
319
+ Shai Shalev-Shwartz and Yonatan Wexler. Minimizing the maximal loss: How and why. In International Conference on Machine Learning (ICML), pp. 793–801, 2016.
320
+
321
+ Valentin I. Spitkovsky, Hiyan Alshawi, and Daniel Jurafsky. Baby Steps: How “Less is More” in unsupervised dependency parsing. In NIPS 2009 Workshop on Grammar Induction, Representation of Language and Language Learning, 2009.
322
+
323
+ James Steven Supancic III and Deva Ramanan. Self-paced learning for long-term tracking. In CVPR, pp. 2379–2386, 2013.
324
+
325
+ Kevin Tang, Vignesh Ramanathan, Li Fei-fei, and Daphne Koller. Shifting weights: Adapting object detectors from image to video. In NIPS, pp. 638–646, 2012a.
326
+
327
+ Ye Tang, Yu-Bin Yang, and Yang Gao. Self-paced dictionary learning for image classification. In MM, pp. 833–836, 2012b.
328
+
329
+ Kai Wei, Rishabh Iyer, and Jeff A. Bilmes. Fast multi-stage submodular maximization. In ICML, 2014a.
330
+
331
+ Kai Wei, Yuzong Liu, Katrin Kirchhoff, Chris D. Bartels, and Jeff A. Bilmes. Submodular subset selection for large-scale speech training data. In ICASSP, pp. 3311–3315, 2014b.
332
+
333
+ Kai Wei, Rishabh Iyer, and Jeff A. Bilmes. Submodularity in data subset selection and active learning. In ICML, 2015.
334
+
335
+ Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
336
+
337
+ Tianyi Zhou, Hua Ouyang, Jeff A. Bilmes, Yi Chang, and Carlos Guestrin. Scaling submodular maximization via pruned submodularity graphs. In AISTATS, 2017.
338
+
339
+ X. Zhu, A. Singla, S. Zilles, and A. N. Rafferty. An Overview of Machine Teaching. ArXiv e-prints, January 2018.
340
+
341
+ Xiaojin (Jerry) Zhu. Machine teaching: An inverse problem to machine learning and an approach toward optimal education. In AAAI, pp. 4083–4087, 2015.
342
+
343
+ # 4 APPENDIX
344
+
345
+ # 4.1 PROOF OF LEMMA 1
346
+
347
+ Proof. We have
348
+
349
+ $$
350
+ \begin{array} { r } { \kappa _ { G } = 1 - \underset { j \in V } { \mathrm { m i n } } \frac { L ( j ) + \lambda F ( j | V \backslash j ) } { L ( j ) + \lambda F ( j ) } = \lambda \cdot \underset { j \in V } { \mathrm { m a x } } \frac { F ( j ) - F ( j | V \backslash j ) } { L ( j ) + \lambda F ( j ) } } \\ { = \lambda \cdot \underset { j \in V } { \mathrm { m a x } } \frac { 1 - \frac { F ( j | V \backslash j ) } { F ( j ) } } { \frac { L ( j ) } { F ( j ) } + \lambda } \leq \frac { \lambda \cdot \kappa _ { F } } { \operatorname* { m i n } _ { j \in V } \frac { L ( j ) } { F ( j ) } + \lambda } = \frac { \kappa _ { F } } { c _ { 1 } / \lambda + 1 } } \end{array}
351
+ $$
352
+
353
+ Where c1 , minj∈V L(j)F (j) .
354
+
355
+ # 4.2 PROOF OF PROPOSITION 1
356
+
357
+ Proposition 1. The maximum of multiple $\beta$ -strongly convex functions is $\beta$ -strongly convex as well.
358
+
359
+ Proof. Let $g ( x ) = \operatorname* { m a x } _ { i } g _ { i } ( x )$ , where $g _ { i } ( x )$ is $\beta$ -strongly convex for any $i$ . According to a definition of strongly convex function given in Theorem 2.1.9 (page 64) of (Nesterov, 2004), $\forall \lambda \in [ 0 , 1 ]$ , we have
360
+
361
+ $$
362
+ g _ { i } ( \lambda x + ( 1 - \lambda ) y ) \leq \lambda g _ { i } ( x ) + ( 1 - \lambda ) g _ { i } ( y ) - \frac { \beta } { 2 } \lambda ( 1 - \lambda ) \| x - y \| _ { 2 } ^ { 2 } , \forall i .
363
+ $$
364
+
365
+ The following proves that $g ( x )$ is also $\beta$ -strongly convex:
366
+
367
+ $$
368
+ \begin{array} { r l } & { \quad g ( \lambda x + ( 1 - \lambda ) y ) = \underset { i } { \mathrm { m a x } } g _ { i } ( \lambda x + ( 1 - \lambda ) y ) } \\ & { \le \underset { i } { \mathrm { m a x } } [ \lambda g _ { i } ( x ) + ( 1 - \lambda ) g _ { i } ( y ) ] - \frac \beta 2 \lambda ( 1 - \lambda ) \| x - y \| _ { 2 } ^ { 2 } } \\ & { \le \underset { i } { \mathrm { m a x } } \lambda g _ { i } ( x ) + \underset { i } { \mathrm { m a x } } ( 1 - \lambda ) g _ { i } ( y ) - \frac \beta 2 \lambda ( 1 - \lambda ) \| x - y \| _ { 2 } ^ { 2 } } \\ & { = \lambda g ( x ) + ( 1 - \lambda ) g ( y ) - \frac \beta 2 \lambda ( 1 - \lambda ) \| x - y \| _ { 2 } ^ { 2 } . } \end{array}
369
+ $$
370
+
371
+ # 4.3 PROOF OF THEOREM 1
372
+
373
+ Proof. The objective $g ( w )$ of the minimax problem in Eq. (2) after eliminating $A$ is given in Eq. (4). Since $G ( A )$ in Eq. (5) is monotone non-decreasing submodular, the optimal subset $A$ when defining $g ( w )$ in Eq. (4) always has size $k$ if $| V | \geq k$ . In addition, because the loss function $L \left( y _ { i } , f ( x _ { i } , w ) \right)$ is $\beta$ -strongly convex, $g ( w )$ in Eq. (4) is the maximum over multiple $k \beta .$ -strongly convex functions with different $A$ . According to Proposition 1, $g ( w )$ is also $k \beta$ -strongly convex, i.e.,
374
+
375
+ $$
376
+ g ( \hat { w } ) \geq g ( w ^ { * } ) + \nabla g ( w ^ { * } ) ^ { T } ( \hat { w } - w ^ { * } ) + \frac { k \beta } { 2 } \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } , \forall \nabla g ( w ^ { * } ) \in \partial g ( w ^ { * } ) .
377
+ $$
378
+
379
+ Since the convex function $g ( w )$ achieves minimum on $w ^ { * }$ , it is valid to substitute $\nabla g ( w ^ { * } ) = 0 \in$ $\partial g ( w ^ { * } )$ into Eq. (14). After rearrangement, we have
380
+
381
+ $$
382
+ \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 } { k \beta } \left[ g ( \hat { w } ) - g ( w ^ { * } ) \right] .
383
+ $$
384
+
385
+ In the following, we will prove $g ( w ^ { * } ) \geq \alpha \cdot g ( \hat { w } )$ , which together with Eq. (15) will lead to the final bound showing how close $\hat { w }$ is to $w ^ { * }$ .
386
+
387
+ Note $\hat { g } ( w )$ (Eq. (6)) is a piecewise function, each piece of which is convex and associated with different $\hat { A }$ achieved by a submodular maximization algorithm of approximation factor $\alpha$ . Since $\hat { A }$ is not guaranteed to be a global maxima, unlike $g ( w )$ , the whole $\hat { g } ( w )$ cannot be written as the maximum of multiple convex functions and thus can be non-convex. Therefore, gradient descent in lines 6-9 of Algorithm 1 can lead to either: 1) $\hat { w }$ is a global minima of $\hat { g } ( w )$ ; or 2) $\hat { w }$ is a local minima of $\hat { g } ( w )$ . Saddle points do not exist on $\hat { g } ( w )$ because each piece of it is convex. We are also assuming other issues associated with the boundaries between convex pieces do not repeatedly occur.
388
+
389
+ 1) When $\hat { w }$ is a global minima of $\hat { g } ( w )$ , we have
390
+
391
+ The first inequality is due to $g ( \cdot ) \geq \hat { g } ( \cdot )$ . The second inequality is due to the global optimality of $\hat { w }$ . The third inequality is due to the approximation bound $\hat { g } ( \cdot ) \geq \alpha \cdot g ( \cdot )$ guaranteed by the submodular maximization in Step 7 of Algorithm 1.
392
+
393
+ 2) When $\hat { w }$ is a local minima of $\hat { g } ( w )$ , we have $\nabla \widehat { g } ( \widehat { w } ) = 0$ . Let $h ( w )$ be the piece of $\hat { g } ( w )$ where $\hat { w }$ is located, then $\hat { w }$ has to be a global minima of $h ( w )$ due to the convexity of $h ( w )$ . Let $\mathcal { A }$ denote the ground set of $\hat { A }$ on all pieces of $\hat { g } ( w )$ , we define an auxiliary convex function $\tilde { g } ( w )$ as
394
+
395
+ $$
396
+ \tilde { g } ( w ) \triangleq \underset { A \in \mathcal { A } } { \operatorname* { m a x } } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( A ) .
397
+ $$
398
+
399
+ It is convex because it is defined as the maximum of multiple convex function. So we have
400
+
401
+ $$
402
+ \hat { g } ( w ) \leq \tilde { g } ( w ) \leq g ( w ) , \forall w \in \mathbb { R } ^ { m }
403
+ $$
404
+
405
+ The first inequality is due to the definition of $\mathcal { A }$ , and the second inequality is a result of ${ \mathcal { A } } \subseteq 2 ^ { V }$ by comparing $g ( w )$ in Eq. (4) with $\tilde { g } ( w )$ in Eq. (17). Let $\tilde { w }$ denote a global minima of $\tilde { g } ( w )$ , we have
406
+
407
+ The first inequality is due to Eq. (18), the second inequality is due to the global optimality of $\tilde { w }$ on $\tilde { g } ( w )$ , the third inequality is due to the definition of $\tilde { g } ( w )$ in Eq. (17) $( \tilde { g } ( w )$ is the maximum of all pieces of $\hat { g } ( w )$ and $h ( w )$ is one piece of them), the fourth inequality is due to the global optimality of $\hat { w }$ on $h ( w )$ , the last inequality is due to the approximation bound ${ \hat { g } } ( \cdot ) \geq \alpha \cdot g ( \cdot ) $ guaranteed by the submodular maximization in Step 7 of Algorithm 1.
408
+
409
+ Therefore, in both cases we have $g ( w ^ { * } ) \geq \alpha \cdot g ( \hat { w } )$ . Applying it to Eq. (15) results in
410
+
411
+ $$
412
+ \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 } { k \beta } \left( \frac { 1 } { \alpha } - 1 \right) \cdot g ( w ^ { * } ) .
413
+ $$
414
+
415
+ # 4.4 PROPOSITION 2
416
+
417
+ Proposition 2. If $x \in [ 0 , 1 ]$ , the following inequality holds true.
418
+
419
+ $$
420
+ { \frac { x } { 1 - e ^ { - x } } } - 1 \leq x .
421
+ $$
422
+
423
+ Proof. Due to two inequalities $e ^ { x } \leq 1 + x + x ^ { 2 } / 2$ for $x \leq 0$ and $1 - e ^ { - x } \geq x / 2$ for $x \in [ 0 , 1 ]$ ,
424
+
425
+ $$
426
+ \frac { x } { 1 - e ^ { - x } } - 1 = \frac { x - 1 + e ^ { - x } } { 1 - e ^ { - x } } \leq \frac { x - 1 + ( 1 - x + x ^ { 2 } / 2 ) } { x / 2 } = x .
427
+ $$
428
+
429
+ # 4.5 PROOF OF COROLLARY 1
430
+
431
+ Proof. Applying the inequality in Proposition 2 and the approximation factor of lazy greedy $\alpha =$ $( 1 - e ^ { - \kappa _ { G } } ) / \kappa _ { G }$ to the right hand side of Eq. (9) from Theorem 1 yields
432
+
433
+ $$
434
+ \begin{array} { l } { \displaystyle \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 } { k \beta } \left( \frac { 1 } { \alpha } - 1 \right) \cdot g ( w ^ { * } ) } \\ { \displaystyle = \frac { 2 } { k \beta } \left( \frac { \kappa _ { G } } { 1 - e ^ { - \kappa _ { G } } } - 1 \right) \cdot g ( w ^ { * } ) \leq \frac { 2 \kappa _ { G } } { k \beta } \cdot g ( w ^ { * } ) , } \end{array}
435
+ $$
436
+
437
+ where $\kappa _ { G }$ is the curvature of submodular function $G ( \cdot )$ defined in Eq. (5). Substituting the inequality about $\kappa _ { G }$ from Lemma 1 into Eq. (23) results in
438
+
439
+ $$
440
+ \| \hat { w } - w ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } } { k \beta ( c _ { 1 } / \lambda + 1 ) } \leq \frac { 2 \kappa _ { F } } { \beta c _ { 1 } } \times \frac { \lambda } { k } \times g ( w ^ { * } ) .
441
+ $$
442
+
443
+ We use subscript as the index for iterations in the outer-loop, e.g., $\hat { w } _ { T }$ is the model weights $w$ after the $T ^ { t h }$ iteration of outer-loop. If we decrease $\lambda$ exponentially from $\lambda = \lambda _ { 0 }$ and increase $k$ linearly from $k = k _ { 0 }$ , as Step 11 in Algorithm 1, we have
444
+
445
+ $$
446
+ \| \hat { w } _ { T } - w _ { T } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } \lambda _ { 0 } } { \beta c _ { 1 } } \times \frac { ( 1 - \gamma ) ^ { T } } { ( k _ { 0 } + T \Delta ) } \times g ( w _ { T } ^ { * } ) ,
447
+ $$
448
+
449
+ According to the definition of $g ( \cdot )$ in Eq. (4), for $g ( w _ { T } ^ { * } )$ we have
450
+
451
+ $$
452
+ \begin{array} { r l } & { g ( w _ { T } ^ { * } ) = \underset { w \in \mathbb { R } ^ { m } } { \operatorname* { m i n } } \underset { A \subseteq V , | A | \leq k } { \operatorname* { m a x } } \underset { i \in A } { \sum } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda F ( A ) } \\ & { \qquad \leq \underset { w \in \mathbb { R } ^ { m } } { \operatorname* { m i n } } \underset { A \subseteq V , | A | \leq k } { \operatorname* { m a x } } \underset { i \in A } { \sum } L \left( y _ { i } , f ( x _ { i } , w ) \right) + \lambda _ { 0 } ( 1 - \gamma ) ^ { T } \underset { A \subseteq V , | A | \leq k } { \operatorname* { m a x } } F ( A ) } \\ & { \qquad = g ( w _ { \infty } ^ { * } ) + \lambda _ { 0 } ( 1 - \gamma ) ^ { T } c _ { 2 } , } \end{array}
453
+ $$
454
+
455
+ where
456
+
457
+ $$
458
+ g ( w _ { \infty } ^ { * } ) \triangleq \operatorname* { m i n } _ { w \in \mathbb { R } ^ { m } } \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ) \right) , c _ { 2 } \triangleq \operatorname* { m a x } _ { A \subseteq V , | A | \leq k } F ( A ) .
459
+ $$
460
+
461
+ Substituting Eq. (26) to Eq. (25) yields
462
+
463
+ $$
464
+ \| \hat { w } _ { T } - w _ { T } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } \lambda _ { 0 } } { \beta c _ { 1 } } \times \frac { ( 1 - \gamma ) ^ { T } } { \left( k _ { 0 } + T \Delta \right) } \times \left[ g ( w _ { \infty } ^ { * } ) + \lambda _ { 0 } c _ { 2 } ( 1 - \gamma ) ^ { T } \right] ,
465
+ $$
466
+
467
+ If we can tolerate more expensive computational cost for running submodular maximization with larger budget $k$ , and increase $k$ exponentially, i.e., $k \gets ( 1 + \Delta ) \cdot k$ , we have
468
+
469
+ $$
470
+ \| \hat { w } _ { T } - w _ { T } ^ { * } \| _ { 2 } ^ { 2 } \leq \frac { 2 \kappa _ { F } \lambda _ { 0 } } { \beta c _ { 1 } k _ { 0 } } \times \left( \frac { 1 - \gamma } { 1 + \Delta } \right) ^ { T } \times \left[ g ( w _ { \infty } ^ { * } ) + \lambda _ { 0 } c _ { 2 } ( 1 - \gamma ) ^ { T } \right] .
471
+ $$
472
+
473
+ This completes the proof.
474
+
475
+ # 4.6 SUBMODULAR MAXIMIZATION STARTING FROM A PREVIOUS “WARM” SOLUTION
476
+
477
+ Algorithm 1 repeatedly runs a greedy procedure to solve submodular maximization, and this occurs two nested loops deep. In this section we describe how we speed this process up.
478
+
479
+ Our first strategy reduces the size of the ground set before starting a more expensive submodular maximization procedure. We use a method described in (Wei et al., 2014a) where we sort the elements of $V$ non-increasingly by $G ( i | V \setminus i )$ and then remove any element $i$ from $V$ having $G ( i ) < G ( \delta ( k ) | V \backslash \delta ( k ) )$ where $\delta ( k )$ is $k ^ { \mathrm { { t h } } }$ element in the sorted permutation. Any such element will never be chosen by the $k$ -cardinality constrained greedy procedure because for any $\ell \in \{ 1 , 2 , \ldots , k \}$ , and any set $A$ , we have $G ( \delta ( \ell ) | \dot { A } ) \ge G ( \delta ( \ell ) | \bar { V } \setminus \delta ( \ell ) ) \ge G ( \delta ( k ) | V \setminus \delta ( k ) ) ^ { \setminus } G ( \dot { \iota } ) \ge G ( \dot { \iota } | \dot { A } )$ and thus greedy would always be able to choose an element better than $i$ . This method results in no reduction in approximation quality, although it might not yield any speedup at all. But with a decreasing $\lambda$ , $G ( A )$ becomes more modular, and the filtering method can become more effective. Other methods we can employ are those such as (Zhou et al., 2017; Mirzasoleiman et al., 2015), resulting in small reduction in approximation quality, but we do not describe these further.
480
+
481
+ The key contribution of this section is a method exploiting a potential warm start set that might already achieve a sufficient approximation quality. Normally, the greedy procedure starts with the empty set and adds elements greedily until a set of size $k$ is reached. In Algorithm 1, by contrast, a previous iteration has already solved a size- $k$ constrained submodular maximization problem for the previous submodular function, the solution to which is one that could very nearly already satisfy a desired approximation bound for the current submodular function. The reason for this is that, depending on the weight update method in line 9 of Algorithm 1 between inner loop iterations, and the changes to parameters $\Delta$ and $\gamma$ between outer iterations, the succession of submodular functions might not change very quickly. For example, when the learning rate $\eta$ is small, the $\hat { A }$ from the previous iteration could still be valued highly by the current iteration’s function, so running a greedy procedure from scratch is unnecessary. Our method warm-starts a submodular maximization process with a previously computed set, and offers a bound that trades off speed and approximation quality.
482
+
483
+ The approach is given in Algorithm 2, which (after the aforementioned filtering in line 3 (Wei et al., 2014a)) tests in linear time if the warm start set $\hat { A }$ already achieves a sufficient approximation quality, and if so, possibly improves it further with an additional linear or quasilinear time computation. To test approximation quality of $\hat { A }$ , our approach uses a simple modular function upper bound, in line 4, to compute an upper bound on the global maximum value. For the subsequent improvement of $\hat { A }$ , our approach utilizes a submodular semigradient approach (Iyer et al., 2013) (specifically subgradients (Fujishige, 2005) in this case). If the warm-start set $\hat { A }$ does not achieve sufficient approximation quality in line 5, the algorithm backs off to standard submodular maximization in line
484
+
485
+ 11 (we use the accelerated/lazy greedy procedure (Minoux, 1978) here although other methods, e.g., (Mirzasoleiman et al., 2015), can be used as well).
486
+
487
+ # Algorithm 2 Warm Start (WS) WS-SUBMODULARMAX(G, k, A, ˆ α˜ ∈ [0, 1))
488
+
489
+ 1: Input: $G ( \cdot ) , k , \hat { A } , \tilde { \alpha }$
490
+ 2: Output: $\tilde { A }$
491
+ 3: Reduce ground set size: arrange $V$ non-increasingly in terms of $G ( i | V \backslash i )$ in a permutation $\delta$ where $\delta ( k )$ is the $k ^ { t h }$ element, set $V \{ i \in V | G ( i ) \geq G ( \delta ( k ) | V \backslash \delta ( k ) ) \}$ ;
492
+
493
+ 4: Compute upper bound to maximum of Eq. (5):
494
+
495
+ $$
496
+ \tau = \operatorname* { m a x } _ { A \in V , | A | \leq k } \sum _ { i \in A } \left[ L \left( y _ { i } , f ( x _ { i } , w ^ { t } ) \right) + \lambda F ( i ) \right]
497
+ $$
498
+
499
+ 5: if ${ \cal G } ( \hat { A } ) \geq \tilde { \alpha } \cdot \tau$ then
500
+
501
+ 6: Permutation $\sigma$ of $V$ : the first $k$ elements have $S _ { k } ^ { \sigma } = \hat { A }$ and are chosen ordered non-increasing by $\kappa _ { G } ( v )$ ; the remaining $n - k$ elements $V \setminus { \hat { A } }$ for $\sigma$ are chosen non-increasing by $\kappa _ { G } ( v )$ .
502
+
503
+ 7: Define modular function $\begin{array} { r } { h _ { \hat { A } } ( A ) \triangleq \sum _ { i \in A } h _ { \hat { A } } ( i ) } \end{array}$ with $h _ { \hat { A } } ( \sigma ( i ) ) = G ( S _ { i } ^ { \sigma } ) - G ( S _ { i - 1 } ^ { \sigma } )$ ;
504
+
505
+ 8: Compute tight, at $\hat { A }$ , lower bound $L ( A )$ of $G ( A )$ :
506
+
507
+ $$
508
+ L ( A ) \triangleq G ( { \hat { A } } ) + h _ { { \hat { A } } } ( A ) - h _ { { \hat { A } } } ( { \hat { A } } ) \leq G ( A )
509
+ $$
510
+
511
+ 9: $\tilde { A } \gets \mathrm { a r g m a x } _ { A \in V , | A | \leq k } L ( A )$ ;
512
+ 10: else
513
+ 11: $\tilde { A } \gets \mathrm { L A Z Y G R E E D Y } ( G , V , k ) .$ ;
514
+ 12: end if
515
+
516
+ Line 4 computes the upper bound $\tau \geq \operatorname* { m a x } _ { A \in V , | A | \leq k } G ( A )$ which holds due to submodularity, requiring only a modular maximization problem (which can be done in $O ( | V | )$ time, independent of $k$ , to select the top $k$ elements). Line 5 checks if an $\tilde { \alpha }$ approximation to this upper bound is achieved by the warm-start set $\hat { A }$ , and if not we back off to a standard submodular maximization procedure in line 11.
517
+
518
+ If $\hat { A }$ is an $\tilde { \alpha }$ approximation to the upper bound $\tau$ , then lines 6-9 runs a subgradient optimization procedure, a process that can potentially improve it further. The approach selects a subgradient defined by a permutation $\sigma = \bar { ( } \sigma ( 1 ) , \sigma ( \bar { 2 } ) , \ldots \bar { , } \sigma ( n ) )$ of the elements. The algorithm then defines a modular function $L ( A )$ , tight at $\hat { A }$ and a lower bound everywhere else, i.e., $L ( { \hat { A } } ) = G ( { \hat { A } } )$ , and $\forall A , L ( A ) \leq G ( A )$ . Any permutation will achieve this as long as $\hat { A } = \{ \sigma ( 1 ) , \sigma ( 2 ) , \ldots , \sigma ( k ) \}$ . The specific permutation we use is described below. Once we have the modular lower bound, we can do simple and fast modular maximization.
519
+
520
+ Lines 6-9 of Algorithm 2 offer a heuristic that can only improve the objective — letting $\tilde { A }$ be the solution after line 9, we have
521
+
522
+ $$
523
+ G ( { \tilde { A } } ) \geq L ( { \tilde { A } } ) \geq L ( { \hat { A } } ) = G ( { \hat { A } } ) .
524
+ $$
525
+
526
+ The first inequality follows since $L ( \cdot )$ is a lower bound of $G ( \cdot )$ ; the second inequality follows from the optimality of $\hat { A } ^ { + }$ ; the equality follows since $L$ is tight at $\hat { A }$ .
527
+
528
+ The approximation factor $\tilde { \alpha }$ is distinct from the submodular maximization approximation factor $\alpha$ achieved by the greedy algorithm. Setting, for example $\tilde { \alpha } = 1 - 1 / e$ would ask for the previous solution to be this good relative to $\tau$ , the upper bound on the global maximum, and the algorithm would almost always immediately jump to line 11 since achieving such approximation quality might not even be possible in polynomial time (Feige, 1998). With $\tilde { \alpha }$ large, we recover the approximation factor of the greedy algorithm but ignore the warm start. If $\tilde { \alpha }$ is small, many iterations might use the warm start from the previous iteration, updating it only via one step of subgradient optimization, but with a worse approximation factor. In practice, therefore, we use a more lenient bound (often we set $\tilde { \alpha } = 1 / 2$ ) which is a good practical tradeoff between approximation accuracy and speed (meaning lines 6-9 execute a reasonable fraction of the time leading to a good speedup, i.e., in our experiments, the time cost for WS-SUBMODULARMAX increases if $\alpha = 1$ by a factor ranging from about 3 to 5). In general, we have the following final bound based on the smaller of $\tilde { \alpha }$ and $\alpha$ .
529
+
530
+ Lemma 2. Algorithm 2 outputs a solution $\hat { A }$ such that $G ( \hat { A } ) \geq \operatorname* { m i n } \{ \tilde { \alpha } , \alpha \} \times \operatorname* { m a x } _ { A \in V , | A | \leq k } G ( A )$ , where $\alpha$ is the approximation factor of the greedy procedure (typically $\alpha = ( 1 - e ^ { - \kappa _ { G } } ) / \kappa _ { G } )$ .
531
+
532
+ Proof. Let $A ^ { * }$ denote an optimal solution to Eq. (5):
533
+
534
+ $$
535
+ A ^ { * } \in \operatorname * { a r g m a x } _ { A \in V , | A | \leq k } \sum _ { i \in A } L \left( y _ { i } , f ( x _ { i } , w ^ { t } ) \right) + \lambda F ( A ) .
536
+ $$
537
+
538
+ $\tau$ computed in line 4 is an upper bound to $G ( A ^ { * } )$ since:
539
+
540
+ $$
541
+ \begin{array} { r l } { \tau } & { \geq \sum _ { i \in A ^ { * } } \left[ L \left( y _ { i } , f ( x _ { i } , w ^ { t } ) \right) + \lambda F ( i ) \right] } \\ & { = \sum _ { i \in A ^ { * } } L \left( y _ { i } , f ( x _ { i } , w ^ { t } ) \right) + \lambda \sum _ { i \in A ^ { * } } F ( i ) } \\ & { \geq \sum _ { i \in A ^ { * } } L \left( y _ { i } , f ( x _ { i } , w ^ { t } ) \right) + \lambda F ( A ^ { * } ) . } \end{array}
542
+ $$
543
+
544
+ The first inequality follows by the definition of $\tau$ ; the last inequality is due to submodularity, guaranteeing $F ( i ) \geq F ( i | B )$ for any $B \subseteq V$ .
545
+
546
+ When ${ \cal G } ( \hat { A } ) \geq \tilde { \alpha } \cdot \tau$ (line 5), the subgradient ascent can only improve the objective. Thus, we have $G ( { \hat { A } } ) \geq { \tilde { \alpha } } \cdot \operatorname* { m a x } _ { A \in V , | A | \leq k } G ( A )$ for $\hat { A }$ obtained in line 9. Otherwise, we run the greedy algorithm on the reduced ground set $V$ . Thus, we have $G ( { \hat { A } } ) \geq \alpha \cdot \operatorname* { m a x } _ { A \in V , | A | \leq k } G ( A )$ for $\hat { A }$ obtained in line 11. □
547
+
548
+ The heuristic in lines 6-9 is identical to one step of the semigradient-based minorization-maximization (MM) scheme used in, for example, (Narasimhan & Bilmes, 2005; Jegelka & Bilmes, 2011; Iyer $\&$ Bilmes, 2012; Iyer et al., 2013). Which permutation to use for the subgradient in order to tighten the gap has been an issue discussed as far back as (Narasimhan & Bilmes, 2005). In the present work, we offer a new heuristic for this problem. Let the first $i$ elements in the permutation $\sigma$ be denoted $S _ { i } ^ { \sigma } = \{ \sigma ( 1 ) , \sigma ( 2 ) , . . . , \sigma ( i ) \}$ , and let $A _ { i - 1 } ^ { \sigma } \triangleq \{ \sigma ( j ) \in A | j < i \} = S _ { i - 1 } ^ { \sigma } \cap A \subseteq S _ { i - 1 } ^ { \sigma }$ for any $i \in A$ . The gap we wish to reduce is
549
+
550
+ $$
551
+ \begin{array} { r l } & { 0 \le G ( A ) - L ( A ) = \displaystyle \sum _ { \sigma ( i ) \in A } \left[ G ( \sigma ( i ) | A _ { i - 1 } ^ { \sigma } ) - G ( \sigma ( i ) | S _ { i - 1 } ^ { \sigma } ) \right] } \\ & { \qquad = \displaystyle \sum _ { \sigma ( i ) \in A } G ( \sigma ( i ) ) \cdot \left[ \frac { G ( \sigma ( i ) | A _ { i - 1 } ^ { \sigma } ) } { G ( \sigma ( i ) ) } - \frac { G ( \sigma ( i ) | S _ { i - 1 } ^ { \sigma } ) } { G ( \sigma ( i ) ) } \right] } \\ & { \qquad \le \displaystyle \sum _ { \sigma ( i ) \in A } G ( \sigma ( i ) ) \cdot \left[ \frac { G ( \sigma ( i ) | A _ { i - 1 } ^ { \sigma } ) } { G ( \sigma ( i ) ) } - ( 1 - \kappa _ { G } ( \sigma ( i ) ) ) \right] } \end{array}
552
+ $$
553
+
554
+ Which follows since $h _ { \hat { A } } ( \sigma ( i ) ) = G ( \sigma ( i ) | S _ { i - 1 } ^ { \sigma } )$ by definition. Line 6 chooses a particular permutation in an attempt to reduce this gap. Define an element-wise form of curvature as $\kappa _ { G } \mathbf { \bar { ( } } v ) = 1 -$ $G ( v | V \backslash v ) / \bar { G } ( v ) \in [ 0 , 1 ]$ for all $v \in V$ . Note that $\kappa _ { G } = \operatorname* { m a x } _ { v \in V } \kappa _ { G } ( v )$ . If $\kappa _ { G } ( v ) \approx 0$ then $G$ is practically modular at $v$ and so $G ( v | A ) \approx G ( v )$ for any set $A$ ; in other words, $G ( v | A )$ is close to $v$ ’s maximum possible gain even if $v$ is ranked with index very late in the permutation $\sigma$ where $A$ is very large. If $\kappa _ { G } { ( v ) } \ \approx 1$ , on the other hand, then there is some set ${ \bar { A ^ { \prime } } } \subseteq V \setminus \{ v \}$ that can appreciably reduce $G ( v | A )$ relative to the maximum possible gain $G ( v )$ , and so it is best to rank $v$ very early in the order $\sigma$ where $A$ must be a small set. One heuristic to achieve these goals is to choose a permutation $\sigma$ that arranges the elements in an order non-increasing according to $\kappa _ { G } ( v )$ , meaning $\mathop { \bar { \kappa } _ { G } } ( \sigma ( 1 ) ) \geq \kappa _ { G } ( \sigma ( 2 ) ) \geq . . . .$ Choosing this order is therefore an attempt to keep each of the conditional gains $G ( \sigma ( i ) | S _ { i - 1 } ^ { \sigma } )$ as close as possible to $\sigma ( i )$ ’s maximum possible gain, $G ( \sigma ( i ) )$ . This corresponds to an attempt to reduce Eq. (34) (and correspondingly close the $G ( A ) - L ( A )$ gap) as much as possible. Line 6 of Algorithm 2 does this, subject to the requirement that the first $k$ elements of the permutation must correspond to $\hat { A }$ in order to be a subgradient. These tricks all help lines 6-9 produce a better updated approximate maximizer but at appreciably increased speed.
555
+
556
+ # 4.7 ADDITIONAL RESULTS
557
+
558
+ This section concludes by, in the form of tables and plots, providing more information about our experiments and experimental results for the algorithms mentioned above.
559
+
560
+ Table 3: Details regarding the datasets.
561
+
562
+ <table><tr><td>Dataset</td><td>News20</td><td>MNIST</td><td>CIFAR10</td><td>STL10</td><td>SVHN</td><td>Fashion</td></tr><tr><td>#Training</td><td>11314</td><td>50000</td><td>50000</td><td>5000</td><td>73257</td><td>50000</td></tr><tr><td>#Test #Feature</td><td>7532 129791</td><td>10000</td><td>10000</td><td>8000</td><td>26032</td><td>10000</td></tr><tr><td>#Class</td><td>20</td><td>28×28 10</td><td>32 × 32 ×3 10</td><td>96 × 96×3 10</td><td>32 × 32 10</td><td>28×28 10</td></tr></table>
563
+
564
+ <table><tr><td>Dataset</td><td>News20</td><td>MNIST</td><td>CIFAR10</td><td>STL10</td><td>SVHN</td><td>Fashion</td></tr><tr><td>p</td><td>50</td><td>50</td><td>20</td><td>20</td><td>20</td><td>50</td></tr><tr><td>#cluster</td><td>200</td><td>1000</td><td>1000</td><td>400</td><td>800</td><td>1000</td></tr><tr><td>Y</td><td>0.05</td><td>0.05</td><td>0.05</td><td>0.2</td><td>0.2</td><td>0.05</td></tr><tr><td>initial k</td><td>4</td><td>4</td><td>4</td><td>20</td><td>30</td><td>10</td></tr><tr><td>initial 入 initial n</td><td>6 ×10-6 3.5</td><td>1 ×10-6 0.02</td><td>8×10-7 0.01</td><td>1×10-7 0.02</td><td>1 ×10-6 0.01</td><td>1×10-6 0.02</td></tr></table>
565
+
566
+ Table 4: Parameters of MCL (Algorithm 1) and its variants for different datasets.
567
+
568
+ ![](images/7f2db911fe1930502b45addd0f0b203632a7ee72ae56c394a8074c64fdfccbb6.jpg)
569
+ Figure 9: Training error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on 20newsgroups (grey curves represents 10 random trials of SGD).
570
+
571
+ ![](images/6af7d8b24e505715c44dbbf9c8f82b88a5927bcf44863b62bfe15fc824932574.jpg)
572
+ Figure 10: Training loss vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on 20newsgroups (grey curves represents 10 random trials of SGD).
573
+
574
+ ![](images/918d6c1d71249eac6fd6e079515691612e622604c71c921c975c8a77aceb5da6.jpg)
575
+ Figure 11: Test loss vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on 20newsgroups (grey curves represents 10 random trials of SGD).
576
+
577
+ ![](images/4e433f7b560b0275fd5ff29a34cfca762ee0047f9fbebfe8e27b0f391140e2c2.jpg)
578
+ Figure 12: Training loss vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on CIFAR10 (grey curves represents 10 random trials of SGD).
579
+
580
+ ![](images/a29a96a86f98602b4d0341c56d1317658c97a095032d04b4e4246b790698b11e.jpg)
581
+ Figure 13: Test loss vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on CIFAR10 (grey curves represents 10 random trials of SGD).
582
+
583
+ ![](images/2ed2c53639a4c83f50b9501a5c240d48d0282986f84acbec6e186826ebd327c2.jpg)
584
+ Figure 14: Training error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on MNIST (grey curves represents 10 random trials of SGD).
585
+
586
+ ![](images/9700cb3bd63f6f047fe366509d0c4b8178246ad5213ee14654c10819a990c92d.jpg)
587
+ Figure 15: Training error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on Fashion-MNIST (grey curves represents 10 random trials of SGD).
588
+
589
+ ![](images/569c576c40f6ba8cd889347712a65551597276c53b62dc521fd4a36f2ead2394.jpg)
590
+ Figure 16: Training error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on STL10 (grey curves represents 10 random trials of SGD).
591
+
592
+ ![](images/4da7f424b872a6ad5debb6f80f597a008066c8963c36998cec771dc5a81eff76.jpg)
593
+ Figure 17: Training error rate $( \% )$ vs. number of distinct labeled samples ever needing loss gradient calculation (left) and number of training batches (right) on SVHN (grey curves represents 10 random trials of SGD).
parse/train/BywyFQlAW/BywyFQlAW_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BywyFQlAW/BywyFQlAW_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BywyFQlAW/BywyFQlAW_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1MOqeHYvB/H1MOqeHYvB.md ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AT YOUR FINGERTIPS: AUTOMATIC PIANO FINGERING DETECTION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Automatic Piano Fingering is a hard task which computers can learn using data. As data collection is hard and expensive, we propose to automate this process by automatically extracting fingerings from public videos and MIDI files, using computer-vision techniques. Running this process on 90 videos results in the largest dataset for PIANO-FINGERING with more than 150K notes. We show that when running a previously proposed model for automatic PIANO-FINGERING on our dataset and then fine-tuning it on manually labeled piano fingering data, we achieve state-of-the-art results. In addition to the fingering extraction method, we also introduce a novel method for transferring deep-learning computer-vision models to work on out-of-domain data, by fine-tuning it on out-of-domain augmentation proposed by a Generative Adversarial Network (GAN).
8
+
9
+ For demonstration, we anonymously release a visualization of the output of our process for a single video on https://youtu.be/Gfs1UWQhr5Q
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Learning to play the piano is a hard task taking years to master. One of the challenging aspects when learning a new piece is the fingering choice in which to play each note. While beginner booklets contain many fingering suggestions, advanced pieces often contain none or a select few. Automatic prediction of PIANO-FINGERING can be a useful addition to new piano learners, to ease the learning process of new pieces. As manually labeling fingering for different sheet music is an exhausting and expensive task1, In practice previous work (Parncutt et al., 1997; Hart et al., 2000; Jacobs, 2001; Kasimi et al., 2007; Nakamura et al., 2019) used very few tagged pieces for evaluation, with minimal or no training data.
14
+
15
+ In this paper, we propose an automatic, low-cost method for detecting PIANO-FINGERING from piano playing performances captured on videos which allows training modern - data-hungry - neural networks. We introduce a novel pipeline that adapts and combines several deep learning methods which lead to an automatic labeled PIANO-FINGERING dataset. Our method can serve two purposes: (1) an automatic “transcript” method that detects PIANO-FINGERING from video and MIDI files, when these are available, and (2) serve as a dataset for training models and then generalize to new pieces.
16
+
17
+ Given a video and a MIDI file, our system produces a probability distribution over the fingers for each played. Running this process on large corpora of piano pieces played by different artists, yields a total of 90 automatically finger-tagged pieces (containing 155,107 notes in total) and results in the first public large scale PIANO-FINGERING dataset, which we name APFD. This dataset will grow over time, as more videos are uploaded to YouTube. We provide empirical evidence that APFD is valuable, both by evaluating a model trained on it over manually labeled videos, as well as its usefulness by fine-tuning the model on a manually created dataset, which achieves state-of-the-art results.
18
+
19
+ The process of extracting PIANO-FINGERING from videos alone is a hard task as it needs to detect keyboard presses, which are often subtle even for the human eye. We, therefore, turn to MIDI files to obtain this information. The extraction steps are as follows: We begin by locating the keyboard and identify each key on the keyboard (§3.2). Then, we identify the playing hands on top of the keyboard (§3.3), and detect the fingers given the hands bounding boxes (§3.4). Next, we align between the MIDI file and its corresponding video $( \ S 3 . 6 )$ and finally assign for every pressed note, the finger which was most likely used to play it (§3.5). Albeit the expectation from steps like hand detection and pose estimation, which were extensively studied in the computer-vision literature, we find that in practice, state-of-the-art models do not excel in these tasks for our scenario. We therefore address these weaknesses by fine-tuning an object detection model $\ S 3 . 3$ on a new dataset we introduce and train a CycleGAN (Zhu et al., 2017) to address the different lighting scenarios with the pose estimation model $\ S 3 . 4$ .
20
+
21
+ ![](images/23572d61a9e441553498076726d860b2aead3796f7d7d2ab51c31f15cd1c2d82.jpg)
22
+ (b) Overlay of what we perceive on the original frame.
23
+ Figure 1: Example for detection of the overall system. We manage to automatically detect what fingers pressed each keynote of the piano.
24
+
25
+ # 2 BACKGROUND
26
+
27
+ PIANO-FINGERING was previously studied in multiple disciplines, such as music theory and computer animation (Parncutt et al., 1997; Hart et al., 2000; Jacobs, 2001; Kasimi et al., 2007; Zhu et al., 2013; Nakamura et al., 2019).
28
+
29
+ The fingering prediction task is formalized as follows: Given a sequence of notes, associate each note with a finger from the set $\{ 1 , 2 , 3 , 4 , 5 \} \times \{ L , R \}$ . This is subject to constraints such as the positions of each hand, anatomical plausibility of transitioning between two fingers, the hands’ size, etc. Each fingering sequence has a cost, which is derived from a transition cost between two fingers.
30
+
31
+ Early work modeled fingering prediction as a search problem, where the objective is to find the optimal fingering sequence to play all the notes with. A naive approach to finding the best sequence is to exhaustively evaluate all possible transitions between one note to another which is not computationally feasible. By defining a transition matrix corresponding to the probability or “difficulty” of transitioning from one note to another - one can calculate a cost function, which defines the predicted sequence likelihood. Using a search algorithm on top of the transitions allows finding a globally optimal solution. This solution is not practical as well, due to the exponential complexity, and therefore heuristics or pruning are employed to reduce the space complexity. The transition matrix can be manually defined by heuristics or personal estimation (Parncutt et al., 1997; Hart et al., 2000), or instead, not relying on a pre-defined set of rules, and use a Hidden Markov Model (HMM) to learn the transitions (Yonebayashi et al., 2007; Nakamura et al., 2014). In practice, (Yonebayashi et al., 2007) leaves the parameter learning to future work, and instead they manually fine-tune the transition matrix.
32
+
33
+ On top of the transition matrix, practitioners suggested using dynamic programming algorithms to solve the search (Hart et al., 2000). Another option to solve the huge search space is to use a search algorithm such as Tabu search (Glover & Laguna, 1998) or variable neighborhood search (Mladenovic & Hansen, 1997), to find a global plausible solution (Balliauw et al., 2015; 2017). ´ These works are either limited by the defined transition rules, or by making different assumptions to facilitate the search space. Such assumptions come in the form of limiting the predictions to a single hand, limiting the evaluation pieces to contain no chords, rests or substantial lengths during which player can take their hand off the keyboard. Furthermore, all of these works have very small evaluation sets, which in practice makes it hard to compare different approaches, and does not allow to use more advanced models such as neural networks.
34
+
35
+ In this work, we continue the transition of search-based methods that optimize a set of constraints with learning methods that try to imitate human behavior by the use of large datasets. In practice, these methods require lots of training data to achieve good performance, and fingering labeling is particularly expensive and hard to obtain. One way to automatically gather rich fingering data with full hand pose estimation is by using motion capture (MOCAP) gloves when playing the piano. Zhu et al. (2013) suggests a rule-based and data-based hybrid method, initially estimating fingering decisions using a Directed Acyclic Graph (DAG) based on rule-based comfort constraints which are smoothed using data recorded from limited playing sessions with motion capture gloves. As MOCAP requires special equipment and may affect the comfort of the player, other work, (Takegawa et al., 2006) tried to automatically detect piano fingering from video and MIDI files. The pianist’s fingernails were laid with colorful markers, which were detected by a computer vision program. As some occlusions can occur, they used some rules to correct the detected fingering. In practice, they implemented the system with a camera capturing only 2 octaves (out of 8) and performed a very limited evaluation. The rules they used are simple (such as: restricting one finger per played note, two successive notes cannot be played with the same finger), but far from capturing real-world scenarios.
36
+
37
+ Previous methods for automatically collecting data (Takegawa et al., 2006; Zhu et al., 2013) were costly, as apart of the equipment needed during the piece playing, and the data-collectors had to pay the participating pianists. In our work, we rely solely on videos from YouTube, meaning costs remain minimal with the ability to scale up to new videos.
38
+
39
+ Recently, Nakamura et al. (2019) released a relatively large dataset of manually labeled PIANOFINGERING by one to six annotators, consisting of 150 pieces, with partially annotated scores (324 notes per piece on average) with a total of 48,726 notes matched with 100,044 tags from multiple annotators. This is the largest annotated PIANO-FINGERING corpus to date and a valuable resource for this field. The authors propose multiple methods for modeling the task of PIANO-FINGERING, including HMMs and neural networks, and report the best performance with an HMM-based model. In this work, we use their dataset as a gold dataset for comparison and adapt their model to compare to our automatically generated dataset.
40
+
41
+ # 3 OUR APPROACH: EXTRACTING FINGERING FROM ONLINE VIDEOS
42
+
43
+ There is a genre of online videos in which people upload piano performances where both the piano and the hands are visible. On some channels, people not only include the video but also the MIDI file recorded while playing the piece. We propose to use machine learning techniques to extract fingering information from such videos, enabling the creation of a large dataset of pieces and their fingering information. This requires the orchestration and adaptation of several techniques, which we describe below.
44
+
45
+ The final output we produce is demonstrated in Figure 1, where we colored both the fingers and the played notes based on the pose-estimation model (§3.4) and the predicted fingers that played them (§3.5). Note that the ring fingers of both hands as well as the index finger of the left hand and the middle finger of the right hand do not press any note in this particular frame, but may play a note in others. We get the information of played notes from the MIDI events.
46
+
47
+ # 3.1 DATA SOURCE
48
+
49
+ We extract videos from youtube.com, played by different piano players on a specific channel containing both video and MIDI files. In these videos, the piano is filmed in a horizontal angle directly to the keyboard, from which both the keyboard and hands are displayed (as can be seen in Figure 1).
50
+
51
+ MIDI files A standard protocol for the interchange of musical information between musical instruments, synthesizers, and computers Musical Instrument Digital Interface (MIDI) is a standard format for the interchange of musical information between electronic musical instruments. It consists of a sequence of events describing actions to carry out, when, and allows for additional attributes. In the setup of piano recording, it records what note was played in what time for how long and its pressure strength (velocity). We only use videos that come along with a MIDI file, and use it as the source for the played notes and their timestamp.
52
+
53
+ # 3.2 KEYBOARD AND BOUNDARIES DETECTION
54
+
55
+ To allow a correct fingering assignment, we first have to find the keyboard and the bounding boxes of the keys. We detect the keyboard as the largest continuous bright area in the video and identify key boundaries using standard image processing techniques, taking into account the expected number of keys and their predictable location and clear boundaries. For robustness and in order to handle the interfering hands that periodically hide parts of the piano, we combine information from multiple random frames by averaging the predictions from each frame.
56
+
57
+ # 3.3 HAND DETECTION
58
+
59
+ A straightforward approach for getting fingers locations in an image is to use a pose estimation model directly on the entire image. In practice, common methods for full-body pose estimation such as OpenPose (Cao et al., 2017) containing hand pose estimation (Simon et al., 2017), make assumptions about the wrist and elbow locations to automatically approximate the hands’ locations. In the case of piano playing, the elbow does not appear in the videos, therefore these systems don’t work. We instead, turn to a pipeline approach where we start by detecting the hands, cropping them, and passing the cropped frames to a pose estimation model that expects the hand to be in the middle of the frame.
60
+
61
+ Object Detection (Viola & Jones, 2001; Redmon et al., 2016; Lin et al., 2017a;b), and specifically Hand Detection (Simon et al., 2017; Kolsch & Turk, 2004; Sridhar et al., 2015) are well studied sub-¨ jects. However, out of the published work providing source code, the code was either complicated to run (e.g. versioning, mobile-only builds, supporting specific GPU, etc.), containing private datasets, or only detecting hands with no distinction between left and right, which is important in our case.
62
+
63
+ We, therefore, created a small dataset with random frames from different videos, corresponding to 476 hands in total evenly split between left and right2. We then fine-tuned a pre-trained object detection model (Inception v2 (Ioffe & Szegedy, 2015), based on Faster R-CNN (Ren et al., 2015), trained on COCO challenge (Lin et al., 2014)) on our new dataset. The fine-tuned model works reasonably well and some hand detection bounding boxes are presented in Figure 1. We release this new dataset and the trained model alongside the rest of the resources developed in this work.
64
+
65
+ Having a working hand-detection model, we perform hand detection on every frame in the video. If more than two hands are detected, we take the 2 highest probability defections as the correct bounding boxes. If two hands are detected with the same label (“left-left” or “right-right”), we discard the model’s label, and instead choose the leftmost bounding box to have the label “left” and the other to have the label “right” - which is the most common position of hands on the piano.
66
+
67
+ # 3.4 FINGER POSE ESTIMATION
68
+
69
+ Having the bounding box of each hand is not enough, as in order to assign fingers to notes we need the hand’s pose. How can we detect fingers that pressed the different keys? We turn to pose estimation models, a well-studied subject in computer vision and use standard models (Wei et al., 2016).
70
+
71
+ Using off-the-shelve pose estimation model, turned to often fail in our scenario. Some failure example are presented in Figure 2c where the first pose is estimated correctly, but the rest either have wrong finger positions, shorter, or broken fingers. The videos we use contain visual effects (e.g. LED lights are turned on every time a key is pressed), and such the pose-estimation models exhibit two failures: (1) when the LED colors are warm (red, orange, yellow), the model sees the light as an extension to the finger, and as such poorly estimates where the keypoints are for each finger; (2) when the LED colors are cool (green, blue, white), the over-saturation seems to overwhelm the model, and it mistakenly estimates the hand’s pose as much shorter, considering the lit parts of the piano as part of the background. Some examples of these errors are presented in Figure 2c. Furthermore, the videos are usually very dark, high-contrast, and blurry due to motion blur, which standard datasets (Tompson et al., 2014; Yuan et al., 2017; Simon et al., 2017) and models trained on top of them rarely encounter.
72
+
73
+ ![](images/24ec1b4bf69fe818fd3bfbb79136b6f7e1cc72b3b43122e37e44a7d4d5629c12.jpg)
74
+ Figure 2: Output of CycleGAN on 5 images, with 5 different checkpoints. The colors drawn on the hands depict the pose estimation of the hands.
75
+
76
+ Given the observation that pose-estimation works well on well lid-images, how can we augment the pose estimation model to other lighting situations? This scenario is similar to sim2real works (Sadeghi et al., 2018; Gupta & Booher; Gamrian & Goldberg, 2018) where one wants to transfer a model from simulations to the real-world. These works learn a mapping function $G _ { 1 } : T S$ that transfer instances $x _ { i }$ from the target domain $T$ (the real-world) into the source domain $S$ (the simulation), where the mapping is usually achieved by employing a CycleGan (Zhu et al., 2017). Then, models which are trained on the source domain are used on the transformation of the target domain $G _ { 1 } ( x _ { i } )$ and manage to generalize on the target domain. In our setup, we seek a mapping $G _ { 2 } : S T$ that transforms the source domain (i.e the well-lid videos) into the target data (i.e the challenging lighted scenarios). After obtaining the transformation function $G _ { 2 }$ , we employ the pose estimation model $f$ on the source domain, use the transformation separately, and align the prediction to the new representation. This novel setup benefits from performance boost as we only use the transformation function offline, before training and avoid using it for every prediction. We also benefit of better generalization as we keep good performance on the source domain, and gain major performance on the target domain.
77
+
78
+ We manually detect videos and assign them into their group (well-lit or poorly-lit). Then, we automatically detect and crop hands from random frames, resulting in 21,747 well-lit hands, and 12,832 poorly lit hands. We then trained a CycleGAN for multiple epochs and chose 15 training checkpoints that produced different lighting scenarios (some examples can be seen in Figure 2). We then fine-tune a pose-estimation model on the original, well lit frames, and on the 15 transformed frames. This procedure results in a model that is robust to different lighting scenarios, as we show in Figures 2b and 2d, demonstrating its performance on different lighting scenarios.
79
+
80
+ # 3.5 PRESSED FINGER ESTIMATION
81
+
82
+ Given that we know which notes were pressed in any given frame (see $\ S 3 . 6$ below), there is still uncertainty as to which finger pressed them. This uncertainty either comes from imperfect pose estimation, or multiple fingers located on top of a single note. We model the finger press estimation by calculating the probability of a specific finger to have been used, given the hand’s pose and the pressed note:
83
+
84
+ $$
85
+ a r g m a x _ { i , j } P ( f _ { i } , h _ { j } | n _ { k } )
86
+ $$
87
+
88
+ where $i \in [ 1 , 5 ]$ for the 5 fingers, $h _ { j } \in \{ h _ { l } , h _ { r } \}$ stands for the hand being used (left or right) and $n _ { k } \in [ 1 , 8 8 ]$ corresponding to the played key.
89
+
90
+ We chose to estimate the pressed fingers as a Gaussian distribution ${ \mathcal { N } } ( \mu , \sigma ^ { 2 } )$ , where $\mu$ and $\sigma$ are defined as follows:
91
+
92
+ $$
93
+ \sigma ( n _ { k } ) = X _ { n _ { k + 1 } } - X _ { n _ { k } } , \quad \mu ( n _ { k } ) = X _ { n _ { k } } + 0 . 5 * \sigma
94
+ $$
95
+
96
+ $\mu$ is the center of the key on the $x$ axis and $\sigma$ is its width. The score of each finger given a note in a specific frame is defined as:
97
+
98
+ $$
99
+ g ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) = f ( X _ { f _ { i } , h _ { j } | f r a m e } | \mu ( n _ { k } ) , \sigma ( n _ { k } ) ^ { 2 } )
100
+ $$
101
+
102
+ The probability of a given finger to have played a note given a note and a frame: (normalizing $g$ for all fingers)
103
+
104
+ $$
105
+ p ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) = { \frac { g ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) } { \sum _ { n = 1 } ^ { 5 } \sum _ { m \in \{ l , r \} } g ( f _ { n } , h _ { m } | n _ { k } , f r a m e ) } }
106
+ $$
107
+
108
+ As most keyboard presses last more than one frame, we make use of multiple frames to overcome some of the errors from previous steps and to estimate a more accurate prediction. For this reason, we aggregate the frames that were used during a key press. We treat the first frame as the main signal point, and assign each successive frame an exponentially declining weight
109
+
110
+ $$
111
+ \begin{array} { r } { p ( f _ { i } , h _ { j } | n _ { k } , f r a m e _ { k _ { 1 } } , . . . f r a m e _ { k _ { n } } ) = \frac { \sum _ { l = 1 } ^ { n } 0 . 5 ^ { l } * p ( f _ { i } , h _ { j } | n _ { k } , f r a m e _ { k _ { l } } ) } { \sum _ { l = 1 } ^ { n } 0 . 5 ^ { l } } } \end{array}
112
+ $$
113
+
114
+ As finger changes can occur in later frames. Finally, we normalize the weighted sum of probabilities to achieve a probability distribution for all frames.
115
+
116
+ In our dataset, we release all probabilities for each played note, along with the maximum likelihood finger estimation. We define the “confidence” score of the extraction from a single piece, as the product of the highest probability for a finger for each note. Figure 3 shows the precision and recall of the predictions based on a cutoff for the highest probability of the note. We see a positive correlation between confidence threshold and precision, and a negative correlation between confidence and recall, meaning we can get relatively high precision for a small number of notes, or relatively low precision for a high number of notes.
117
+
118
+ ![](images/79b5678a872fcf1b743705dceb80d6ecb0e3836b0a057e1717d2856b207ec818.jpg)
119
+ Figure 3: Precision and recall based on confidence for all 6,894 manually tagged notes
120
+
121
+ # 3.6 VIDEO AND MIDI ALIGNMENT
122
+
123
+ We consider the MIDI and video files to be complementary, as they were recorded simultaneously. The MIDI files are the source to which keys were pressed, in what time, and for how long. The videos are the source for the piano, hands, and fingers locations. These two sources are not synchronized, but as they depict the same piano performance, a perfect alignment exist (up to the video frequency resolution).
124
+
125
+ We extract the audio track from the video, and treat the first audio peak as the beginning of the piece, clipping the prior part of the video and aligning it with the first event from the MIDI file. In practice, we determine this starting point as the first point in the signal where the signal amplitude is higher than a fifth of the mean absolute value of the entire signal.
126
+
127
+ This heuristic achieves a reasonable alignment, but we observe some alignment mismatch of 80- $2 0 0 \mathrm { m s }$ . We tackle the misalignment by using a signal from the final system confidence (Section 3.5), where every piece gets a final score estimation after running the whole process, depicting the system confidence on the predicted notes. We look for an alignment that maximizes the system confidence over the entire piece:
128
+
129
+ $$
130
+ a l i g n m e n t ( M I D I , V i d e o ) = a r g m a x _ { i } s c o r e ( M I D I _ { t _ { 0 } } , V i d e o _ { t _ { i } } )
131
+ $$
132
+
133
+ where $M I D I _ { t _ { 0 } }$ is the starting time of the MIDI file, and $V i d e o _ { t _ { j } }$ is the alignment time of the video. $V i d e o _ { t _ { 0 } }$ is obtained by the heuristic alignment described in the previous paragraph. We use the confidence score as a proxy of the alignment precision and search the alignment that maximizes the confidence score of the system. More specifically, given the initial offset from the audio-MIDI alignment, we take a window of 1 second in frames (usually 25) for each side and compute the score of the final system on the entire piece. We choose the offset that results in the best confidence score as the alignment offset.
134
+
135
+ # 3.7 THE RESULTING DATASET: APFD
136
+
137
+ We follow the methods described in this section, and use it to label 90 piano pieces from 42 different composers with 155,107 notes in total. On average, each piece contains 1,723 notes.
138
+
139
+ # 4 RESULTS
140
+
141
+ In this section, we present multiple evaluations of our overall system. We begin by evaluating the entire process where we assess how the overall system performs on predicting the pressed fingering. Next, we use the dataset we collected and train a PIANO-FINGERING model. We fine-tune this model on a previously manually-annotated dataset for PIANO-FINGERING and show using our data achieves better performance.
142
+
143
+ As piano pieces are usually played by two hands, we avoid modeling each hand separately, and instead use their symmetry property, and simply flip one hand’s notes, matching it to the piano scale, following previous work practice (Nakamura et al., 2019).
144
+
145
+ For evaluation, we use the match rate between the prediction and the ground truth. For cases where there is a single ground truth, this is equivalent to accuracy measurement. When more than one labeling is available, we simply average the accuracies with each labeling.3
146
+
147
+ # 4.1 FINGER PRESS ESTIMATION EVALUATION
148
+
149
+ As the pose estimation is one of the major components directly affecting our system’s performance, we isolate this part in order to estimate the gain from fine-tuning using the CycleGAN (Section 3.4).
150
+
151
+ We manually annotated five random pieces from our dataset by marking the pressing finger for each played note in the video. Then, by using our system (§3.5), we estimate what finger was used for each key. We use the confidence score produced by the model as a threshold to use or discard the key prediction of the model, and report precision, recall and F1 scores of multiple thresholds. Moreover, we compare the scores of these pieces with and without using the CycleGAN. We do so for the five annotated pieces and report these results in Table 1. When considering a high confidence score $( > 9 0 \% )$ both the pre-trained and fine-tuned models correctly mark all considered notes (which consist of between $34 \div 3 6 \%$ of the data). However, when considering decreasing confidences, the fine-tuned model manages to achieve higher precision and higher recall, contributing to an overall higher f1 score. With no confidence threshold (i.e using all fingering predictions), the pre-trained model achieves $93 \%$ F1, while the fine-tuned one achieves $9 7 \%$ F1, a $57 \%$ error reduction.
152
+
153
+ 4.2 AUTOMATIC PIANO FINGERING PREDICTION
154
+
155
+ <table><tr><td rowspan=1 colspan=1>Confidence</td><td rowspan=1 colspan=3>c&gt;0.9</td><td rowspan=1 colspan=3>c&gt;0.75</td><td rowspan=1 colspan=3>c&gt;0.5</td><td rowspan=1 colspan=3>c&gt;0</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td></tr><tr><td rowspan=1 colspan=1>Pretrained</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.34</td><td rowspan=1 colspan=1>0.51</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.49</td><td rowspan=1 colspan=1>0.65</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.78</td><td rowspan=1 colspan=1>0.86</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.93</td></tr><tr><td rowspan=1 colspan=1>FT Single Frame</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>0.53</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.52</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>0.97</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.95</td></tr><tr><td rowspan=1 colspan=1>FT Multiple Frames</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.52</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.98</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.94</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.97</td></tr></table>
156
+
157
+ Table 1: Precision, Recall, F1 scores for 6,894 notes we manually tagged across 5 different pieces, at different confidence points. The first row depict the performance of the system with the vanilla pose estimation. The second and the third rows present the results on the fine-tuned (FT) pose estimation model 3.4 on a single and multiple frames accordingly.
158
+
159
+ In order to assess the value of APFD, we seek to show its usefulness on the end task: Automatic Piano Fingering. To this end, we train a standard sequence tagging neural model using our dataset, evaluating on the subset of the videos we manually annotated. Then, we fine-tune this model on PIG (Nakamura et al., 2019), a manually labeled dataset, on which we achieve superior results than simply training on that dataset alone.
160
+
161
+ We model the PIANO-FINGERING as a sequence labeling task, where given a sequence of notes $n _ { 1 } , n _ { 2 } , . . . , n _ { n }$ we need to predict a sequence of fingering: $y _ { 1 } , y _ { 2 } , . . . , y _ { n }$
162
+
163
+ <table><tr><td>Training/Dataset</td><td>APFD</td><td>PIG</td></tr><tr><td>Previous Neural Previous SOTA</td><td></td><td rowspan="3">61.3 64.5 71.4</td></tr><tr><td>Human Agreement</td><td>一</td></tr><tr><td>PIG</td><td>49.9</td></tr><tr><td>+ Fine-tune APFD</td><td>73.6</td><td>64.1 54.4</td></tr><tr><td>APFD</td><td>73.2</td><td>55.2</td></tr><tr><td>+ Fine-tune PIG</td><td>62.9</td><td>66.8</td></tr></table>
164
+
165
+ Table 2: Results of training and fine tuning on different dataset.
166
+
167
+ where $y _ { i } \in \mathsf { \bar { \{ 1 , 2 , 3 , 4 , 5 \} } }$ corresponding to 5 fingers of one hand. We employ a standard sequence tagging technique, by embedding each note and using a BiLSTM on top of it. On every contextualized note we then use a Multi-Layer-Perceptron (MLP) to predict the label. The model is trained to minimize cross-entropy loss. This is the same model used in (Nakamura et al., 2019), referred to as DNN (LSTM).
168
+
169
+ # 4.2.1 PIANO FINGERING MODEL
170
+
171
+ Nakamura et al. (2019) didn’t use a development set, therefore in this work, we leave 1 piece from the training set and make it a development set. Our dataset—APFD—is composed of 90 pieces, which we split into 75/10 for training and development sets respectively, and use the 5 manually annotated pieces as a test set. We note that the development set is silver data (automatically annotated) and probably contains mistakes. The results are summarized in Table 1. We run the same architecture by (Nakamura et al., 2019) with some different hyperparameters and achieve $7 1 . 4 \% / 6 4 . 1 \%$ on our and PIG’s test set respectively. To evaluate the usefulness of our data to PIG’s data, we use the model trained on our silver data and fine-tune it on PIG. This results in $6 6 . 8 \%$ accuracy, $2 . 3 \%$ above the previous state-of-the-art model which was achieved by an HMM (Nakamura et al., 2019). We attribute this gain in performance to our dataset, which both increases the number of training examples and allows to train bigger neural models which excel with more training examples. We also experiment in the opposite direction and fine-tune the model trained on PIG with our data, which result in $7 3 . 6 \%$ accuracy, which is better than training on our data alone, achieving $7 3 . 2 \%$ accuracy.
172
+
173
+ # 5 DISCUSSION AND FUTURE WORK
174
+
175
+ In this work, we present an automatic method for detecting PIANO-FINGERING from MIDI and video files of a piano performance. We employ this method on a large set of videos, and create the first large scale PIANO-FINGERING dataset, containing 90 unique pieces, with 155,107 notes in total. We show this dataset—although being noisy–is valuable, by training a neural network model on it, fine-tuning on a gold dataset, where we achieve state-of-the-art results. In future work, we intend to improve the data collection by improving the pose-estimation model, better handling high speed movements and the proximity of the hands, which often cause errors in estimating their pose. Furthermore, we intend to design improved neural models that can take previous fingering predictions into account, in order to have a better global fingering transition.
176
+
177
+ # REFERENCES
178
+
179
+ Matteo Balliauw, Dorien Herremans, Daniel Palhazi Cuervo, and Kenneth Sorensen. Generating ¨ fingerings for polyphonic piano music with a tabu search algorithm. In International Conference on Mathematics and Computation in Music, pp. 149–160. Springer, 2015.
180
+
181
+ Matteo Balliauw, Dorien Herremans, Daniel Palhazi Cuervo, and Kenneth Sorensen. A variable ¨ neighborhood search algorithm to generate piano fingerings for polyphonic sheet music. International Transactions in Operational Research, 24(3):509–535, 2017.
182
+
183
+ Zhe Cao, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Realtime multi-person 2d pose estimation using part affinity fields. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7291–7299, 2017.
184
+
185
+ Shani Gamrian and Yoav Goldberg. Transfer learning for related reinforcement learning tasks via image-to-image translation. arXiv preprint arXiv:1806.07377, 2018.
186
+
187
+ Fred Glover and Manuel Laguna. Tabu search. In Handbook of combinatorial optimization, pp. 2093–2229. Springer, 1998.
188
+
189
+ Anchit Gupta and Jonathan Booher. Cyclegan for sim2real domain adaptation.
190
+
191
+ Melanie Hart, Robert Bosch, and Elbert Tsai. Finding optimal piano fingerings. The UMAP Journal, 21(2):167–177, 2000.
192
+
193
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
194
+
195
+ J Pieter Jacobs. Refinements to the ergonomic model for keyboard fingering of parncutt, sloboda, clarke, raekallio, and desain. Music Perception: An Interdisciplinary Journal, 18(4):505–511, 2001.
196
+
197
+ Alia Al Kasimi, Eric Nichols, and Christopher Raphael. A simple algorithm for automatic generation of polyphonic piano fingerings. In ISMIR, 2007.
198
+
199
+ Mathias Kolsch and Matthew Turk. Robust hand detection. In ¨ FGR, pp. 614–619, 2004.
200
+
201
+ 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 ´ European conference on computer vision, pp. 740–755. Springer, 2014.
202
+
203
+ Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie.´ Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2117–2125, 2017a.
204
+
205
+ Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense ´ object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017b.
206
+
207
+ Nenad Mladenovic and Pierre Hansen. Variable neighborhood search. ´ Computers & operations research, 24(11):1097–1100, 1997.
208
+
209
+ Eita Nakamura, Nobutaka Ono, and Shigeki Sagayama. Merged-output hmm for piano fingering of both hands. In ISMIR, pp. 531–536, 2014.
210
+
211
+ Eita Nakamura, Yasuyuki Saito, and Kazuyoshi Yoshii. Statistical learning and estimation of piano fingering. arXiv preprint arXiv:1904.10237, 2019.
212
+
213
+ Richard Parncutt, John A Sloboda, Eric F Clarke, Matti Raekallio, and Peter Desain. An ergonomic model of keyboard fingering for melodic fragments. Music Perception: An Interdisciplinary Journal, 14(4):341–382, 1997.
214
+
215
+ Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 779–788, 2016.
216
+
217
+ Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015.
218
+
219
+ Fereshteh Sadeghi, Alexander Toshev, Eric Jang, and Sergey Levine. Sim2real viewpoint invariant visual servoing by recurrent control. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4691–4699, 2018.
220
+
221
+ Tomas Simon, Hanbyul Joo, Iain Matthews, and Yaser Sheikh. Hand keypoint detection in single images using multiview bootstrapping. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 1145–1153, 2017.
222
+
223
+ Srinath Sridhar, Franziska Mueller, Antti Oulasvirta, and Christian Theobalt. Fast and robust hand tracking using detection-guided optimization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3213–3221, 2015.
224
+
225
+ Yoshinari Takegawa, Tsutomu Terada, and Shojiro Nishio. Design and implementation of a real-time fingering detection system for piano performance. In ICMC, 2006.
226
+
227
+ Jonathan Tompson, Murphy Stein, Yann Lecun, and Ken Perlin. Real-time continuous pose recovery of human hands using convolutional networks. ACM Transactions on Graphics, 33, August 2014.
228
+
229
+ Paul Viola and Michael Jones. Rapid object detection using a boosted cascade of simple features. CVPR (1), 1(511-518):3, 2001.
230
+
231
+ Shih-En Wei, Varun Ramakrishna, Takeo Kanade, and Yaser Sheikh. Convolutional pose machines. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4724– 4732, 2016.
232
+
233
+ Yuichiro Yonebayashi, Hirokazu Kameoka, and Shigeki Sagayama. Automatic decision of piano fingering based on a hidden markov models. In IJCAI, pp. 2915–2921, 2007.
234
+
235
+ Shanxin Yuan, Qi Ye, Bjorn Stenger, Siddhant Jain, and Tae-Kyun Kim. Bighand2. 2m benchmark: Hand pose dataset and state of the art analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4866–4874, 2017.
236
+
237
+ Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017.
238
+
239
+ Yuanfeng Zhu, Ajay Sundar Ramakrishnan, Bernd Hamann, and Michael Neff. A system for automatic animation of piano performances. Computer Animation and Virtual Worlds, 24(5):445–457, 2013.
240
+
241
+ # Appendices
242
+
243
+ A DATASET SAMPLES
244
+
245
+ For every video our system extracts PIANO-FINGERING from it also outputs the video overlayed by the estimation of the piano keys, an indication of which notes are played, and what fingers are being used to play them (the key’s color), up to two bounding boxes, for both hands (where light blue means left hand, and light green means right hand), and the pose estimation for each hand.
246
+
247
+ We include the output videos for all of the pieces we manually annotated to visually demonstrate our system and its accuracy on different playing cases. The videos were uploaded to a new, anonymous YouTube channel, and each contain a link to the original video in the description.
248
+
249
+ River Flows in You: https://youtu.be/Gfs1UWQhr5Q Faded: https://youtu.be/LU2ibOW6z7U
250
+
251
+ Moonlight Sonata 1st Movement: https://youtu.be/wp8j239fs9o Rondo Alla Turca: https://youtu.be/KqTaPfoIuuE Nocturne in E Flat Major (Op. 9 No. 2): https://youtu.be/xXHUUzTa5vU
parse/train/H1MOqeHYvB/H1MOqeHYvB_content_list.json ADDED
@@ -0,0 +1,1404 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "AT YOUR FINGERTIPS: AUTOMATIC PIANO FINGERING DETECTION ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 99,
9
+ 704,
10
+ 147
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 171,
20
+ 398,
21
+ 198
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 234,
32
+ 544,
33
+ 251
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Automatic Piano Fingering is a hard task which computers can learn using data. As data collection is hard and expensive, we propose to automate this process by automatically extracting fingerings from public videos and MIDI files, using computer-vision techniques. Running this process on 90 videos results in the largest dataset for PIANO-FINGERING with more than 150K notes. We show that when running a previously proposed model for automatic PIANO-FINGERING on our dataset and then fine-tuning it on manually labeled piano fingering data, we achieve state-of-the-art results. In addition to the fingering extraction method, we also introduce a novel method for transferring deep-learning computer-vision models to work on out-of-domain data, by fine-tuning it on out-of-domain augmentation proposed by a Generative Adversarial Network (GAN). ",
40
+ "bbox": [
41
+ 233,
42
+ 265,
43
+ 764,
44
+ 417
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "For demonstration, we anonymously release a visualization of the output of our process for a single video on https://youtu.be/Gfs1UWQhr5Q ",
51
+ "bbox": [
52
+ 232,
53
+ 420,
54
+ 764,
55
+ 448
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 473,
66
+ 336,
67
+ 488
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Learning to play the piano is a hard task taking years to master. One of the challenging aspects when learning a new piece is the fingering choice in which to play each note. While beginner booklets contain many fingering suggestions, advanced pieces often contain none or a select few. Automatic prediction of PIANO-FINGERING can be a useful addition to new piano learners, to ease the learning process of new pieces. As manually labeling fingering for different sheet music is an exhausting and expensive task1, In practice previous work (Parncutt et al., 1997; Hart et al., 2000; Jacobs, 2001; Kasimi et al., 2007; Nakamura et al., 2019) used very few tagged pieces for evaluation, with minimal or no training data. ",
74
+ "bbox": [
75
+ 174,
76
+ 503,
77
+ 825,
78
+ 616
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "In this paper, we propose an automatic, low-cost method for detecting PIANO-FINGERING from piano playing performances captured on videos which allows training modern - data-hungry - neural networks. We introduce a novel pipeline that adapts and combines several deep learning methods which lead to an automatic labeled PIANO-FINGERING dataset. Our method can serve two purposes: (1) an automatic “transcript” method that detects PIANO-FINGERING from video and MIDI files, when these are available, and (2) serve as a dataset for training models and then generalize to new pieces. ",
85
+ "bbox": [
86
+ 174,
87
+ 622,
88
+ 825,
89
+ 719
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Given a video and a MIDI file, our system produces a probability distribution over the fingers for each played. Running this process on large corpora of piano pieces played by different artists, yields a total of 90 automatically finger-tagged pieces (containing 155,107 notes in total) and results in the first public large scale PIANO-FINGERING dataset, which we name APFD. This dataset will grow over time, as more videos are uploaded to YouTube. We provide empirical evidence that APFD is valuable, both by evaluating a model trained on it over manually labeled videos, as well as its usefulness by fine-tuning the model on a manually created dataset, which achieves state-of-the-art results. ",
96
+ "bbox": [
97
+ 174,
98
+ 727,
99
+ 825,
100
+ 837
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "The process of extracting PIANO-FINGERING from videos alone is a hard task as it needs to detect keyboard presses, which are often subtle even for the human eye. We, therefore, turn to MIDI files to obtain this information. The extraction steps are as follows: We begin by locating the keyboard and identify each key on the keyboard (§3.2). Then, we identify the playing hands on top of the keyboard (§3.3), and detect the fingers given the hands bounding boxes (§3.4). Next, we align between the MIDI file and its corresponding video $( \\ S 3 . 6 )$ and finally assign for every pressed note, the finger which was most likely used to play it (§3.5). Albeit the expectation from steps like hand detection and pose estimation, which were extensively studied in the computer-vision literature, we find that in practice, state-of-the-art models do not excel in these tasks for our scenario. We therefore address these weaknesses by fine-tuning an object detection model $\\ S 3 . 3$ on a new dataset we introduce and train a CycleGAN (Zhu et al., 2017) to address the different lighting scenarios with the pose estimation model $\\ S 3 . 4$ . ",
107
+ "bbox": [
108
+ 174,
109
+ 845,
110
+ 823,
111
+ 901
112
+ ],
113
+ "page_idx": 0
114
+ },
115
+ {
116
+ "type": "image",
117
+ "img_path": "images/23572d61a9e441553498076726d860b2aead3796f7d7d2ab51c31f15cd1c2d82.jpg",
118
+ "image_caption": [
119
+ "(b) Overlay of what we perceive on the original frame. ",
120
+ "Figure 1: Example for detection of the overall system. We manage to automatically detect what fingers pressed each keynote of the piano. "
121
+ ],
122
+ "image_footnote": [],
123
+ "bbox": [
124
+ 173,
125
+ 66,
126
+ 825,
127
+ 354
128
+ ],
129
+ "page_idx": 1
130
+ },
131
+ {
132
+ "type": "text",
133
+ "text": "",
134
+ "bbox": [
135
+ 174,
136
+ 430,
137
+ 825,
138
+ 541
139
+ ],
140
+ "page_idx": 1
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "2 BACKGROUND ",
145
+ "text_level": 1,
146
+ "bbox": [
147
+ 176,
148
+ 564,
149
+ 326,
150
+ 580
151
+ ],
152
+ "page_idx": 1
153
+ },
154
+ {
155
+ "type": "text",
156
+ "text": "PIANO-FINGERING was previously studied in multiple disciplines, such as music theory and computer animation (Parncutt et al., 1997; Hart et al., 2000; Jacobs, 2001; Kasimi et al., 2007; Zhu et al., 2013; Nakamura et al., 2019). ",
157
+ "bbox": [
158
+ 174,
159
+ 595,
160
+ 823,
161
+ 637
162
+ ],
163
+ "page_idx": 1
164
+ },
165
+ {
166
+ "type": "text",
167
+ "text": "The fingering prediction task is formalized as follows: Given a sequence of notes, associate each note with a finger from the set $\\{ 1 , 2 , 3 , 4 , 5 \\} \\times \\{ L , R \\}$ . This is subject to constraints such as the positions of each hand, anatomical plausibility of transitioning between two fingers, the hands’ size, etc. Each fingering sequence has a cost, which is derived from a transition cost between two fingers. ",
168
+ "bbox": [
169
+ 174,
170
+ 645,
171
+ 825,
172
+ 700
173
+ ],
174
+ "page_idx": 1
175
+ },
176
+ {
177
+ "type": "text",
178
+ "text": "Early work modeled fingering prediction as a search problem, where the objective is to find the optimal fingering sequence to play all the notes with. A naive approach to finding the best sequence is to exhaustively evaluate all possible transitions between one note to another which is not computationally feasible. By defining a transition matrix corresponding to the probability or “difficulty” of transitioning from one note to another - one can calculate a cost function, which defines the predicted sequence likelihood. Using a search algorithm on top of the transitions allows finding a globally optimal solution. This solution is not practical as well, due to the exponential complexity, and therefore heuristics or pruning are employed to reduce the space complexity. The transition matrix can be manually defined by heuristics or personal estimation (Parncutt et al., 1997; Hart et al., 2000), or instead, not relying on a pre-defined set of rules, and use a Hidden Markov Model (HMM) to learn the transitions (Yonebayashi et al., 2007; Nakamura et al., 2014). In practice, (Yonebayashi et al., 2007) leaves the parameter learning to future work, and instead they manually fine-tune the transition matrix. ",
179
+ "bbox": [
180
+ 174,
181
+ 708,
182
+ 825,
183
+ 888
184
+ ],
185
+ "page_idx": 1
186
+ },
187
+ {
188
+ "type": "text",
189
+ "text": "On top of the transition matrix, practitioners suggested using dynamic programming algorithms to solve the search (Hart et al., 2000). Another option to solve the huge search space is to use a search algorithm such as Tabu search (Glover & Laguna, 1998) or variable neighborhood search (Mladenovic & Hansen, 1997), to find a global plausible solution (Balliauw et al., 2015; 2017). ´ These works are either limited by the defined transition rules, or by making different assumptions to facilitate the search space. Such assumptions come in the form of limiting the predictions to a single hand, limiting the evaluation pieces to contain no chords, rests or substantial lengths during which player can take their hand off the keyboard. Furthermore, all of these works have very small evaluation sets, which in practice makes it hard to compare different approaches, and does not allow to use more advanced models such as neural networks. ",
190
+ "bbox": [
191
+ 174,
192
+ 895,
193
+ 823,
194
+ 924
195
+ ],
196
+ "page_idx": 1
197
+ },
198
+ {
199
+ "type": "text",
200
+ "text": "",
201
+ "bbox": [
202
+ 174,
203
+ 103,
204
+ 825,
205
+ 214
206
+ ],
207
+ "page_idx": 2
208
+ },
209
+ {
210
+ "type": "text",
211
+ "text": "In this work, we continue the transition of search-based methods that optimize a set of constraints with learning methods that try to imitate human behavior by the use of large datasets. In practice, these methods require lots of training data to achieve good performance, and fingering labeling is particularly expensive and hard to obtain. One way to automatically gather rich fingering data with full hand pose estimation is by using motion capture (MOCAP) gloves when playing the piano. Zhu et al. (2013) suggests a rule-based and data-based hybrid method, initially estimating fingering decisions using a Directed Acyclic Graph (DAG) based on rule-based comfort constraints which are smoothed using data recorded from limited playing sessions with motion capture gloves. As MOCAP requires special equipment and may affect the comfort of the player, other work, (Takegawa et al., 2006) tried to automatically detect piano fingering from video and MIDI files. The pianist’s fingernails were laid with colorful markers, which were detected by a computer vision program. As some occlusions can occur, they used some rules to correct the detected fingering. In practice, they implemented the system with a camera capturing only 2 octaves (out of 8) and performed a very limited evaluation. The rules they used are simple (such as: restricting one finger per played note, two successive notes cannot be played with the same finger), but far from capturing real-world scenarios. ",
212
+ "bbox": [
213
+ 174,
214
+ 222,
215
+ 825,
216
+ 444
217
+ ],
218
+ "page_idx": 2
219
+ },
220
+ {
221
+ "type": "text",
222
+ "text": "Previous methods for automatically collecting data (Takegawa et al., 2006; Zhu et al., 2013) were costly, as apart of the equipment needed during the piece playing, and the data-collectors had to pay the participating pianists. In our work, we rely solely on videos from YouTube, meaning costs remain minimal with the ability to scale up to new videos. ",
223
+ "bbox": [
224
+ 174,
225
+ 450,
226
+ 823,
227
+ 506
228
+ ],
229
+ "page_idx": 2
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "Recently, Nakamura et al. (2019) released a relatively large dataset of manually labeled PIANOFINGERING by one to six annotators, consisting of 150 pieces, with partially annotated scores (324 notes per piece on average) with a total of 48,726 notes matched with 100,044 tags from multiple annotators. This is the largest annotated PIANO-FINGERING corpus to date and a valuable resource for this field. The authors propose multiple methods for modeling the task of PIANO-FINGERING, including HMMs and neural networks, and report the best performance with an HMM-based model. In this work, we use their dataset as a gold dataset for comparison and adapt their model to compare to our automatically generated dataset. ",
234
+ "bbox": [
235
+ 174,
236
+ 513,
237
+ 825,
238
+ 625
239
+ ],
240
+ "page_idx": 2
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "3 OUR APPROACH: EXTRACTING FINGERING FROM ONLINE VIDEOS ",
245
+ "text_level": 1,
246
+ "bbox": [
247
+ 173,
248
+ 650,
249
+ 759,
250
+ 666
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "There is a genre of online videos in which people upload piano performances where both the piano and the hands are visible. On some channels, people not only include the video but also the MIDI file recorded while playing the piece. We propose to use machine learning techniques to extract fingering information from such videos, enabling the creation of a large dataset of pieces and their fingering information. This requires the orchestration and adaptation of several techniques, which we describe below. ",
257
+ "bbox": [
258
+ 174,
259
+ 684,
260
+ 823,
261
+ 767
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "The final output we produce is demonstrated in Figure 1, where we colored both the fingers and the played notes based on the pose-estimation model (§3.4) and the predicted fingers that played them (§3.5). Note that the ring fingers of both hands as well as the index finger of the left hand and the middle finger of the right hand do not press any note in this particular frame, but may play a note in others. We get the information of played notes from the MIDI events. ",
268
+ "bbox": [
269
+ 174,
270
+ 775,
271
+ 823,
272
+ 845
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "3.1 DATA SOURCE ",
279
+ "text_level": 1,
280
+ "bbox": [
281
+ 174,
282
+ 867,
283
+ 315,
284
+ 882
285
+ ],
286
+ "page_idx": 2
287
+ },
288
+ {
289
+ "type": "text",
290
+ "text": "We extract videos from youtube.com, played by different piano players on a specific channel containing both video and MIDI files. In these videos, the piano is filmed in a horizontal angle directly to the keyboard, from which both the keyboard and hands are displayed (as can be seen in Figure 1). ",
291
+ "bbox": [
292
+ 174,
293
+ 895,
294
+ 823,
295
+ 924
296
+ ],
297
+ "page_idx": 2
298
+ },
299
+ {
300
+ "type": "text",
301
+ "text": "",
302
+ "bbox": [
303
+ 173,
304
+ 103,
305
+ 823,
306
+ 132
307
+ ],
308
+ "page_idx": 3
309
+ },
310
+ {
311
+ "type": "text",
312
+ "text": "MIDI files A standard protocol for the interchange of musical information between musical instruments, synthesizers, and computers Musical Instrument Digital Interface (MIDI) is a standard format for the interchange of musical information between electronic musical instruments. It consists of a sequence of events describing actions to carry out, when, and allows for additional attributes. In the setup of piano recording, it records what note was played in what time for how long and its pressure strength (velocity). We only use videos that come along with a MIDI file, and use it as the source for the played notes and their timestamp. ",
313
+ "bbox": [
314
+ 174,
315
+ 146,
316
+ 825,
317
+ 244
318
+ ],
319
+ "page_idx": 3
320
+ },
321
+ {
322
+ "type": "text",
323
+ "text": "3.2 KEYBOARD AND BOUNDARIES DETECTION ",
324
+ "text_level": 1,
325
+ "bbox": [
326
+ 174,
327
+ 260,
328
+ 514,
329
+ 275
330
+ ],
331
+ "page_idx": 3
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "To allow a correct fingering assignment, we first have to find the keyboard and the bounding boxes of the keys. We detect the keyboard as the largest continuous bright area in the video and identify key boundaries using standard image processing techniques, taking into account the expected number of keys and their predictable location and clear boundaries. For robustness and in order to handle the interfering hands that periodically hide parts of the piano, we combine information from multiple random frames by averaging the predictions from each frame. ",
336
+ "bbox": [
337
+ 174,
338
+ 286,
339
+ 825,
340
+ 369
341
+ ],
342
+ "page_idx": 3
343
+ },
344
+ {
345
+ "type": "text",
346
+ "text": "3.3 HAND DETECTION ",
347
+ "text_level": 1,
348
+ "bbox": [
349
+ 176,
350
+ 386,
351
+ 344,
352
+ 400
353
+ ],
354
+ "page_idx": 3
355
+ },
356
+ {
357
+ "type": "text",
358
+ "text": "A straightforward approach for getting fingers locations in an image is to use a pose estimation model directly on the entire image. In practice, common methods for full-body pose estimation such as OpenPose (Cao et al., 2017) containing hand pose estimation (Simon et al., 2017), make assumptions about the wrist and elbow locations to automatically approximate the hands’ locations. In the case of piano playing, the elbow does not appear in the videos, therefore these systems don’t work. We instead, turn to a pipeline approach where we start by detecting the hands, cropping them, and passing the cropped frames to a pose estimation model that expects the hand to be in the middle of the frame. ",
359
+ "bbox": [
360
+ 174,
361
+ 411,
362
+ 825,
363
+ 523
364
+ ],
365
+ "page_idx": 3
366
+ },
367
+ {
368
+ "type": "text",
369
+ "text": "Object Detection (Viola & Jones, 2001; Redmon et al., 2016; Lin et al., 2017a;b), and specifically Hand Detection (Simon et al., 2017; Kolsch & Turk, 2004; Sridhar et al., 2015) are well studied sub-¨ jects. However, out of the published work providing source code, the code was either complicated to run (e.g. versioning, mobile-only builds, supporting specific GPU, etc.), containing private datasets, or only detecting hands with no distinction between left and right, which is important in our case. ",
370
+ "bbox": [
371
+ 174,
372
+ 530,
373
+ 825,
374
+ 599
375
+ ],
376
+ "page_idx": 3
377
+ },
378
+ {
379
+ "type": "text",
380
+ "text": "We, therefore, created a small dataset with random frames from different videos, corresponding to 476 hands in total evenly split between left and right2. We then fine-tuned a pre-trained object detection model (Inception v2 (Ioffe & Szegedy, 2015), based on Faster R-CNN (Ren et al., 2015), trained on COCO challenge (Lin et al., 2014)) on our new dataset. The fine-tuned model works reasonably well and some hand detection bounding boxes are presented in Figure 1. We release this new dataset and the trained model alongside the rest of the resources developed in this work. ",
381
+ "bbox": [
382
+ 174,
383
+ 607,
384
+ 825,
385
+ 690
386
+ ],
387
+ "page_idx": 3
388
+ },
389
+ {
390
+ "type": "text",
391
+ "text": "Having a working hand-detection model, we perform hand detection on every frame in the video. If more than two hands are detected, we take the 2 highest probability defections as the correct bounding boxes. If two hands are detected with the same label (“left-left” or “right-right”), we discard the model’s label, and instead choose the leftmost bounding box to have the label “left” and the other to have the label “right” - which is the most common position of hands on the piano. ",
392
+ "bbox": [
393
+ 174,
394
+ 698,
395
+ 825,
396
+ 767
397
+ ],
398
+ "page_idx": 3
399
+ },
400
+ {
401
+ "type": "text",
402
+ "text": "3.4 FINGER POSE ESTIMATION ",
403
+ "text_level": 1,
404
+ "bbox": [
405
+ 176,
406
+ 784,
407
+ 401,
408
+ 797
409
+ ],
410
+ "page_idx": 3
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "Having the bounding box of each hand is not enough, as in order to assign fingers to notes we need the hand’s pose. How can we detect fingers that pressed the different keys? We turn to pose estimation models, a well-studied subject in computer vision and use standard models (Wei et al., 2016). ",
415
+ "bbox": [
416
+ 174,
417
+ 810,
418
+ 825,
419
+ 866
420
+ ],
421
+ "page_idx": 3
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "Using off-the-shelve pose estimation model, turned to often fail in our scenario. Some failure example are presented in Figure 2c where the first pose is estimated correctly, but the rest either have wrong finger positions, shorter, or broken fingers. The videos we use contain visual effects (e.g. LED lights are turned on every time a key is pressed), and such the pose-estimation models exhibit two failures: (1) when the LED colors are warm (red, orange, yellow), the model sees the light as an extension to the finger, and as such poorly estimates where the keypoints are for each finger; (2) when the LED colors are cool (green, blue, white), the over-saturation seems to overwhelm the model, and it mistakenly estimates the hand’s pose as much shorter, considering the lit parts of the piano as part of the background. Some examples of these errors are presented in Figure 2c. Furthermore, the videos are usually very dark, high-contrast, and blurry due to motion blur, which standard datasets (Tompson et al., 2014; Yuan et al., 2017; Simon et al., 2017) and models trained on top of them rarely encounter. ",
426
+ "bbox": [
427
+ 178,
428
+ 873,
429
+ 823,
430
+ 901
431
+ ],
432
+ "page_idx": 3
433
+ },
434
+ {
435
+ "type": "image",
436
+ "img_path": "images/24ec1b4bf69fe818fd3bfbb79136b6f7e1cc72b3b43122e37e44a7d4d5629c12.jpg",
437
+ "image_caption": [
438
+ "Figure 2: Output of CycleGAN on 5 images, with 5 different checkpoints. The colors drawn on the hands depict the pose estimation of the hands. "
439
+ ],
440
+ "image_footnote": [],
441
+ "bbox": [
442
+ 173,
443
+ 101,
444
+ 823,
445
+ 387
446
+ ],
447
+ "page_idx": 4
448
+ },
449
+ {
450
+ "type": "text",
451
+ "text": "",
452
+ "bbox": [
453
+ 174,
454
+ 465,
455
+ 825,
456
+ 603
457
+ ],
458
+ "page_idx": 4
459
+ },
460
+ {
461
+ "type": "text",
462
+ "text": "Given the observation that pose-estimation works well on well lid-images, how can we augment the pose estimation model to other lighting situations? This scenario is similar to sim2real works (Sadeghi et al., 2018; Gupta & Booher; Gamrian & Goldberg, 2018) where one wants to transfer a model from simulations to the real-world. These works learn a mapping function $G _ { 1 } : T S$ that transfer instances $x _ { i }$ from the target domain $T$ (the real-world) into the source domain $S$ (the simulation), where the mapping is usually achieved by employing a CycleGan (Zhu et al., 2017). Then, models which are trained on the source domain are used on the transformation of the target domain $G _ { 1 } ( x _ { i } )$ and manage to generalize on the target domain. In our setup, we seek a mapping $G _ { 2 } : S T$ that transforms the source domain (i.e the well-lid videos) into the target data (i.e the challenging lighted scenarios). After obtaining the transformation function $G _ { 2 }$ , we employ the pose estimation model $f$ on the source domain, use the transformation separately, and align the prediction to the new representation. This novel setup benefits from performance boost as we only use the transformation function offline, before training and avoid using it for every prediction. We also benefit of better generalization as we keep good performance on the source domain, and gain major performance on the target domain. ",
463
+ "bbox": [
464
+ 173,
465
+ 611,
466
+ 825,
467
+ 819
468
+ ],
469
+ "page_idx": 4
470
+ },
471
+ {
472
+ "type": "text",
473
+ "text": "We manually detect videos and assign them into their group (well-lit or poorly-lit). Then, we automatically detect and crop hands from random frames, resulting in 21,747 well-lit hands, and 12,832 poorly lit hands. We then trained a CycleGAN for multiple epochs and chose 15 training checkpoints that produced different lighting scenarios (some examples can be seen in Figure 2). We then fine-tune a pose-estimation model on the original, well lit frames, and on the 15 transformed frames. This procedure results in a model that is robust to different lighting scenarios, as we show in Figures 2b and 2d, demonstrating its performance on different lighting scenarios. ",
474
+ "bbox": [
475
+ 174,
476
+ 827,
477
+ 825,
478
+ 924
479
+ ],
480
+ "page_idx": 4
481
+ },
482
+ {
483
+ "type": "text",
484
+ "text": "3.5 PRESSED FINGER ESTIMATION ",
485
+ "text_level": 1,
486
+ "bbox": [
487
+ 176,
488
+ 103,
489
+ 428,
490
+ 118
491
+ ],
492
+ "page_idx": 5
493
+ },
494
+ {
495
+ "type": "text",
496
+ "text": "Given that we know which notes were pressed in any given frame (see $\\ S 3 . 6$ below), there is still uncertainty as to which finger pressed them. This uncertainty either comes from imperfect pose estimation, or multiple fingers located on top of a single note. We model the finger press estimation by calculating the probability of a specific finger to have been used, given the hand’s pose and the pressed note: ",
497
+ "bbox": [
498
+ 173,
499
+ 128,
500
+ 825,
501
+ 199
502
+ ],
503
+ "page_idx": 5
504
+ },
505
+ {
506
+ "type": "equation",
507
+ "img_path": "images/2e66b1de9bbe973ecb24518974ced5c3e77a3c21cce4de05f843d1d6885268ab.jpg",
508
+ "text": "$$\na r g m a x _ { i , j } P ( f _ { i } , h _ { j } | n _ { k } )\n$$",
509
+ "text_format": "latex",
510
+ "bbox": [
511
+ 418,
512
+ 198,
513
+ 580,
514
+ 215
515
+ ],
516
+ "page_idx": 5
517
+ },
518
+ {
519
+ "type": "text",
520
+ "text": "where $i \\in [ 1 , 5 ]$ for the 5 fingers, $h _ { j } \\in \\{ h _ { l } , h _ { r } \\}$ stands for the hand being used (left or right) and $n _ { k } \\in [ 1 , 8 8 ]$ corresponding to the played key. ",
521
+ "bbox": [
522
+ 174,
523
+ 224,
524
+ 823,
525
+ 255
526
+ ],
527
+ "page_idx": 5
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "We chose to estimate the pressed fingers as a Gaussian distribution ${ \\mathcal { N } } ( \\mu , \\sigma ^ { 2 } )$ , where $\\mu$ and $\\sigma$ are defined as follows: ",
532
+ "bbox": [
533
+ 176,
534
+ 260,
535
+ 823,
536
+ 289
537
+ ],
538
+ "page_idx": 5
539
+ },
540
+ {
541
+ "type": "equation",
542
+ "img_path": "images/46de46c92ba8064a613ced1ac73337d9624fbaad3f98e7b274c85cb89dccecbc.jpg",
543
+ "text": "$$\n\\sigma ( n _ { k } ) = X _ { n _ { k + 1 } } - X _ { n _ { k } } , \\quad \\mu ( n _ { k } ) = X _ { n _ { k } } + 0 . 5 * \\sigma\n$$",
544
+ "text_format": "latex",
545
+ "bbox": [
546
+ 328,
547
+ 287,
548
+ 668,
549
+ 306
550
+ ],
551
+ "page_idx": 5
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "$\\mu$ is the center of the key on the $x$ axis and $\\sigma$ is its width. The score of each finger given a note in a specific frame is defined as: ",
556
+ "bbox": [
557
+ 169,
558
+ 308,
559
+ 826,
560
+ 337
561
+ ],
562
+ "page_idx": 5
563
+ },
564
+ {
565
+ "type": "equation",
566
+ "img_path": "images/e1a7edbd8530cbd1304080119ec7b77ffaf2cc633352b29daba9e2720b45dc6c.jpg",
567
+ "text": "$$\ng ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) = f ( X _ { f _ { i } , h _ { j } | f r a m e } | \\mu ( n _ { k } ) , \\sigma ( n _ { k } ) ^ { 2 } )\n$$",
568
+ "text_format": "latex",
569
+ "bbox": [
570
+ 313,
571
+ 343,
572
+ 684,
573
+ 363
574
+ ],
575
+ "page_idx": 5
576
+ },
577
+ {
578
+ "type": "text",
579
+ "text": "The probability of a given finger to have played a note given a note and a frame: (normalizing $g$ for all fingers) ",
580
+ "bbox": [
581
+ 173,
582
+ 375,
583
+ 825,
584
+ 402
585
+ ],
586
+ "page_idx": 5
587
+ },
588
+ {
589
+ "type": "equation",
590
+ "img_path": "images/6703397412cab2b4aec57048fe635a437306f23a399582ca218e5fd0163d9ebf.jpg",
591
+ "text": "$$\np ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) = { \\frac { g ( f _ { i } , h _ { j } | n _ { k } , f r a m e ) } { \\sum _ { n = 1 } ^ { 5 } \\sum _ { m \\in \\{ l , r \\} } g ( f _ { n } , h _ { m } | n _ { k } , f r a m e ) } }\n$$",
592
+ "text_format": "latex",
593
+ "bbox": [
594
+ 295,
595
+ 401,
596
+ 702,
597
+ 438
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "As most keyboard presses last more than one frame, we make use of multiple frames to overcome some of the errors from previous steps and to estimate a more accurate prediction. For this reason, we aggregate the frames that were used during a key press. We treat the first frame as the main signal point, and assign each successive frame an exponentially declining weight ",
604
+ "bbox": [
605
+ 174,
606
+ 446,
607
+ 825,
608
+ 503
609
+ ],
610
+ "page_idx": 5
611
+ },
612
+ {
613
+ "type": "equation",
614
+ "img_path": "images/f4af795dbfd0bd97205cb91e1b789bd62ecbc323e6b1c38a3afa3dc8ac4170a6.jpg",
615
+ "text": "$$\n\\begin{array} { r } { p ( f _ { i } , h _ { j } | n _ { k } , f r a m e _ { k _ { 1 } } , . . . f r a m e _ { k _ { n } } ) = \\frac { \\sum _ { l = 1 } ^ { n } 0 . 5 ^ { l } * p ( f _ { i } , h _ { j } | n _ { k } , f r a m e _ { k _ { l } } ) } { \\sum _ { l = 1 } ^ { n } 0 . 5 ^ { l } } } \\end{array}\n$$",
616
+ "text_format": "latex",
617
+ "bbox": [
618
+ 254,
619
+ 510,
620
+ 741,
621
+ 546
622
+ ],
623
+ "page_idx": 5
624
+ },
625
+ {
626
+ "type": "text",
627
+ "text": "As finger changes can occur in later frames. Finally, we normalize the weighted sum of probabilities to achieve a probability distribution for all frames. ",
628
+ "bbox": [
629
+ 173,
630
+ 559,
631
+ 549,
632
+ 602
633
+ ],
634
+ "page_idx": 5
635
+ },
636
+ {
637
+ "type": "text",
638
+ "text": "In our dataset, we release all probabilities for each played note, along with the maximum likelihood finger estimation. We define the “confidence” score of the extraction from a single piece, as the product of the highest probability for a finger for each note. Figure 3 shows the precision and recall of the predictions based on a cutoff for the highest probability of the note. We see a positive correlation between confidence threshold and precision, and a negative correlation between confidence and recall, meaning we can get relatively high precision for a small number of notes, or relatively low precision for a high number of notes. ",
639
+ "bbox": [
640
+ 174,
641
+ 608,
642
+ 549,
643
+ 775
644
+ ],
645
+ "page_idx": 5
646
+ },
647
+ {
648
+ "type": "image",
649
+ "img_path": "images/79b5678a872fcf1b743705dceb80d6ecb0e3836b0a057e1717d2856b207ec818.jpg",
650
+ "image_caption": [
651
+ "Figure 3: Precision and recall based on confidence for all 6,894 manually tagged notes "
652
+ ],
653
+ "image_footnote": [],
654
+ "bbox": [
655
+ 568,
656
+ 560,
657
+ 818,
658
+ 705
659
+ ],
660
+ "page_idx": 5
661
+ },
662
+ {
663
+ "type": "text",
664
+ "text": "3.6 VIDEO AND MIDI ALIGNMENT",
665
+ "text_level": 1,
666
+ "bbox": [
667
+ 176,
668
+ 792,
669
+ 431,
670
+ 808
671
+ ],
672
+ "page_idx": 5
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "We consider the MIDI and video files to be complementary, as they were recorded simultaneously. The MIDI files are the source to which keys were pressed, in what time, and for how long. The videos are the source for the piano, hands, and fingers locations. These two sources are not synchronized, but as they depict the same piano performance, a perfect alignment exist (up to the video frequency resolution). ",
677
+ "bbox": [
678
+ 174,
679
+ 818,
680
+ 825,
681
+ 888
682
+ ],
683
+ "page_idx": 5
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "We extract the audio track from the video, and treat the first audio peak as the beginning of the piece, clipping the prior part of the video and aligning it with the first event from the MIDI file. In practice, we determine this starting point as the first point in the signal where the signal amplitude is higher than a fifth of the mean absolute value of the entire signal. ",
688
+ "bbox": [
689
+ 174,
690
+ 895,
691
+ 823,
692
+ 924
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "",
699
+ "bbox": [
700
+ 171,
701
+ 103,
702
+ 823,
703
+ 132
704
+ ],
705
+ "page_idx": 6
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "This heuristic achieves a reasonable alignment, but we observe some alignment mismatch of 80- $2 0 0 \\mathrm { m s }$ . We tackle the misalignment by using a signal from the final system confidence (Section 3.5), where every piece gets a final score estimation after running the whole process, depicting the system confidence on the predicted notes. We look for an alignment that maximizes the system confidence over the entire piece: ",
710
+ "bbox": [
711
+ 174,
712
+ 138,
713
+ 825,
714
+ 208
715
+ ],
716
+ "page_idx": 6
717
+ },
718
+ {
719
+ "type": "equation",
720
+ "img_path": "images/8ed9fedb3e9feadf64f127f60182c54c06f1485c1d6bc8185766dc44534d6135.jpg",
721
+ "text": "$$\na l i g n m e n t ( M I D I , V i d e o ) = a r g m a x _ { i } s c o r e ( M I D I _ { t _ { 0 } } , V i d e o _ { t _ { i } } )\n$$",
722
+ "text_format": "latex",
723
+ "bbox": [
724
+ 276,
725
+ 217,
726
+ 722,
727
+ 233
728
+ ],
729
+ "page_idx": 6
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "where $M I D I _ { t _ { 0 } }$ is the starting time of the MIDI file, and $V i d e o _ { t _ { j } }$ is the alignment time of the video. $V i d e o _ { t _ { 0 } }$ is obtained by the heuristic alignment described in the previous paragraph. We use the confidence score as a proxy of the alignment precision and search the alignment that maximizes the confidence score of the system. More specifically, given the initial offset from the audio-MIDI alignment, we take a window of 1 second in frames (usually 25) for each side and compute the score of the final system on the entire piece. We choose the offset that results in the best confidence score as the alignment offset. ",
734
+ "bbox": [
735
+ 174,
736
+ 241,
737
+ 825,
738
+ 338
739
+ ],
740
+ "page_idx": 6
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "3.7 THE RESULTING DATASET: APFD ",
745
+ "text_level": 1,
746
+ "bbox": [
747
+ 176,
748
+ 356,
749
+ 450,
750
+ 371
751
+ ],
752
+ "page_idx": 6
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "We follow the methods described in this section, and use it to label 90 piano pieces from 42 different composers with 155,107 notes in total. On average, each piece contains 1,723 notes. ",
757
+ "bbox": [
758
+ 174,
759
+ 382,
760
+ 823,
761
+ 410
762
+ ],
763
+ "page_idx": 6
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "4 RESULTS ",
768
+ "text_level": 1,
769
+ "bbox": [
770
+ 176,
771
+ 431,
772
+ 281,
773
+ 448
774
+ ],
775
+ "page_idx": 6
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "In this section, we present multiple evaluations of our overall system. We begin by evaluating the entire process where we assess how the overall system performs on predicting the pressed fingering. Next, we use the dataset we collected and train a PIANO-FINGERING model. We fine-tune this model on a previously manually-annotated dataset for PIANO-FINGERING and show using our data achieves better performance. ",
780
+ "bbox": [
781
+ 174,
782
+ 463,
783
+ 825,
784
+ 534
785
+ ],
786
+ "page_idx": 6
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "As piano pieces are usually played by two hands, we avoid modeling each hand separately, and instead use their symmetry property, and simply flip one hand’s notes, matching it to the piano scale, following previous work practice (Nakamura et al., 2019). ",
791
+ "bbox": [
792
+ 176,
793
+ 540,
794
+ 823,
795
+ 583
796
+ ],
797
+ "page_idx": 6
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "For evaluation, we use the match rate between the prediction and the ground truth. For cases where there is a single ground truth, this is equivalent to accuracy measurement. When more than one labeling is available, we simply average the accuracies with each labeling.3 ",
802
+ "bbox": [
803
+ 176,
804
+ 589,
805
+ 823,
806
+ 632
807
+ ],
808
+ "page_idx": 6
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "4.1 FINGER PRESS ESTIMATION EVALUATION ",
813
+ "text_level": 1,
814
+ "bbox": [
815
+ 174,
816
+ 648,
817
+ 504,
818
+ 662
819
+ ],
820
+ "page_idx": 6
821
+ },
822
+ {
823
+ "type": "text",
824
+ "text": "As the pose estimation is one of the major components directly affecting our system’s performance, we isolate this part in order to estimate the gain from fine-tuning using the CycleGAN (Section 3.4). ",
825
+ "bbox": [
826
+ 173,
827
+ 676,
828
+ 821,
829
+ 704
830
+ ],
831
+ "page_idx": 6
832
+ },
833
+ {
834
+ "type": "text",
835
+ "text": "We manually annotated five random pieces from our dataset by marking the pressing finger for each played note in the video. Then, by using our system (§3.5), we estimate what finger was used for each key. We use the confidence score produced by the model as a threshold to use or discard the key prediction of the model, and report precision, recall and F1 scores of multiple thresholds. Moreover, we compare the scores of these pieces with and without using the CycleGAN. We do so for the five annotated pieces and report these results in Table 1. When considering a high confidence score $( > 9 0 \\% )$ both the pre-trained and fine-tuned models correctly mark all considered notes (which consist of between $34 \\div 3 6 \\%$ of the data). However, when considering decreasing confidences, the fine-tuned model manages to achieve higher precision and higher recall, contributing to an overall higher f1 score. With no confidence threshold (i.e using all fingering predictions), the pre-trained model achieves $93 \\%$ F1, while the fine-tuned one achieves $9 7 \\%$ F1, a $57 \\%$ error reduction. ",
836
+ "bbox": [
837
+ 174,
838
+ 710,
839
+ 825,
840
+ 863
841
+ ],
842
+ "page_idx": 6
843
+ },
844
+ {
845
+ "type": "text",
846
+ "text": "4.2 AUTOMATIC PIANO FINGERING PREDICTION ",
847
+ "bbox": [
848
+ 174,
849
+ 882,
850
+ 526,
851
+ 896
852
+ ],
853
+ "page_idx": 6
854
+ },
855
+ {
856
+ "type": "table",
857
+ "img_path": "images/84977d7180fda7dbc34cf573062fc19a543c275e898bce4380cf6cf20f642b1f.jpg",
858
+ "table_caption": [],
859
+ "table_footnote": [],
860
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Confidence</td><td rowspan=1 colspan=3>c&gt;0.9</td><td rowspan=1 colspan=3>c&gt;0.75</td><td rowspan=1 colspan=3>c&gt;0.5</td><td rowspan=1 colspan=3>c&gt;0</td></tr><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td><td rowspan=1 colspan=1>P</td><td rowspan=1 colspan=1>r</td><td rowspan=1 colspan=1>f1</td></tr><tr><td rowspan=1 colspan=1>Pretrained</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.34</td><td rowspan=1 colspan=1>0.51</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.49</td><td rowspan=1 colspan=1>0.65</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>0.78</td><td rowspan=1 colspan=1>0.86</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.93</td></tr><tr><td rowspan=1 colspan=1>FT Single Frame</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.36</td><td rowspan=1 colspan=1>0.53</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.52</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>0.97</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.95</td></tr><tr><td rowspan=1 colspan=1>FT Multiple Frames</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.52</td><td rowspan=1 colspan=1>0.99</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.67</td><td rowspan=1 colspan=1>0.98</td><td rowspan=1 colspan=1>0.8</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.94</td><td rowspan=1 colspan=1>1.0</td><td rowspan=1 colspan=1>0.97</td></tr></table>",
861
+ "bbox": [
862
+ 173,
863
+ 101,
864
+ 820,
865
+ 169
866
+ ],
867
+ "page_idx": 7
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "Table 1: Precision, Recall, F1 scores for 6,894 notes we manually tagged across 5 different pieces, at different confidence points. The first row depict the performance of the system with the vanilla pose estimation. The second and the third rows present the results on the fine-tuned (FT) pose estimation model 3.4 on a single and multiple frames accordingly. ",
872
+ "bbox": [
873
+ 173,
874
+ 179,
875
+ 825,
876
+ 236
877
+ ],
878
+ "page_idx": 7
879
+ },
880
+ {
881
+ "type": "text",
882
+ "text": "In order to assess the value of APFD, we seek to show its usefulness on the end task: Automatic Piano Fingering. To this end, we train a standard sequence tagging neural model using our dataset, evaluating on the subset of the videos we manually annotated. Then, we fine-tune this model on PIG (Nakamura et al., 2019), a manually labeled dataset, on which we achieve superior results than simply training on that dataset alone. ",
883
+ "bbox": [
884
+ 174,
885
+ 267,
886
+ 549,
887
+ 378
888
+ ],
889
+ "page_idx": 7
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "We model the PIANO-FINGERING as a sequence labeling task, where given a sequence of notes $n _ { 1 } , n _ { 2 } , . . . , n _ { n }$ we need to predict a sequence of fingering: $y _ { 1 } , y _ { 2 } , . . . , y _ { n }$ ",
894
+ "bbox": [
895
+ 174,
896
+ 386,
897
+ 549,
898
+ 428
899
+ ],
900
+ "page_idx": 7
901
+ },
902
+ {
903
+ "type": "table",
904
+ "img_path": "images/ab999535c31b07ecd5ec3bd4a6dedd7940c652f04b87ebb6515c752c64d9dc23.jpg",
905
+ "table_caption": [],
906
+ "table_footnote": [],
907
+ "table_body": "<table><tr><td>Training/Dataset</td><td>APFD</td><td>PIG</td></tr><tr><td>Previous Neural Previous SOTA</td><td></td><td rowspan=\"3\">61.3 64.5 71.4</td></tr><tr><td>Human Agreement</td><td>一</td></tr><tr><td>PIG</td><td>49.9</td></tr><tr><td>+ Fine-tune APFD</td><td>73.6</td><td>64.1 54.4</td></tr><tr><td>APFD</td><td>73.2</td><td>55.2</td></tr><tr><td>+ Fine-tune PIG</td><td>62.9</td><td>66.8</td></tr></table>",
908
+ "bbox": [
909
+ 560,
910
+ 267,
911
+ 821,
912
+ 387
913
+ ],
914
+ "page_idx": 7
915
+ },
916
+ {
917
+ "type": "text",
918
+ "text": "Table 2: Results of training and fine tuning on different dataset. ",
919
+ "bbox": [
920
+ 562,
921
+ 397,
922
+ 823,
923
+ 425
924
+ ],
925
+ "page_idx": 7
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "where $y _ { i } \\in \\mathsf { \\bar { \\{ 1 , 2 , 3 , 4 , 5 \\} } }$ corresponding to 5 fingers of one hand. We employ a standard sequence tagging technique, by embedding each note and using a BiLSTM on top of it. On every contextualized note we then use a Multi-Layer-Perceptron (MLP) to predict the label. The model is trained to minimize cross-entropy loss. This is the same model used in (Nakamura et al., 2019), referred to as DNN (LSTM). ",
930
+ "bbox": [
931
+ 174,
932
+ 428,
933
+ 825,
934
+ 496
935
+ ],
936
+ "page_idx": 7
937
+ },
938
+ {
939
+ "type": "text",
940
+ "text": "4.2.1 PIANO FINGERING MODEL ",
941
+ "text_level": 1,
942
+ "bbox": [
943
+ 176,
944
+ 517,
945
+ 413,
946
+ 531
947
+ ],
948
+ "page_idx": 7
949
+ },
950
+ {
951
+ "type": "text",
952
+ "text": "Nakamura et al. (2019) didn’t use a development set, therefore in this work, we leave 1 piece from the training set and make it a development set. Our dataset—APFD—is composed of 90 pieces, which we split into 75/10 for training and development sets respectively, and use the 5 manually annotated pieces as a test set. We note that the development set is silver data (automatically annotated) and probably contains mistakes. The results are summarized in Table 1. We run the same architecture by (Nakamura et al., 2019) with some different hyperparameters and achieve $7 1 . 4 \\% / 6 4 . 1 \\%$ on our and PIG’s test set respectively. To evaluate the usefulness of our data to PIG’s data, we use the model trained on our silver data and fine-tune it on PIG. This results in $6 6 . 8 \\%$ accuracy, $2 . 3 \\%$ above the previous state-of-the-art model which was achieved by an HMM (Nakamura et al., 2019). We attribute this gain in performance to our dataset, which both increases the number of training examples and allows to train bigger neural models which excel with more training examples. We also experiment in the opposite direction and fine-tune the model trained on PIG with our data, which result in $7 3 . 6 \\%$ accuracy, which is better than training on our data alone, achieving $7 3 . 2 \\%$ accuracy. ",
953
+ "bbox": [
954
+ 173,
955
+ 544,
956
+ 825,
957
+ 738
958
+ ],
959
+ "page_idx": 7
960
+ },
961
+ {
962
+ "type": "text",
963
+ "text": "5 DISCUSSION AND FUTURE WORK ",
964
+ "text_level": 1,
965
+ "bbox": [
966
+ 176,
967
+ 763,
968
+ 485,
969
+ 780
970
+ ],
971
+ "page_idx": 7
972
+ },
973
+ {
974
+ "type": "text",
975
+ "text": "In this work, we present an automatic method for detecting PIANO-FINGERING from MIDI and video files of a piano performance. We employ this method on a large set of videos, and create the first large scale PIANO-FINGERING dataset, containing 90 unique pieces, with 155,107 notes in total. We show this dataset—although being noisy–is valuable, by training a neural network model on it, fine-tuning on a gold dataset, where we achieve state-of-the-art results. In future work, we intend to improve the data collection by improving the pose-estimation model, better handling high speed movements and the proximity of the hands, which often cause errors in estimating their pose. Furthermore, we intend to design improved neural models that can take previous fingering predictions into account, in order to have a better global fingering transition. ",
976
+ "bbox": [
977
+ 173,
978
+ 799,
979
+ 825,
980
+ 924
981
+ ],
982
+ "page_idx": 7
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "REFERENCES ",
987
+ "text_level": 1,
988
+ "bbox": [
989
+ 176,
990
+ 103,
991
+ 287,
992
+ 117
993
+ ],
994
+ "page_idx": 8
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Matteo Balliauw, Dorien Herremans, Daniel Palhazi Cuervo, and Kenneth Sorensen. Generating ¨ fingerings for polyphonic piano music with a tabu search algorithm. In International Conference on Mathematics and Computation in Music, pp. 149–160. Springer, 2015. ",
999
+ "bbox": [
1000
+ 174,
1001
+ 126,
1002
+ 825,
1003
+ 169
1004
+ ],
1005
+ "page_idx": 8
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "Matteo Balliauw, Dorien Herremans, Daniel Palhazi Cuervo, and Kenneth Sorensen. A variable ¨ neighborhood search algorithm to generate piano fingerings for polyphonic sheet music. International Transactions in Operational Research, 24(3):509–535, 2017. ",
1010
+ "bbox": [
1011
+ 176,
1012
+ 176,
1013
+ 821,
1014
+ 219
1015
+ ],
1016
+ "page_idx": 8
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "Zhe Cao, Tomas Simon, Shih-En Wei, and Yaser Sheikh. Realtime multi-person 2d pose estimation using part affinity fields. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7291–7299, 2017. ",
1021
+ "bbox": [
1022
+ 176,
1023
+ 227,
1024
+ 823,
1025
+ 270
1026
+ ],
1027
+ "page_idx": 8
1028
+ },
1029
+ {
1030
+ "type": "text",
1031
+ "text": "Shani Gamrian and Yoav Goldberg. Transfer learning for related reinforcement learning tasks via image-to-image translation. arXiv preprint arXiv:1806.07377, 2018. ",
1032
+ "bbox": [
1033
+ 171,
1034
+ 279,
1035
+ 823,
1036
+ 308
1037
+ ],
1038
+ "page_idx": 8
1039
+ },
1040
+ {
1041
+ "type": "text",
1042
+ "text": "Fred Glover and Manuel Laguna. Tabu search. In Handbook of combinatorial optimization, pp. 2093–2229. Springer, 1998. ",
1043
+ "bbox": [
1044
+ 173,
1045
+ 315,
1046
+ 823,
1047
+ 344
1048
+ ],
1049
+ "page_idx": 8
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "Anchit Gupta and Jonathan Booher. Cyclegan for sim2real domain adaptation. ",
1054
+ "bbox": [
1055
+ 173,
1056
+ 353,
1057
+ 692,
1058
+ 369
1059
+ ],
1060
+ "page_idx": 8
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "Melanie Hart, Robert Bosch, and Elbert Tsai. Finding optimal piano fingerings. The UMAP Journal, 21(2):167–177, 2000. ",
1065
+ "bbox": [
1066
+ 173,
1067
+ 377,
1068
+ 823,
1069
+ 406
1070
+ ],
1071
+ "page_idx": 8
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015. ",
1076
+ "bbox": [
1077
+ 173,
1078
+ 415,
1079
+ 823,
1080
+ 444
1081
+ ],
1082
+ "page_idx": 8
1083
+ },
1084
+ {
1085
+ "type": "text",
1086
+ "text": "J Pieter Jacobs. Refinements to the ergonomic model for keyboard fingering of parncutt, sloboda, clarke, raekallio, and desain. Music Perception: An Interdisciplinary Journal, 18(4):505–511, 2001. ",
1087
+ "bbox": [
1088
+ 176,
1089
+ 452,
1090
+ 823,
1091
+ 494
1092
+ ],
1093
+ "page_idx": 8
1094
+ },
1095
+ {
1096
+ "type": "text",
1097
+ "text": "Alia Al Kasimi, Eric Nichols, and Christopher Raphael. A simple algorithm for automatic generation of polyphonic piano fingerings. In ISMIR, 2007. ",
1098
+ "bbox": [
1099
+ 169,
1100
+ 503,
1101
+ 825,
1102
+ 532
1103
+ ],
1104
+ "page_idx": 8
1105
+ },
1106
+ {
1107
+ "type": "text",
1108
+ "text": "Mathias Kolsch and Matthew Turk. Robust hand detection. In ¨ FGR, pp. 614–619, 2004. ",
1109
+ "bbox": [
1110
+ 171,
1111
+ 540,
1112
+ 754,
1113
+ 556
1114
+ ],
1115
+ "page_idx": 8
1116
+ },
1117
+ {
1118
+ "type": "text",
1119
+ "text": "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 ´ European conference on computer vision, pp. 740–755. Springer, 2014. ",
1120
+ "bbox": [
1121
+ 176,
1122
+ 564,
1123
+ 823,
1124
+ 608
1125
+ ],
1126
+ "page_idx": 8
1127
+ },
1128
+ {
1129
+ "type": "text",
1130
+ "text": "Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie.´ Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2117–2125, 2017a. ",
1131
+ "bbox": [
1132
+ 174,
1133
+ 614,
1134
+ 823,
1135
+ 659
1136
+ ],
1137
+ "page_idx": 8
1138
+ },
1139
+ {
1140
+ "type": "text",
1141
+ "text": "Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense ´ object detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017b. ",
1142
+ "bbox": [
1143
+ 171,
1144
+ 666,
1145
+ 825,
1146
+ 709
1147
+ ],
1148
+ "page_idx": 8
1149
+ },
1150
+ {
1151
+ "type": "text",
1152
+ "text": "Nenad Mladenovic and Pierre Hansen. Variable neighborhood search. ´ Computers & operations research, 24(11):1097–1100, 1997. ",
1153
+ "bbox": [
1154
+ 169,
1155
+ 718,
1156
+ 823,
1157
+ 747
1158
+ ],
1159
+ "page_idx": 8
1160
+ },
1161
+ {
1162
+ "type": "text",
1163
+ "text": "Eita Nakamura, Nobutaka Ono, and Shigeki Sagayama. Merged-output hmm for piano fingering of both hands. In ISMIR, pp. 531–536, 2014. ",
1164
+ "bbox": [
1165
+ 171,
1166
+ 755,
1167
+ 825,
1168
+ 785
1169
+ ],
1170
+ "page_idx": 8
1171
+ },
1172
+ {
1173
+ "type": "text",
1174
+ "text": "Eita Nakamura, Yasuyuki Saito, and Kazuyoshi Yoshii. Statistical learning and estimation of piano fingering. arXiv preprint arXiv:1904.10237, 2019. ",
1175
+ "bbox": [
1176
+ 169,
1177
+ 792,
1178
+ 825,
1179
+ 821
1180
+ ],
1181
+ "page_idx": 8
1182
+ },
1183
+ {
1184
+ "type": "text",
1185
+ "text": "Richard Parncutt, John A Sloboda, Eric F Clarke, Matti Raekallio, and Peter Desain. An ergonomic model of keyboard fingering for melodic fragments. Music Perception: An Interdisciplinary Journal, 14(4):341–382, 1997. ",
1186
+ "bbox": [
1187
+ 174,
1188
+ 829,
1189
+ 823,
1190
+ 872
1191
+ ],
1192
+ "page_idx": 8
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 779–788, 2016. ",
1197
+ "bbox": [
1198
+ 174,
1199
+ 881,
1200
+ 825,
1201
+ 924
1202
+ ],
1203
+ "page_idx": 8
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "text": "Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In Advances in neural information processing systems, pp. 91–99, 2015. ",
1208
+ "bbox": [
1209
+ 173,
1210
+ 103,
1211
+ 823,
1212
+ 145
1213
+ ],
1214
+ "page_idx": 9
1215
+ },
1216
+ {
1217
+ "type": "text",
1218
+ "text": "Fereshteh Sadeghi, Alexander Toshev, Eric Jang, and Sergey Levine. Sim2real viewpoint invariant visual servoing by recurrent control. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4691–4699, 2018. ",
1219
+ "bbox": [
1220
+ 173,
1221
+ 155,
1222
+ 821,
1223
+ 198
1224
+ ],
1225
+ "page_idx": 9
1226
+ },
1227
+ {
1228
+ "type": "text",
1229
+ "text": "Tomas Simon, Hanbyul Joo, Iain Matthews, and Yaser Sheikh. Hand keypoint detection in single images using multiview bootstrapping. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 1145–1153, 2017. ",
1230
+ "bbox": [
1231
+ 174,
1232
+ 207,
1233
+ 825,
1234
+ 250
1235
+ ],
1236
+ "page_idx": 9
1237
+ },
1238
+ {
1239
+ "type": "text",
1240
+ "text": "Srinath Sridhar, Franziska Mueller, Antti Oulasvirta, and Christian Theobalt. Fast and robust hand tracking using detection-guided optimization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3213–3221, 2015. ",
1241
+ "bbox": [
1242
+ 174,
1243
+ 258,
1244
+ 825,
1245
+ 301
1246
+ ],
1247
+ "page_idx": 9
1248
+ },
1249
+ {
1250
+ "type": "text",
1251
+ "text": "Yoshinari Takegawa, Tsutomu Terada, and Shojiro Nishio. Design and implementation of a real-time fingering detection system for piano performance. In ICMC, 2006. ",
1252
+ "bbox": [
1253
+ 174,
1254
+ 310,
1255
+ 823,
1256
+ 339
1257
+ ],
1258
+ "page_idx": 9
1259
+ },
1260
+ {
1261
+ "type": "text",
1262
+ "text": "Jonathan Tompson, Murphy Stein, Yann Lecun, and Ken Perlin. Real-time continuous pose recovery of human hands using convolutional networks. ACM Transactions on Graphics, 33, August 2014. ",
1263
+ "bbox": [
1264
+ 173,
1265
+ 348,
1266
+ 823,
1267
+ 377
1268
+ ],
1269
+ "page_idx": 9
1270
+ },
1271
+ {
1272
+ "type": "text",
1273
+ "text": "Paul Viola and Michael Jones. Rapid object detection using a boosted cascade of simple features. CVPR (1), 1(511-518):3, 2001. ",
1274
+ "bbox": [
1275
+ 173,
1276
+ 386,
1277
+ 823,
1278
+ 415
1279
+ ],
1280
+ "page_idx": 9
1281
+ },
1282
+ {
1283
+ "type": "text",
1284
+ "text": "Shih-En Wei, Varun Ramakrishna, Takeo Kanade, and Yaser Sheikh. Convolutional pose machines. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4724– 4732, 2016. ",
1285
+ "bbox": [
1286
+ 173,
1287
+ 424,
1288
+ 825,
1289
+ 467
1290
+ ],
1291
+ "page_idx": 9
1292
+ },
1293
+ {
1294
+ "type": "text",
1295
+ "text": "Yuichiro Yonebayashi, Hirokazu Kameoka, and Shigeki Sagayama. Automatic decision of piano fingering based on a hidden markov models. In IJCAI, pp. 2915–2921, 2007. ",
1296
+ "bbox": [
1297
+ 171,
1298
+ 476,
1299
+ 821,
1300
+ 506
1301
+ ],
1302
+ "page_idx": 9
1303
+ },
1304
+ {
1305
+ "type": "text",
1306
+ "text": "Shanxin Yuan, Qi Ye, Bjorn Stenger, Siddhant Jain, and Tae-Kyun Kim. Bighand2. 2m benchmark: Hand pose dataset and state of the art analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4866–4874, 2017. ",
1307
+ "bbox": [
1308
+ 176,
1309
+ 513,
1310
+ 823,
1311
+ 558
1312
+ ],
1313
+ "page_idx": 9
1314
+ },
1315
+ {
1316
+ "type": "text",
1317
+ "text": "Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017. ",
1318
+ "bbox": [
1319
+ 173,
1320
+ 565,
1321
+ 821,
1322
+ 608
1323
+ ],
1324
+ "page_idx": 9
1325
+ },
1326
+ {
1327
+ "type": "text",
1328
+ "text": "Yuanfeng Zhu, Ajay Sundar Ramakrishnan, Bernd Hamann, and Michael Neff. A system for automatic animation of piano performances. Computer Animation and Virtual Worlds, 24(5):445–457, 2013. ",
1329
+ "bbox": [
1330
+ 176,
1331
+ 617,
1332
+ 825,
1333
+ 660
1334
+ ],
1335
+ "page_idx": 9
1336
+ },
1337
+ {
1338
+ "type": "text",
1339
+ "text": "Appendices ",
1340
+ "text_level": 1,
1341
+ "bbox": [
1342
+ 176,
1343
+ 700,
1344
+ 343,
1345
+ 729
1346
+ ],
1347
+ "page_idx": 9
1348
+ },
1349
+ {
1350
+ "type": "text",
1351
+ "text": "A DATASET SAMPLES ",
1352
+ "bbox": [
1353
+ 176,
1354
+ 751,
1355
+ 370,
1356
+ 768
1357
+ ],
1358
+ "page_idx": 9
1359
+ },
1360
+ {
1361
+ "type": "text",
1362
+ "text": "For every video our system extracts PIANO-FINGERING from it also outputs the video overlayed by the estimation of the piano keys, an indication of which notes are played, and what fingers are being used to play them (the key’s color), up to two bounding boxes, for both hands (where light blue means left hand, and light green means right hand), and the pose estimation for each hand. ",
1363
+ "bbox": [
1364
+ 174,
1365
+ 784,
1366
+ 825,
1367
+ 839
1368
+ ],
1369
+ "page_idx": 9
1370
+ },
1371
+ {
1372
+ "type": "text",
1373
+ "text": "We include the output videos for all of the pieces we manually annotated to visually demonstrate our system and its accuracy on different playing cases. The videos were uploaded to a new, anonymous YouTube channel, and each contain a link to the original video in the description. ",
1374
+ "bbox": [
1375
+ 176,
1376
+ 847,
1377
+ 825,
1378
+ 888
1379
+ ],
1380
+ "page_idx": 9
1381
+ },
1382
+ {
1383
+ "type": "text",
1384
+ "text": "River Flows in You: https://youtu.be/Gfs1UWQhr5Q Faded: https://youtu.be/LU2ibOW6z7U ",
1385
+ "bbox": [
1386
+ 174,
1387
+ 896,
1388
+ 584,
1389
+ 922
1390
+ ],
1391
+ "page_idx": 9
1392
+ },
1393
+ {
1394
+ "type": "text",
1395
+ "text": "Moonlight Sonata 1st Movement: https://youtu.be/wp8j239fs9o Rondo Alla Turca: https://youtu.be/KqTaPfoIuuE Nocturne in E Flat Major (Op. 9 No. 2): https://youtu.be/xXHUUzTa5vU ",
1396
+ "bbox": [
1397
+ 174,
1398
+ 103,
1399
+ 718,
1400
+ 146
1401
+ ],
1402
+ "page_idx": 10
1403
+ }
1404
+ ]
parse/train/H1MOqeHYvB/H1MOqeHYvB_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1MOqeHYvB/H1MOqeHYvB_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1zxjsCqKQ/H1zxjsCqKQ.md ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GRADIENT-BASED LEARNING FOR THE $F$ -MEASURE AND OTHER PERFORMANCE METRICS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Many important classification performance metrics, e.g. the $F$ -measure, are nondifferentiable and non-decomposable, and are thus unfriendly to the gradient descent algorithm. Consequently, despite their popularity as evaluation metrics, these metrics are rarely optimized as training objectives in neural network community. In this paper, we propose an empirical utility maximization scheme with provable learning guarantees to address the non-differentiability of these metrics. We then derive a strongly consistent gradient estimator to handle nondecomposability. These innovations enable end-to-end optimization of these performance metrics with the same computational complexity as optimizing a decomposable and differentiable metric, e.g. the cross-entropy loss.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Different classification performance metrics are capable of revealing different aspects of a classifier’s behavior. For example, the $F$ -measure (Van Rijsbergen (1974)), compared to performance metrics such as accuracy, is better at evaluating a classifier’s performance when it encounters a sample belonging to a class that occurs with low frequency. Ideally, we can acquire a classifier with very tailored behavior by optimizing the classifier with respect to a carefully chosen performance metric. Unfortunately, many performance metrics, e.g. the $F$ -measure, are non-differentiable and non-decomposable, which renders it very difficult to optimize neural network classifiers with these metrics as training objective.
12
+
13
+ In this paper, we propose a method that enables gradient-based learning for these performance metrics. Our contributions are the following:
14
+
15
+ • We propose a learning algorithm based on empirical utility maximization for a class of performance metrics and prove its generalization and consistency.
16
+ We propose a strongly consistent gradient estimator that enables efficient gradient-based maximization of empirical utility.
17
+ We demonstrate experimentally that the binary $F _ { 1 }$ score of neural network classifiers can be efficiently optimized on datasets of decent scale and complexity.
18
+
19
+ We organize this paper as the following. In Section 2, we will sketch our method for the binary $F _ { 1 }$ score to provide an overview. In Section 3, we will present our method in its general form. We review related work in Section 4 and provide experiment results in Section 5.
20
+
21
+ # 2 GRADIENT-BASED LEARNING FOR THE BINARY $F _ { 1 }$ SCORE
22
+
23
+ # 2.1 PROBABILISTIC CLASSIFIER
24
+
25
+ Given a feature vector $\pmb { x } \in \pmb { \chi } \subset \mathbb { R } ^ { N }$ , a probabilistic classifier $h$ first infers a posterior $p ( \cdot | x )$ over a discrete output space $\mathcal { V }$ and then samples its output from the posterior, i.e. $h ( \pmb { x } ) \sim p ( \cdot | \pmb { x } )$ . In practice, $p ( \cdot | x )$ is typically the output of a neural network with softmax layer on its top.When the posterior is parameterized, e.g. being implemented as a neural network, we denote it as $\bar { p } _ { \theta } ( \cdot | { \boldsymbol { x } } )$ and the corresponding probabilistic classifier as $h _ { \theta }$ .
26
+
27
+ Given a posterior $p ( \cdot | x )$ , a deterministic classifier can result from the inference rule $h ( { \pmb x } ) \ =$ argm $\mathbf { a x } _ { y \in \mathcal { y } } p ( y | \mathbf { x } )$ .The difference between probabilistic and deterministic inference rules is negligible when the posterior is very concentrated. Although deterministic classifiers are more popular in the literature, in this paper we only consider probabilistic classifiers and leave it as future work to investigate the case where a probabilistic classifier is replaced by a deterministic one.
28
+
29
+ # 2.2 $F$ -MEASURE
30
+
31
+ Consider the case of binary classification, where $\mathcal { V } = \{ 0 , 1 \}$ with 1 and 0 respectively corresponding to the positive and negative class. Given a dataset $D = \{ ( { \dot { \mathbf { x } } } _ { 1 } , y _ { 1 } ) , . . . , ( { \mathbf { x } } _ { n } , y _ { n } ) \}$ consisting of $n$ i.i.d. pairs of feature vector and ground truth, let $\hat { y } _ { i }$ denote the label predicted by a classifier $h$ given $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ (not necessarily deterministically). Let $\hat { \pmb { y } } = ( \hat { y } _ { 1 } , . . . , \hat { y } _ { n } )$ and $\pmb { y } = ( y _ { 1 } , . . . , y _ { n } )$ . Then the truepositive, false-positive, false-negative and true-negative rate corresponding to $\hat { y }$ and $\textbf { { y } }$ are defined as
32
+
33
+ $$
34
+ \begin{array} { l l } { { \displaystyle { \mathrm { t p } } ( \hat { y } , y ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { I } \left( \hat { y } _ { i } = 1 \wedge y _ { i } = 1 \right) } } & { { \quad { \mathrm { f p } } ( \hat { y } , y ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { I } \left( \hat { y } _ { i } = 1 \wedge y _ { i } = 0 \right) } } \\ { { \displaystyle { \mathrm { f n } } ( \hat { y } , y ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { I } \left( \hat { y } _ { i } = 0 \wedge y _ { i } = 1 \right) } } & { { \quad { \mathrm { t n } } ( \hat { y } , y ) : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { I } \left( \hat { y } _ { i } = 0 \wedge y _ { i } = 0 \right) } } \end{array}
35
+ $$
36
+
37
+ where $\mathbb { I }$ denotes indicator function. The precision and recall are defined as
38
+
39
+ $$
40
+ \mathrm { p r e c i s i o n } ( { \pmb { \hat { y } } } , { \pmb { y } } ) = \frac { \mathrm { t p } ( { \pmb { \hat { y } } } , { \pmb { y } } ) } { \mathrm { t p } ( { \pmb { \hat { y } } } , { \pmb { y } } ) + \mathrm { f p } ( { \pmb { \hat { y } } } , { \pmb { y } } ) } \qquad \mathrm { r e c a l l } ( { \pmb { \hat { y } } } , { \pmb { y } } ) = \frac { \mathrm { t p } ( { \pmb { \hat { y } } } , { \pmb { y } } ) } { p _ { D } ^ { + } }
41
+ $$
42
+
43
+ where $\begin{array} { r } { p _ { D } ^ { + } : = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbb { I } ( y _ { i } = 1 ) } \end{array}$ denotes the proportion of samples in $D$ that belong to positive class. The binary $F$ -measure is defined as (Van Rijsbergen (1974)):
44
+
45
+ $$
46
+ F _ { \beta } ( { \pmb \hat { y } } , { \pmb y } ) = ( 1 + \beta ^ { 2 } ) \cdot \frac { \mathrm { p r e c i s i o n } ( { \pmb \hat { y } } , { \pmb y } ) \cdot \mathrm { r e c a l l } ( { \pmb \hat { y } } , { \pmb y } ) } { \beta \cdot \mathrm { p r e c i s i o n } ( { \pmb \hat { y } } , { \pmb y } ) + \mathrm { r e c a l l } ( { \pmb \hat { y } } , { \pmb y } ) } \qquad \beta > 0
47
+ $$
48
+
49
+ or equivalently,
50
+
51
+ $$
52
+ F _ { \beta } ( { \pmb \hat { y } } , { \pmb y } ) = ( 1 + \beta ^ { 2 } ) \cdot \frac { p _ { D } ^ { + } - \mathrm { f n } ( { \pmb \hat { y } } , { \pmb y } ) } { ( 1 + \beta ^ { 2 } ) p _ { D } ^ { + } - \mathrm { f n } ( { \pmb \hat { y } } , { \pmb y } ) + \mathrm { f p } ( { \pmb \hat { y } } , { \pmb y } ) } \qquad \beta > 0
53
+ $$
54
+
55
+ which is more convenient for our purpose.
56
+
57
+ We will refer to $F _ { \beta } ( \hat { \pmb y } , \pmb y )$ as the data-dependent binary $F _ { \beta }$ -measure because it is evaluated on a specific set of data with pairs of ground truth and prediction vectors. $F _ { \beta }$ is non-differentiable because it is a composition of indicator functions. Nor does it decompose over samples in $D$ . More precisely, we are not aware of any function $f _ { \beta }$ that only depends on per sample ground-truth and prediction such that
58
+
59
+ $$
60
+ F _ { \beta } ( \hat { \pmb y } , \pmb y ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f _ { \beta } ( \hat { y } _ { i } , y _ { i } )
61
+ $$
62
+
63
+ In the following we propose an empirical utility maximization scheme for optimizing the $F _ { \beta }$ - measure of probabilistic classifiers. For ease of exposition, in this section we focus on the binary $F _ { 1 }$ -measure, a.k.a. the binary $F _ { 1 }$ score. In Section 3, we will extend the method presented in this section to a family of non-decomposable and non-differentiable performance metrics, including $F _ { \beta }$ - measure for multi-class classification.
64
+
65
+ # 2.3 GRADIENT-BASED LEARNING FOR THE BINARY $F _ { 1 }$ SCORE
66
+
67
+ We consider a parameterized binary probabilistic classifier $h _ { \theta }$ . By linearity of expectation and the i.i.d. assumption,
68
+
69
+ $$
70
+ \mathbb { E } _ { \pmb { \hat { y } } , \pmb { y } } [ \mathrm { f p } ( \pmb { \hat { y } } , \pmb { y } ) ] = \mathbb { P } ( \hat { \mathbf { y } } = 1 \wedge \mathbf { y } = 0 )
71
+ $$
72
+
73
+ where the expectation is taken over all datasets with a fixed size $n$ and all possible predictions of $h _ { \theta }$ . Similarly, $\mathbb { E } _ { \pmb { \hat { y } } , \pmb { y } } [ \mathrm { f n } ( \pmb { \hat { y } } , \pmb { y } ) ] = \mathbb { P } ( \hat { \mathbf { y } } = 0 \land \mathbf { y } = 1 )$ . Let $\overline { { \mathrm { f n } } } ( h _ { \theta } ) : = \mathbb { E } _ { \hat { \pmb { y } } , \pmb { y } } [ \mathrm { f n } ( \hat { \pmb { y } } , \pmb { y } ) ]$ and ${ \overline { { \operatorname { f p } } } } ( h _ { \theta } ) : =$ $\mathbb { E } _ { \hat { \pmb { y } } , \pmb { y } } [ \mathbf { f p } ( \hat { \pmb { y } } , \pmb { y } ) ]$ . It follows from the law of large number that
74
+
75
+ $$
76
+ \operatorname * { l i m } _ { | D | \infty } \mathrm { f n } ( { \hat { y } } , y ) = \overline { { \mathrm { f n } } } ( h _ { \theta } ) \qquad \operatorname * { l i m } _ { | D | \infty } \mathrm { f p } ( { \hat { y } } , y ) = \overline { { \mathrm { f p } } } ( h _ { \theta } )
77
+ $$
78
+
79
+ with probability 1, where $| D |$ denotes the size of dataset $D$ . Thus on sufficiently large datasets,
80
+
81
+ $$
82
+ \mathrm { f n } ( { \pmb { \hat { y } } } , { \pmb { y } } ) \approx \overline { { \mathrm { f n } } } ( h _ { \theta } ) \qquad \mathrm { f p } ( { \pmb { \hat { y } } } , { \pmb { y } } ) \approx \overline { { \mathrm { f p } } } ( h _ { \theta } )
83
+ $$
84
+
85
+ With these approximate identities, we have the following approximation of $F _ { 1 } ( \hat { \pmb y } , \pmb y )$ :
86
+
87
+ $$
88
+ F _ { 1 } ( { \hat { y } } , y ) = 2 \cdot { \frac { p _ { D } ^ { + } - \operatorname { f n } ( { \hat { y } } , y ) } { 2 p _ { D } ^ { + } - \operatorname { f n } ( { \hat { y } } , y ) + \operatorname { f p } ( { \hat { y } } , y ) } } \approx 2 \cdot { \frac { p _ { D } ^ { + } - { \overline { { \operatorname { f n } } } } ( h _ { \theta } ) } { 2 p _ { D } ^ { + } - { \overline { { \operatorname { f n } } } } ( h _ { \theta } ) + { \overline { { \operatorname { f p } } } } ( h _ { \theta } ) } } : = { \bar { F } } _ { 1 } ( h _ { \theta } )
89
+ $$
90
+
91
+ which implies that the $F _ { 1 }$ score of any predictions of $h _ { \theta }$ on any sufficiently large dataset is close to $\bar { F } _ { 1 } ( h _ { \theta } )$ . We call $\bar { F } _ { 1 } ( h _ { \theta } )$ the expected utility of the $F _ { 1 }$ score and will state the precise meaning of $F _ { 1 } ( \hat { \pmb { y } } , \pmb { y } ) \approx \bar { F } _ { 1 } ( h _ { \theta } )$ in Section 3. The key point is that we can optimize $\bar { F } _ { 1 } ( h _ { \theta } )$ instead of $F _ { 1 } ( \hat { \pmb y } , \pmb y )$ if we are interested in the $F _ { 1 }$ score of $h _ { \theta }$ on sufficiently large datasets. However, $\overline { { \mathbf { f } \mathbf { n } } } ( h _ { \theta } )$ and ${ \overline { { \mathbf { f p } } } } ( h _ { \theta } )$ are unknown because they are expectations taken over data distribution (and the classifier’s posterior). Consequently, we have to estimate $\overline { { \mathbf { f } \mathbf { n } } } ( h _ { \theta } )$ and ${ \overline { { \mathbf { f p } } } } ( h _ { \theta } )$ by sampling from data distribution in order to estimate $\bar { F } _ { 1 } ( \dot { h } _ { \theta } )$ , as the following.
92
+
93
+ Let $p ^ { + } : = \mathbb { P } ( \mathbf { y } = 1 )$ denote the probability that a positive sample occurs, which can be estimated by the frequency of positive samples in a training set $D$ . Let $\begin{array} { r } { n ^ { + } : = \sum _ { ( \pmb { x } , y ) \in D } \mathbb { I } ( y = 1 ) } \end{array}$ denote the number of positive samples in the training set. Assume that the data distribution admits a density function (i.e. the data distribution is absolutely continuous w.r.t. the Lebesgue measure), and denote its density function by $p$ . We have the following unbiased estimator of $\overline { { \mathbf { f } \mathbf { n } } } ( \breve { h } _ { \theta } )$ :
94
+
95
+ $$
96
+ \begin{array} { r l } { \mathbf { f i } ( h _ { \theta } ) = \mathbb { P } ( \hat { \mathbf { y } } = \boldsymbol { 0 } \wedge \mathbf { y } = \boldsymbol { 1 } ) } \\ & { = \int _ { \boldsymbol { X } } \mathbb { P } ( h _ { \theta } ( \boldsymbol { x } ) = 0 ) p ( \boldsymbol { x } , \boldsymbol { 1 } ) \mathrm { d } \boldsymbol { x } } \\ & { = \int _ { \boldsymbol { X } } p \boldsymbol { \theta } ( \boldsymbol { 0 } | \boldsymbol { x } ) p ( \boldsymbol { x } | \boldsymbol { 1 } ) p ^ { + } \mathrm { d } \boldsymbol { x } } \\ & { = p ^ { + } \int _ { \boldsymbol { X } } p _ { \theta } ( \boldsymbol { 0 } | \boldsymbol { x } ) p ( \boldsymbol { x } | \boldsymbol { 1 } ) \mathrm { d } \boldsymbol { x } } \\ & { = p ^ { + } \mathbb { E } _ { \boldsymbol { x } \sim p ( \cdot \vert \boldsymbol { 1 } ) } \mathrm { [ } p \boldsymbol { \theta } ( \boldsymbol { 0 } | \boldsymbol { x } ) \big ] } \\ & { \approx \frac { p ^ { + } } { n ^ { + } } \sum _ { i = 1 } ^ { n ^ { + } } p _ { \theta } ( 0 | \mathbf { x } _ { i } ^ { + } ) : = \hat { \Pi } _ { D } ( h _ { \theta } ) } \end{array}
97
+ $$
98
+
99
+ where ${ \pmb x } _ { 1 } ^ { + } , . . . , { \pmb x } _ { n ^ { + } } ^ { + }$ .., x+n+ a re the feature vectors of samples belonging to the positive class in trainingset $D$ . Similarly,
100
+
101
+ $$
102
+ { \overline { { \mathsf { f p } } } } ( h _ { \theta } ) = \mathbb { P } \left( { \hat { \mathbf { y } } } = 1 \wedge \mathbf { y } = 0 \right) \approx { \frac { p ^ { - } } { n ^ { - } } } \sum _ { i = 1 } ^ { n ^ { - } } p _ { \theta } ( 1 | x _ { i } ^ { - } ) : = { \widehat { \mathbf { f } } } { \widehat { \mathbf { p } } } _ { D } ( h _ { \theta } )
103
+ $$
104
+
105
+ where $\begin{array} { r } { p ^ { - } : = \mathbb { P } ( \mathbf { y } = 0 ) , n ^ { - } : = \sum _ { ( \pmb { x } , \pmb { y } ) \in D } \mathbb { I } ( \pmb { y } = 0 ) . } \end{array}$ , and $\mathbf { \mathfrak { x } } _ { 1 } ^ { - } , . . . , \mathbf { \mathfrak { x } } _ { n } ^ { - }$ are the feature vectors of samples in $D$ belonging to the negative class. Thus $\bar { F } _ { 1 } ( h _ { \theta } )$ can be estimated as the following:
106
+
107
+ $$
108
+ \bar { F } _ { 1 } ( h _ { \theta } ) = 2 \cdot \frac { p ^ { + } - \overline { { \mathrm { f n } } } ( h _ { \theta } ) } { 2 p ^ { + } - \overline { { \mathrm { f n } } } ( h _ { \theta } ) + \overline { { \mathrm { f p } } } ( h _ { \theta } ) } \approx 2 \cdot \frac { p ^ { + } - \widehat { \mathrm { f n } } _ { D } ( h _ { \theta } ) } { 2 p ^ { + } - \widehat { \mathrm { f n } } _ { D } ( h _ { \theta } ) + \widehat { \mathrm { f p } } _ { D } ( h _ { \theta } ) } : = \hat { F } _ { D } ( h _ { \theta } )
109
+ $$
110
+
111
+ We will state the precise meaning of $\bar { F } _ { 1 } ( h _ { \theta } ) \approx \hat { F } _ { D } ( h _ { \theta } )$ in Section 3. Interestingly, although $\mathrm { f n } ( \hat { \pmb y } , \pmb y )$ and fp $( \hat { \pmb y } , \pmb y )$ are not differentiable, the estimators of their expectations, $\widehat { \mathrm { f n } } _ { D } ( h _ { \theta } )$ and ${ \widehat { \mathrm { f p } } } _ { D } ( h _ { \theta } )$ , are differentiable w.r.t. $\theta$ if $p _ { \theta }$ is differentiable. Because $\hat { F } _ { D } ( h _ { \theta } )$ is differentiable w.r.t. $\widehat { \mathrm { f n } } ( h _ { \theta } )$ and $\widehat { \mathrm { f p } } ( h _ { \theta } ) , \nabla _ { \theta } \widehat { F } _ { D } ( h _ { \theta } )$ can be computed by chain rule. Consequently, gradient descent can be applied to optimize $\hat { F } _ { D } ( \theta )$ .
112
+
113
+ We call $\hat { F } _ { D } ( \theta )$ the empirical utility of the expected utility $\bar { F } _ { 1 } ( h _ { \theta } )$ . They correspond to empirical and expected risk in the classical empirical risk minimization principle of statistical learning theory (Vapnik (1992)). We use the term “empirical utility maximization” because we would like to maximize, instead of minimize these performance metrics. There are two fundamental questions for every empirical risk minimization style learning algorithm, as the number of samples increases:
114
+
115
+ • Generalization. Given $h _ { \theta }$ , does $\hat { F } _ { D } ( h _ { \theta } ) \bar { F } _ { 1 } ( h _ { \theta } )$ as $| D | \to \infty ?$ • Consistency. Does argma $\mathrm { x } _ { \theta } \hat { F } _ { D } ( h _ { \theta } ) \mathrm { a r g m a x } _ { \theta } \bar { F } _ { 1 } ( h _ { \theta } )$ as $| D | \to \infty !$
116
+
117
+ We will address these two questions at the end of Section 3. For the moment let us consider a practical issue: how to maximize empirical utility $\bar { F } _ { D } ( h _ { \theta } )$ efficiently with gradient descent?
118
+
119
+ # 2.4 GRADIENT ESTIMATOR
120
+
121
+ In order for the approximation in Eq. 6 to be accurate, $| D |$ has to be sufficiently large. In order to optimize $\hat { F } _ { D } ( h _ { \theta } )$ efficiently via minibatch gradient descent, $\nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } )$ has to be estimated by $\nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } )$ , where $B \subset D$ is a mini-batch, such that $\mathbb { E } _ { B } [ \nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } ) ] \ : = \ : \nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } )$ . Suppose $\hat { F } _ { D } ( h _ { \theta } )$ is decomposable, i.e. there is a per-sample loss function $\hat { f }$ such that $\hat { F } _ { D } ( h _ { \theta } ) \ =$ $\begin{array} { r } { \frac { 1 } { | D | } \sum _ { ( { \pmb x } , y ) \in D } \hat { f } ( p _ { \theta } ( { \pmb x } ) , y ) } \end{array}$ , then it simply follows from linearity of differentiation and expectation that the requirement is satisfied. However, as $\hat { F } _ { D } ( h _ { \theta } )$ is non-decomposable, it becomes unlikely that $\nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } )$ is an unbiased estimator of $\nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } )$ . Fortunately, as a consequence of Theorem 1, $\nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } )$ is a strongly consistent estimator of $\nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } )$ when $| D |$ is sufficiently large. More precisely,
122
+
123
+ $$
124
+ \mathbb { P } ( \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } ) = \operatorname* { l i m } _ { | D | \infty } \nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } ) ) = 1
125
+ $$
126
+
127
+ Thus $\nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } )$ is almost as good as an unbiased estimator. More interestingly, the error incurred by estimating $\nabla _ { \theta } \hat { F } _ { D } ( h _ { \theta } )$ with $\nabla _ { \theta } \hat { F } _ { B } ( h _ { \theta } )$ can be further controlled. In the following we omit the dependence on $h _ { \theta }$ for brevity. Let $\phi _ { D } : = ( \widehat { \mathrm { f n } } _ { D } ( h _ { \theta } ) , \widehat { \mathrm { f p } } _ { D } ( h _ { \theta } ) ) \in \mathbb { R } ^ { 2 }$ and $\phi _ { B } : = ( \widehat { \mathrm { f n } } _ { B } \widetilde ( h _ { \theta } ) , \widehat { \mathrm { f p } } _ { B } ( h _ { \theta } ) ) \in$ $\mathbb { R } ^ { 2 }$ . Let $\widehat { J } _ { D }$ and ${ \widehat { \pmb J } } _ { B }$ denotes the Jacobian of $\widehat { \phi } _ { D }$ and $\widehat { \phi } _ { B }$ w.r.t. $\theta$ . Let $| \cdot |$ denote a vector norm and $| | \cdot | |$ denote the matrix norm induced by it. By chain rule,
128
+
129
+ $$
130
+ \begin{array} { r l } & { \nabla _ { \boldsymbol { \theta } } \hat { F } _ { B } = \nabla _ { \boldsymbol { \phi } _ { B } } \hat { F } _ { B } \hat { \boldsymbol { J } } _ { B } } \\ & { \qquad = \left( \nabla _ { \boldsymbol { \phi } _ { D } } \hat { F } _ { D } + \boldsymbol { \epsilon } \right) \left( \widehat { \boldsymbol { J } } _ { D } + \boldsymbol { \varepsilon } \right) } \\ & { \qquad = \nabla _ { \boldsymbol { \phi } _ { D } } \hat { F } _ { D } \widehat { \boldsymbol { J } } _ { D } + \nabla _ { \boldsymbol { \phi } _ { D } } \hat { F } _ { D } \pm \boldsymbol { \varepsilon } + \boldsymbol { \epsilon } \widehat { \boldsymbol { J } } _ { D } + \boldsymbol { \epsilon } \pmb { \varepsilon } } \end{array}
131
+ $$
132
+
133
+ where $\nabla _ { \phi _ { D } } \hat { F } _ { D } \cdot \hat { J } _ { D }$ is the true gradient and $\boldsymbol { \epsilon } \cdot \boldsymbol { \varepsilon }$ is negligible. The error $\pmb { \mathcal { E } } = \widehat { J } _ { B } ( h _ { \theta } ) - \widehat { J } _ { D } ( h _ { \theta } )$ is intrinsic in the sense that it results immediately from estimating $\nabla _ { \boldsymbol { \theta } } \widehat { \mathrm { f n } } _ { D } ( h _ { \boldsymbol { \theta } } )$ and $\nabla _ { \boldsymbol { \theta } } \widehat { \mathrm { f p } } _ { D } ( h _ { \boldsymbol { \theta } } )$ with $\nabla _ { \theta } \widehat { \mathrm { f n } } _ { B } ( h _ { \theta } )$ and $\nabla _ { \boldsymbol { \theta } } \widehat { \mathrm { f p } } _ { B } ( h _ { \boldsymbol { \theta } } )$ and it is always present in mini-batch gradient descent because $\mathbb { E } [ \nabla _ { \theta } \widehat { \mathbf { f } } _ { \mathbf { \Pi } _ { B } } ( h _ { \theta } ) ] \ : = \ : \nabla _ { \theta } \widehat { \mathbf { f } } \widehat { \mathbf { n } } _ { D } ( h _ { \theta } )$ and $\mathbb { E } [ \nabla _ { \theta } \widehat { \mathbf { f p } } _ { B } ( h _ { \theta } ) ] = \nabla _ { \theta } \widehat { \mathbf { f p } } _ { D } ( h _ { \theta } )$ . However, we can control the error $\epsilon \cdot \widehat { J } _ { D }$ because $| \epsilon \cdot \widehat { J } | \leq | | \widehat { J } | | \cdot | \epsilon |$ and we can control $| | \widehat { J } | |$ by limiting $| \theta |$ and the norm of intermediate activations when $p _ { \theta }$ is a neural network (He et al. (2015)). Despite these technicalities, the trick is very easy to implement: batch normalization (Ioffe & Szegedy (2015)) and weight decay will suffice. These are summarized in Algorithm 1.
134
+
135
+ # Algorithm 1 Gradient-based learning for the binary $F _ { 1 }$ score
136
+
137
+ Require: classifier $h _ { \theta }$ , batch size $b$ , dataset $D$ , learning rate $\alpha$ , weight decay strength $\lambda$ $\begin{array} { r } { \hat { p ^ { + } } \frac { 1 } { | D | } \sum _ { ( \pmb { x } , y ) \in D } \mathbb { I } ( y = 1 ) } \end{array}$ $\begin{array} { r } { p ^ { - } \frac { 1 } { | D | } \sum _ { ( \pmb { x } , y ) \in D } \mathbb { I } ( y = 0 ) } \end{array}$ while terminating criterion not satisfied do Sample $B _ { + } \doteq \{ ( \pmb { x } _ { 1 } ^ { + } , 1 ) , . . . , ( \pmb { x } _ { b } ^ { + } , 1 ) \}$ from $D$ Sample $B _ { - } = \{ ( \pmb { x } _ { 1 } ^ { - } , 0 ) , . . . , ( \pmb { x } _ { b } ^ { - } , 0 ) \}$ from $D$ $\begin{array} { r } { \mathrm { f n } \frac { p ^ { + } } { b } \sum _ { i = 1 } ^ { b } p _ { \theta } ( 0 | \pmb { x } _ { 1 } ^ { + } ) } \end{array}$ p b Pbi=1 pθ (1|x−1 ) δ ← ∇θ F1(fn, fp) − λ · |θ| θ ← θ + α · δ end while
138
+
139
+ The binary $F$ -measure in fact belongs to a class of performance metrics that are well behaved functions of the confusion matrix. In this section, we propose a gradient-based learning algorithm that extends the approach illustrated in previous section to this class of performance metrics. We state theorems concerning the generalization and consistency of the proposed algorithm as well. We defer all proofs to appendix. We begin with a specification of this class of performance metrics, which relies on the definition of confusion matrix:
140
+
141
+ Definition 1. Given a dataset $D = \{ ( { \pmb x } _ { 1 } , y _ { 1 } ) , . . . , ( { \pmb x } _ { n } , y _ { n } ) \}$ , let $\pmb { y } = ( y _ { 1 } , . . . , y _ { n } )$ denote the vector of ground truth and $\hat { \pmb { y } } = ( \hat { y } _ { 1 } , . . . , \hat { y } _ { n } )$ denote a vector of classifier predictions. Then the corresponding data-dependent confusion matrix $C ( \hat { \pmb y } , \pmb y )$ is defined as
142
+
143
+ $$
144
+ \big ( C ( \pmb { \mathscr { y } } , \pmb { y } ) \big ) _ { i j } : = \frac { 1 } { n } \sum _ { k = 1 } ^ { n } \mathbb { I } \left( \hat { y } _ { k } = i \wedge y _ { k } = j \right) \qquad 0 \leq i , j \leq | \pmb { \mathscr { y } } | - 1
145
+ $$
146
+
147
+ In the case of binary classification,
148
+
149
+ $$
150
+ C ( \hat { \pmb y } , \pmb y ) = \left[ \mathrm { t n } ( \hat { \pmb y } , \pmb y ) \ \mathrm { f n } ( \hat { \pmb y } , \pmb y ) \right]
151
+ $$
152
+
153
+ Let $\mathbb { P }$ be a probability measure induced by data distribution and a probabilistic classifier $h _ { \theta }$ over $\mathcal { X } \times \mathcal { Y } \times \mathcal { Y }$ , i.e. triples of feature vector, ground truth and classifier prediction. Let $\bar { C } ( h _ { \theta } )$ be the entry-wise expectation of $C ( \hat { \pmb y } , \pmb y )$ over $\mathbb { P }$ , referred to as the expected confusion matrix. Formally,
154
+
155
+ $$
156
+ \left( { \bar { C } } ( h _ { \theta } ) \right) _ { i j } : = \operatorname { \mathbb { E } } \left[ \mathbb { I } ( h _ { \theta } ( \mathbf { x } ) = i \wedge \mathbf { y } = j ) \right] = \mathbb { P } ( h _ { \theta } ( \mathbf { x } ) = i \wedge \mathbf { y } = j ) \qquad 0 \leq i , j \leq | \mathcal { D } | - 1
157
+ $$
158
+
159
+ As in Section 2, given a training set $D$ , we have the following unbiased estimator of $\bar { C } ( h _ { \theta } )$ , referred to as the empirical confusion matrix:
160
+
161
+ $$
162
+ \left( \hat { C } _ { D } ( h _ { \theta } ) \right) _ { i j } = \frac { p _ { j } } { n _ { j } } \sum _ { k = 1 } ^ { n _ { j } } p _ { \theta } ( i | x _ { k } ^ { j } ) \qquad 0 \le i , j \le | \mathcal { V } | - 1
163
+ $$
164
+
165
+ where $\begin{array} { r } { n _ { j } : = \sum _ { ( \pmb { x } , \pmb { y } ) \in D } \mathbb { I } ( \pmb { y } = j ) , p _ { j } : = \frac { n _ { j } } { | D | } } \end{array}$ , and $\pmb { x } _ { 1 } ^ { j } , . . . , \pmb { x } _ { n _ { j } } ^ { j }$ are the feature vectors of samples that belong to the $j$ -th class. Almost sure convergence follows from the law of large number:
166
+
167
+ $$
168
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } ( C ( \pmb { \hat { y } } , \pmb { y } ) ) _ { i j } = ( \bar { C } ( h _ { \theta } ) ) _ { i j } ) = 1 \qquad \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } ( \hat { C } _ { D } ( h _ { \theta } ) ) _ { i j } = ( \bar { C } ( h _ { \theta } ) ) _ { i j } ) = 1
169
+ $$
170
+
171
+ The confusion matrix is well-defined for both single-label and multi-label classification (although these two settings impose different constraints on its entries). Many performance metrics are functions of the confusion matrix. For example, the accuracy of $h _ { \theta }$ is $\textstyle \sum _ { i = 1 } ^ { | y | } { \bar { C } } _ { i i } ( h _ { \theta } )$ . The $F _ { \beta }$ measure for multi-class classification can be defined in term of entries of the confusion matrix as the following. We first define for every class the data-dependent false positive and false negative rate as
172
+
173
+ $$
174
+ \mathrm { f p } _ { i } = \sum _ { j \neq i } C _ { i j } \qquad \mathrm { f n } _ { i } = \sum _ { j \neq i } C _ { j i } \qquad i = 1 , . . . , | { \mathcal { V } } |
175
+ $$
176
+
177
+ where we omit the dependence on $\hat { y }$ and $\textbf { { y } }$ for brevity. The data-dependent macro and micro $F$ - measure (Parambath et al. (2014)) are defined in term of $\mathrm { f p } _ { i }$ and $\mathrm { f n } _ { i }$ as
178
+
179
+ $$
180
+ F _ { \beta } ^ { \mathrm { m a c r o } } = \frac { 1 + \beta ^ { 2 } } { | \mathcal { V } | } \sum _ { i = 1 } ^ { | \mathcal { V } | } \frac { p _ { i } - \mathrm { f n } _ { i } } { ( 1 + \beta ^ { 2 } ) p _ { i } - \mathrm { f n } _ { i } + \mathrm { f p } _ { i } } \qquad \beta > 0
181
+ $$
182
+
183
+ $$
184
+ F _ { \beta } ^ { \mathrm { m i c r o } } = ( 1 + \beta ^ { 2 } ) \cdot \frac { \sum _ { i = 1 } ^ { | \mathcal { V } | } p _ { i } - \sum _ { i = 1 } ^ { | \mathcal { V } | } \mathrm { f n } _ { i } } { ( 1 + \beta ^ { 2 } ) \sum _ { i = 1 } ^ { | \mathcal { V } | } p _ { i } - \sum _ { i = 1 } ^ { | \mathcal { V } | } \mathrm { f n } _ { i } + \sum _ { i = 1 } ^ { | \mathcal { V } | } \mathrm { f p } _ { i } } \qquad \beta > 0
185
+ $$
186
+
187
+ Replacing $C ( \hat { \pmb y } , \pmb y )$ by $\bar { C } ( h _ { \theta } )$ and $\hat { C } ( h _ { \theta } )$ in these definitions will respectively result in the expected and empirical $F$ -measure.
188
+
189
+ We now specify the class of performance metrics that we are interested in, namely the class of well-behaved performance metrics. In the following, we will consider $C ( \hat { \pmb y } , \pmb y )$ , $\bar { C } ( h _ { \theta } )$ and $\hat { C } _ { D } ( h _ { \theta } )$ as vectors of dimension $| y | \times | y |$ and identify a performance metric with a function that maps $| \mathcal { V } | \times | \mathcal { V } |$ -dimensional vectors to real values.
190
+
191
+ Definition 2. We say that a performance metric $F : K \mapsto \mathbb { R } ,$ where $K$ is a compact subset of $\mathbb { R } ^ { | \mathcal { V } | \times | \mathcal { V } | }$ , is well-behaved if $F$ is continuously differentiable on $K$ .
192
+
193
+ Please refer to appendix for a non-exhaustive list of well-behaved performance metrics. Importantly, the binary $F _ { 1 }$ score and the macro and micro $F$ -measure are well-behaved performance metrics (proof deferred to appendix).
194
+
195
+ Given a well behaved performance metric $F$ , its corresponding data-dependent, expected and empirical utility are respectively defined as $F ( C ( \hat { \pmb y } , { \pmb y } ) )$ , $F ( { \bar { C } } ( h _ { \theta } ) )$ and $\bar { F } ( \hat { C } ( h _ { \theta } ) )$ . The following theorem establishes asymptotic equivalence between these three kinds of utilities.
196
+
197
+ Theorem 1. If $F$ is a well-behaved performance metric and $C _ { D }$ is a strongly consistent estimator of $C$ , i.e.
198
+
199
+ $$
200
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } ( C _ { D } ) _ { i j } = C _ { i j } ) = 1 \qquad 0 \leq i , j \leq | \mathcal { V } | - 1
201
+ $$
202
+
203
+ then $F \left( C _ { D } \right)$ is a strongly consistent estimator of $F ( C )$ , i.e.
204
+
205
+ $$
206
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } F ( C _ { D } ) = F ( C ) ) = 1
207
+ $$
208
+
209
+ As a consequence of this theorem, it follows from Eq. 9 that
210
+
211
+ $$
212
+ \mathbb { P } \left( \operatorname* { l i m } _ { | D | \to \infty } F \left( C ( \pmb { \hat { y } } , \pmb { y } ) \right) = F \left( \pmb { \bar { C } } ( h _ { \theta } ) \right) \right) = 1 \qquad \mathbb { P } \left( \operatorname* { l i m } _ { | D | \to \infty } F \left( \hat { C } _ { D } ( h _ { \theta } ) \right) = F \left( \pmb { \bar { C } } ( h _ { \theta } ) \right) \right) = 1
213
+ $$
214
+
215
+ i.e. both $F ( C ( \hat { \pmb y } , { \pmb y } ) )$ and $F ( { \hat { C } } ( h _ { \theta } ) )$ are strongly consistent estimators of (converge w.p. 1 to) $F ( { \bar { C } } ( h _ { \theta } ) )$ . As a special case,
216
+
217
+ $$
218
+ \mathbb { P } \left( \operatorname* { l i m } _ { | D | \to \infty } F _ { 1 } ( { \hat { y } } , { y } ) = { \bar { F } } _ { 1 } ( h _ { \theta } ) \right) = 1 \qquad \mathbb { P } \left( \operatorname* { l i m } _ { | D | \to \infty } { \hat { F } } _ { 1 } ( h _ { \theta } ) = { \bar { F } } _ { 1 } ( h _ { \theta } ) \right) = 1
219
+ $$
220
+
221
+ which justifies Eq. 4 and Eq. 6 when the dataset of interest is sufficiently large. Next we consider the issue of gradient estimation in this general setting.
222
+
223
+ Theorem 2. If $F$ is a well behaved performance metric, then $\nabla _ { \theta } F ( \hat { C } _ { B } ( h _ { \theta } ) )$ is a strongly consistent estimator of $\check { \nabla } _ { \theta } F ( \bar { C } ( h _ { \theta } ) )$ , where $B \subset D$ is a mini-batch. More precisely,
224
+
225
+ $$
226
+ \mathbb { P } ( \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } F ( \hat { C } _ { B } ( h _ { \theta } ) ) = \nabla _ { \theta } F ( \bar { C } ( h _ { \theta } ) ) ) = 1
227
+ $$
228
+
229
+ As proved in Chen & Luss (2018), many convergence guarantees for stochastic gradient descent with unbiased gradient estimators holds for stochastic gradient descent with strongly consistent gradient estimators with probability 1. As illustrated in Eq. 8, batch normalization and weight decay can help control the noise of estimator. Please refer to Algorithm 2 for the resultant algorithm.
230
+
231
+ Finally, we state two theorems concerning the generalization and consistency of Algorithm 2. Rates of convergence are omitted for brevity.
232
+
233
+ Theorem 3 (Generalization). For a well behaved performance metric $F$ , for all $\epsilon > 0$ ,
234
+
235
+ $$
236
+ \operatorname* { l i m } _ { | D | \to \infty } \mathbb { P } \left( \left| F ( \hat { C } _ { D } ( h _ { \theta } ) ) - F ( \bar { C } ( h _ { \theta } ) ) \right| < \epsilon \right) = 1
237
+ $$
238
+
239
+ Theorem 4 (Consistency). For a well behaved performance metric $F$ , with appropriate constraints on the capacity of parametric model $p _ { \theta }$ (see the proof for details), we have that for all $\epsilon > 0$ ,
240
+
241
+ $$
242
+ \operatorname* { l i m } _ { | D | \to \infty } \mathbb { P } \left( \left| \arg \operatorname* { m a x } _ { \theta } F \left( \hat { C } _ { D } ( h _ { \theta } ) \right) - \arg \operatorname* { m a x } _ { \theta } F \left( \bar { C } ( h _ { \theta } ) \right) \right| < \epsilon \right) = 1
243
+ $$
244
+
245
+ i.e. Algorithm 2 is consistent.
246
+
247
+ Algorithm 2 Gradient-based learning for well behaved performance metrics
248
+
249
+ <table><tr><td>Algorithm2Gradient-basedlearningIorwellbehavedperformancemetrics Require: batch size b, clasifier hθ, dataset D,learning rate α, weight-decay strength X,and well-</td></tr><tr><td>behaved metric F</td></tr><tr><td>for i = 1,., [| do</td></tr><tr><td>Pi ←D∑(x,y)∈DI(y= i)</td></tr><tr><td>end for</td></tr><tr><td>while terminating criterion not satisfied do</td></tr><tr><td>for i= 1,.., |)| do</td></tr><tr><td>Sample Bi = {(xi,i),,., (x,i)} from D</td></tr><tr><td>Compute pe(-|xi),., Pe(·|x)</td></tr><tr><td>end for</td></tr><tr><td>for i = 1,.., |)| do</td></tr><tr><td>for j = i;,..., (V| do</td></tr><tr><td></td></tr><tr><td>end for</td></tr><tr><td>end for</td></tr><tr><td>0←0+α.δ</td></tr><tr><td>δ←∀θ(F(C)-λ|0)</td></tr><tr><td>end while</td></tr></table>
250
+
251
+ # 4 RELATED WORK
252
+
253
+ The optimization of non-decomposable and non-differentiable performance metrics, especially $F$ - measure, has been extensively studied. The heuristic algorithm considered in Jansche (2005) and Pastor-Pellicer et al. (2013) is essentially Algorithm 1 without techniques that stabilize gradient estimation. However, Jansche (2005) and Pastor-Pellicer et al. (2013) are not very well motivated theoretically and provide little mathematical insight into the heuristic. Also, as shown in Section 5, applying this heuristic algorithm without stabilization techniques can easily result in non-convergent models, even for a three-layer fully-connected network.
254
+
255
+ Another series of papers (Joachims (2005), Kar et al. (2014) and Narasimhan et al. (2015)) study optimizing differentiable lower bounds of various non-decomposable and non-differentiable binary classification metrics for linear classifiers. Despite proved learning guarantees for linear classifier, these lower bound methods are not very promising when applied to neural networks, as reported in Sanyal et al. (2018).
256
+
257
+ Thresholding is a computationally economical method if we only consider binary classification. Koyejo et al. (2014) proves that the optimal classifier with respect to a family of binary classification metrics, including the $F$ -measure, is appropriately thresholded Bayes classifier. Given an approximation of Bayes classifier, we can approach the optimal threshold via grid search. However, it remains unknown how to generalize thresholding to multi-class classification. More importantly, for binary classification, when training set is extremely imbalanced, it can be very difficult to train a classifier that approximates Bayes classifier very well.
258
+
259
+ The computational cost of aforementioned methods roughly equals that of training classifiers with standard classification losses such as cross-entropy. As proved in Parambath et al. (2014) and Koyejo et al. (2014), optimization of many performance metrics, including $F$ -measure, can be reduced to weighted classification. Unfortunately, the optimal weight is in general unknown and has to be approximated by an expensive grid search (see Section 5). Despite its computational cost, unlike thresholding, this method can perform reasonably well even when a training set is extremely balanced. Eban et al. (2016) proposes a similar method that performs well for neural networks coupled with the AUCPR metric.
260
+
261
+ Regarding theory, the equivalence between the data-dependent and expected utility of the $F$ -measure was first proved in Nan et al. (2012) and later generalized in Dembczynski et al. (2017) to ´ $p$ -Lipschitz binary classification performance metrics.
262
+
263
+ Table 1: Dataset statistics and results
264
+
265
+ <table><tr><td>DATASET</td><td>#FEATS</td><td># SAMPS</td><td>% POS</td><td>F1 GS</td><td>F1EUM</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Adult</td><td>108</td><td>48,842</td><td>23.93</td><td>0.701</td><td>0.689</td></tr><tr><td>CIFAR10</td><td>3072</td><td>60,000</td><td>10.00</td><td>0.630</td><td>0.635</td></tr><tr><td>Letter</td><td>16</td><td>20.000</td><td>3.92</td><td>0.990</td><td>0.975</td></tr><tr><td>Covtype</td><td>54</td><td>581,012</td><td>1.63</td><td>0.691</td><td>0.725</td></tr><tr><td>CIFAR100</td><td>3072</td><td>60,000</td><td>1.00</td><td>0.350</td><td>0.392</td></tr><tr><td>KDDCup08</td><td>117</td><td>102,294</td><td>0.61</td><td>0.543</td><td>0.556</td></tr></table>
266
+
267
+ # 5 EXPERIMENTS
268
+
269
+ We evaluate Algorithm 1 on the following datasets: Letter1, Adult2, Covertype3, $\mathrm { K D D C u p 0 8 ^ { 4 } }$ , CIFAR10 and CIFAR100 (Krizhevsky (2009)). The performance metric to optimize is the binary $F _ { 1 }$ score. The purpose of this experiment is to demonstrate that Algorithm 1 can match the performance of a provably optimal, yet considerably more expensive algorithm that optimizes the $F _ { 1 }$ score. We use a three-layer fully-connected network in our experiments, with batch normalization enabled. The statistics of these datasets are summarized in Table 1 (number of features, number of samples, percentage of positive samples). For multi-class datasets (Letter, Covertype, CIFAR10 and CIFAR100), we designate one class as the positive class and leave the rest as the negative class. We compare Algorithm 1 with the following baseline (Parambath et al. (2014) and Koyejo et al. (2014)):
270
+
271
+ $$
272
+ \theta ^ { * } \longleftarrow \operatorname * { a r g m a x } _ { \theta , \lambda \in ( 0 , 1 ) } \frac { 1 } { | D | } \sum _ { ( \pmb { x } , y ) \in D } l ( p _ { \theta } ( \pmb { x } ) , y ) \left( \lambda \mathbb { I } ( y = 0 ) + ( 1 - \lambda ) \mathbb { I } ( y = 1 ) \right)
273
+ $$
274
+
275
+ where $l$ denotes the cross-entropy loss. We let $\lambda = 0 . 1 , 0 . 2 , 0 . 3 , . . . , 0 . 9$ , and apply gradient descent to optimize $\theta$ for a fixed $\lambda$ . As proved in Parambath et al. (2014) and Koyejo et al. (2014), this baseline method should yield an approximately optimal $F _ { 1 }$ score (although at a cost considerably higher than Algorithm 1 because we have to optimize $\theta$ for every $\lambda$ ). In our case, the baseline method is 8 times slower than Algorithm 1. To our knowledge, the baseline method is the state-ofthe-art method in term of resultant $F _ { 1 }$ score (not in term of efficiency). We apply weight decay to both methods and find that in general weight decay improves the performance of Algorithm 1 while hurts the performance of baseline method. For the Covertype dataset, Algorithm 1 cannot converge without weight decay, which is an evidence that weight decay may improve gradient estimation. We report results in Table 1, where “ $F _ { 1 }$ GS” refers to the $F _ { 1 }$ score attained by the grid-search method and “ $F _ { 1 }$ EUM” refers to the $F _ { 1 }$ score attained by Algorithm 1.
276
+
277
+ # 6 CONCLUSION
278
+
279
+ We propose an empirical utility maximization scheme that enables efficient gradient-based learning for a class of non-decomposable and non-differentiable classification performance metrics. We inquire into the proposed scheme mathematically and present preliminary experiments that validate our approach. We leave it as future work to experiment on deeper neural networks, larger datasets, and more complex performance metrics.
280
+
281
+ # REFERENCES
282
+
283
+ Jie Chen and Ronny Luss. Stochastic gradient descent with biased but consistent gradient estimators. CoRR, abs/1807.11880, 2018. URL http://arxiv.org/abs/1807.11880.
284
+
285
+ Seung-Seok Choi, Sung-Hyuk Cha, and Charles C Tappert. A survey of binary similarity and distance measures. 2010.
286
+
287
+ Krzysztof Dembczynski, Wojciech Kotłowski, Oluwasanmi Koyejo, and Nagarajan Natarajan. Con- ´ sistency analysis for binary classification revisited. In International Conference on Machine Learning, pp. 961–969, 2017.
288
+
289
+ Luc Devroye. Classification and trees. In Structural, Syntactic, and Statistical Pattern Recognition, Joint IAPR International Workshop, SSPR&SPR 2010, Cesme, Izmir, Turkey, August 18-20, 2010. Proceedings, pp. 40–44, 2010. doi: 10.1007/978-3-642-14980-1\ 3. URL https://doi. org/10.1007/978-3-642-14980-1_3.
290
+
291
+ Elad ET Eban, Mariano Schain, Alan Mackey, Ariel Gordon, Rif A Saurous, and Gal Elidan. Scalable learning of non-decomposable objectives. arXiv preprint arXiv:1608.04802, 2016.
292
+
293
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
294
+
295
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
296
+
297
+ Martin Jansche. Maximum expected f-measure training of logistic regression models. In Proceedings of the conference on Human Language Technology and Empirical Methods in Natural Language Processing, pp. 692–699. Association for Computational Linguistics, 2005.
298
+
299
+ Thorsten Joachims. A support vector method for multivariate performance measures. In Proceedings of the 22nd international conference on Machine learning, pp. 377–384. ACM, 2005.
300
+
301
+ Purushottam Kar, Harikrishna Narasimhan, and Prateek Jain. Online and stochastic gradient methods for non-decomposable loss functions. In Advances in Neural Information Processing Systems, pp. 694–702, 2014.
302
+
303
+ Oluwasanmi O Koyejo, Nagarajan Natarajan, Pradeep K Ravikumar, and Inderjit S Dhillon. Consistent binary classification with generalized performance metrics. In Advances in Neural Information Processing Systems, pp. 2744–2752, 2014.
304
+
305
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
306
+
307
+ Ye Nan, Kian Ming Chai, Wee Sun Lee, and Hai Leong Chieu. Optimizing f-measure: A tale of two approaches. arXiv preprint arXiv:1206.4625, 2012.
308
+
309
+ Harikrishna Narasimhan, Purushottam Kar, and Prateek Jain. Optimizing non-decomposable performance measures: a tale of two classes. In International Conference on Machine Learning, pp. 199–208, 2015.
310
+
311
+ Shameem Puthiya Parambath, Nicolas Usunier, and Yves Grandvalet. Optimizing f-measures by cost-sensitive classification. In Advances in Neural Information Processing Systems, pp. 2123– 2131, 2014.
312
+
313
+ 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, pp. 376–384. Springer, 2013.
314
+
315
+ Amartya Sanyal, Pawan Kumar, Purushottam Kar, Sanjay Chawla, and Fabrizio Sebastiani. Optimizing non-decomposable measures with deep networks. arXiv preprint arXiv:1802.00086, 2018.
316
+
317
+ Cornelis Joost Van Rijsbergen. Foundation of evaluation. Journal of Documentation, 30(4):365– 373, 1974.
318
+
319
+ Vladimir Vapnik. Principles of risk minimization for learning theory. In Advances in neural information processing systems, pp. 831–838, 1992.
320
+
321
+ # PROOFS
322
+
323
+ Theorem 1. If $F$ is a well-behaved performance metric and $C _ { D }$ is a strongly consistent estimator of $C$ , i.e.
324
+
325
+ $$
326
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } ( C _ { D } ) _ { i j } = C _ { i j } ) = 1 \qquad 0 \leq i , j \leq | \mathcal { V } | - 1
327
+ $$
328
+
329
+ then $F \left( C _ { D } \right)$ is a strongly consistent estimator of $F ( C )$ , i.e.
330
+
331
+ $$
332
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } F ( C _ { D } ) = F ( C ) ) = 1
333
+ $$
334
+
335
+ Proof. Let $N = | \mathcal { V } | \times | \mathcal { V } | .$ . Instead of treating $C _ { D }$ and $C$ as $| \mathcal { V } | \times | \mathcal { V } |$ matrices, we treat them as $N$ -dimensional vectors $( C _ { 1 } ^ { \dot { \cal D } } , . . . , C _ { N } ^ { D } )$ and $( C _ { 1 } , . . . , C _ { N } )$ . For $i = 1 , . . . , N$ , let $E _ { i }$ be the event that
336
+
337
+ $$
338
+ \operatorname* { l i m } _ { | D | \to \infty } C _ { i } ^ { D } = C _ { i }
339
+ $$
340
+
341
+ Let $E$ be the event that
342
+
343
+ $$
344
+ \operatorname* { l i m } _ { | D | \infty } F ( C _ { D } ) = F ( C )
345
+ $$
346
+
347
+ By the continuity of $F$ ,
348
+
349
+ $$
350
+ ( \forall i = 1 , . . . , N , \operatorname* { l i m } _ { | D | \infty } C _ { i } ^ { D } = C _ { i } ) \Rightarrow ( \operatorname* { l i m } _ { | D | \infty } F ( C _ { D } ) = F ( C ) )
351
+ $$
352
+
353
+ which implies that
354
+
355
+ $$
356
+ \bigcap _ { i = 1 } ^ { N } E _ { i } \subset E
357
+ $$
358
+
359
+ Taking complement on both sides, we have
360
+
361
+ $$
362
+ E ^ { c } \subset \left( \bigcap _ { i = 1 } ^ { N } E _ { i } \right) ^ { c } = \bigcup _ { i = 1 } ^ { N } E _ { i } ^ { c }
363
+ $$
364
+
365
+ By the monotonicity of probability measure and the union bound,
366
+
367
+ $$
368
+ \mathbb { P } ( E ^ { c } ) \leq \mathbb { P } \left( \bigcup _ { i = 1 } ^ { N } E _ { i } ^ { c } \right) \leq \sum _ { i = 1 } ^ { N } \mathbb { P } ( E _ { i } ^ { c } ) = \sum _ { i = 1 } ^ { N } 1 - \mathbb { P } ( E _ { i } ) = \sum _ { i = 1 } ^ { N } 1 - 1 = 0
369
+ $$
370
+
371
+ Consequently,
372
+
373
+ $$
374
+ \mathbb { P } ( \operatorname* { l i m } _ { | D | \infty } F ( C _ { D } ) = F ( C ) ) = \mathbb { P } ( E ) = 1 - \mathbb { P } ( E ^ { c } ) = 1 - 0 = 1
375
+ $$
376
+
377
+ Theorem 2. If $F$ is a well behaved performance metric, then $\nabla _ { \theta } F ( \hat { C } _ { B } ( h _ { \theta } ) )$ is a strongly consistent estimator of $\check { \nabla } _ { \theta } F ( \bar { C } ( h _ { \theta } ) )$ , where $B \subset D$ is a mini-batch. More precisely,
378
+
379
+ $$
380
+ \mathbb { P } ( \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } F ( \hat { C } _ { B } ( h _ { \theta } ) ) = \nabla _ { \theta } F ( \bar { C } ( h _ { \theta } ) ) ) = 1
381
+ $$
382
+
383
+ Proof. Let $N = | \mathcal { V } | \times | \mathcal { V } |$ . As in the proof of Theorem 1, instead of treating $\hat { C } _ { B } ( h _ { \theta } )$ and $\bar { C } ( h _ { \theta } )$ as $| y | \times | y |$ matrices, we treat them as $N$ -dimensional vectors $\hat { C } _ { B } = ( \hat { C } _ { 1 } ^ { B } , . . . , \hat { C } _ { N } ^ { B } )$ and $\bar { C } =$
384
+
385
+ $( \bar { C } _ { 1 } , . . . , \bar { C } _ { N } )$ , where we omit the dependence on $h _ { \theta }$ for brevity. For $i = 1 , . . . , N$ , let $E _ { i }$ be the event that
386
+
387
+ $$
388
+ \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } \hat { C } _ { i } ^ { B } = \nabla _ { \theta } \bar { C } _ { i }
389
+ $$
390
+
391
+ and $E$ denote the event that
392
+
393
+ $$
394
+ \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } F ( \hat { C } _ { B } ) = \nabla _ { \theta } F ( \bar { C } )
395
+ $$
396
+
397
+ Because $\nabla _ { \boldsymbol { \theta } } F ( \hat { C } _ { i } ^ { B } )$ is an unbiased estimator of $\nabla _ { \boldsymbol { \theta } } F ( \bar { C } _ { i } )$ , i.e. $\mathbb { E } [ \nabla _ { \theta } F ( \hat { C } _ { i } ^ { B } ) ] = \nabla _ { \theta } F ( \bar { C } _ { i } )$
398
+
399
+ $$
400
+ \mathbb { P } ( E _ { i } ) = \mathbb { P } ( \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } F ( \hat { C } _ { i } ^ { B } ) = \nabla _ { \theta } F ( \bar { C } _ { i } ) ) = 1
401
+ $$
402
+
403
+ by the law of large number. Consequently, suppose
404
+
405
+ $$
406
+ \bigcap _ { i = 1 } ^ { N } E _ { i } \subset E
407
+ $$
408
+
409
+ which is equivalent to the proposition that
410
+
411
+ $$
412
+ ( \forall i = 1 , . . . , N , \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } \hat { C } _ { i } ^ { B } = \nabla _ { \theta } \bar { C } _ { i } ) \Rightarrow ( \operatorname* { l i m } _ { | B | \infty } \nabla _ { \theta } F ( \hat { C } _ { B } ) = \nabla _ { \theta } F ( \bar { C } ) )
413
+ $$
414
+
415
+ then this theorem will follow from a union bound argument similar to that in the proof of theorem 1. We now prove this proposition. Let ${ \hat { J } } _ { B } $ and $\bar { J }$ be the Jacobian of $\hat { C } _ { B }$ and $\bar { C }$ w.r.t. $\theta$ , i.e.
416
+
417
+ $$
418
+ \hat { \pmb { J } } _ { B } = \left[ \begin{array} { c } { \nabla _ { \theta } \hat { C } _ { 1 } ^ { B } } \\ { \cdots } \\ { \nabla _ { \theta } \hat { C } _ { N } ^ { B } } \end{array} \right] \qquad \bar { \pmb { J } } = \left[ \begin{array} { c } { \nabla _ { \theta } \bar { C } _ { 1 } } \\ { \cdots } \\ { \nabla _ { \theta } \bar { C } _ { N } } \end{array} \right]
419
+ $$
420
+
421
+ By the chain rule,
422
+
423
+ $$
424
+ \nabla _ { \boldsymbol { \theta } } F \left( \hat { C } _ { B } \right) = \nabla F \left( \hat { C } _ { B } \right) \hat { J } _ { B }
425
+ $$
426
+
427
+ where $\nabla F \left( { \hat { C } } _ { B } \right)$ is the gradient of $F$ at $\hat { C } _ { B }$ . Because $F$ is continuously differentiable, i.e. $\nabla F$ exists and is continuous,
428
+
429
+ $$
430
+ ( \forall i = 1 , . . . , N , \operatorname* { l i m } _ { | B | \infty } \hat { C } _ { i } ^ { B } = \bar { C } _ { i } ) \Rightarrow ( \operatorname* { l i m } _ { | B | \infty } \nabla F ( \hat { C } _ { B } ) = \nabla F ( \bar { C } ) )
431
+ $$
432
+
433
+ Thus for all $\delta > 0$ , there exists $N _ { F , \delta }$ such that when $| B | > N _ { F }$ ,
434
+
435
+ $$
436
+ | \epsilon | : = \left| \nabla F \left( \hat { C } _ { B } \right) - \nabla F \left( \bar { C } \right) \right| < \frac { \delta } { 2 | | \bar { \boldsymbol J } | | }
437
+ $$
438
+
439
+ where $| | \bar { J } | |$ is the matrix norm of $\bar { J }$ , defined as
440
+
441
+ $$
442
+ | | \bar { J } | | = \operatorname* { s u p } _ { | { \pmb x } | \leq 1 } | \bar { J } { \pmb x } |
443
+ $$
444
+
445
+ Thus
446
+
447
+ $$
448
+ ( \forall i = 1 , . . . , N , \operatorname* { l i m } _ { | D | \infty } \nabla _ { \theta } \hat { C } _ { i } ^ { B } = \nabla _ { \theta } \bar { C } ) \Rightarrow ( \operatorname* { l i m } _ { | B | \infty } \hat { J } _ { B } = \bar { J } )
449
+ $$
450
+
451
+ where the convergence is in the Frobenius norm. Because convergence in the Frobenius norm is equivalent to convergence in matrix norm, for all $\delta > 0$ , there exists $N _ { \hat { J } }$ such that when $| D | > N _ { \hat { J } }$ ,
452
+
453
+ $$
454
+ | | \mathcal { E } | | : = \Big | \big | J _ { D } ( \theta ) - J ( \theta ) \big | \Big | < \frac { \delta } { 2 M }
455
+ $$
456
+
457
+ where
458
+
459
+ $$
460
+ M : = \operatorname* { s u p } _ { \pmb { x } \in K } \nabla F ( \pmb { x } ) < \infty
461
+ $$
462
+
463
+ because $K$ is compact and $\nabla F$ is continuous on $K$ by definition.
464
+
465
+ Thus for all $B$ such that $\lvert B \rvert > \operatorname* { m a x } \left\{ N _ { F } , N _ { \hat { J } } \right\}$ ,
466
+
467
+ $$
468
+ \begin{array} { r l } { \nabla _ { \theta } F ( \hat { C } _ { \theta } ) - \nabla _ { \theta } F ^ { \prime } ( \widetilde { C } ) \Big | = | \nabla F ^ { \prime } ( \hat { C } _ { \theta } ) \hat { J } _ { \theta } - \nabla F ^ { \prime } ( \widetilde { C } ) | } \\ & { = | ( \nabla F ^ { \prime } ( \overline { { C } } ) + \epsilon ) ( \bar { J } + \epsilon ) - \nabla F ^ { \prime } ( \widetilde { C } ) | } \\ & { = | ( \nabla F ^ { \prime } ( \overline { { C } } ) \hat { J } + \nabla F ^ { \prime } ( \overline { { C } } ) \hat { J } + \epsilon \bar { J } + \epsilon \bar { C } - \nabla F ^ { \prime } ( \overline { { C } } ) \hat { J } | } \\ & { = | \nabla F ( \overline { { C } } ) \hat { C } + \epsilon \bar { C } + \epsilon \bar { C } - \nabla F ( \overline { { C } } ) \hat { J } | } \\ & { \leq | \nabla F ( \overline { { C } } ) \hat { C } + | \epsilon \bar { C } | + | \epsilon \bar { C } - \nabla F ( \overline { { C } } ) \hat { J } | } \\ & { \lesssim | \nabla F ( \mathcal { C } ) \hat { S } | + | \epsilon \bar { J } | + | \epsilon \bar { C } | } \\ & { \lesssim | \nabla F ( \mathcal { C } ) \hat { C } + | \epsilon \bar { J } | } \\ & { \leq | \nabla F ( \mathcal { C } ) | | \epsilon | + | \epsilon | | J | | } \\ & { \leq \frac { \hat { \epsilon } } { 2 } + \frac { \hat { \epsilon } } { 2 } } \end{array}
469
+ $$
470
+
471
+ where we ignore the high-order term $| \epsilon \mathcal { E } |$ . Consequently,
472
+
473
+ $$
474
+ \operatorname* { l i m } _ { | D | \infty } \nabla _ { \theta } F ( \hat { C } _ { B } ) = \nabla _ { \theta } F ( \bar { C } )
475
+ $$
476
+
477
+ Theorem 3 (Generalization). For a well behaved performance metric $F$ , for all $\epsilon > 0$
478
+
479
+ $$
480
+ \operatorname* { l i m } _ { | D | \to \infty } \mathbb { P } \left( \left| F ( \hat { C } _ { D } ( h _ { \theta } ) ) - F ( \bar { C } ( h _ { \theta } ) ) \right| < \epsilon \right) = 1
481
+ $$
482
+
483
+ Proof. By Theorem 1,
484
+
485
+ which implies that
486
+
487
+ $$
488
+ \begin{array} { r l } & { \mathbb { P } ( \underset { | D | \infty } { \operatorname* { l i m } } \Big | F ( \hat { C } _ { D } ( h _ { \theta } ) ) - F ( \bar { C } ( h _ { \theta } ) ) \Big | < \epsilon ) = 1 } \\ & { \underset { | D | \infty } { \operatorname* { l i m } } \mathbb { P } ( \Big | F ( \hat { C } _ { D } ( h _ { \theta } ) ) - F ( \bar { C } ( h _ { \theta } ) ) \Big | < \epsilon ) = 1 } \end{array}
489
+ $$
490
+
491
+ Theorem 4 (Consistency). For a well behaved performance metric $F$ , with appropriate constraints on the capacity of parametric model $p _ { \theta }$ (see the proof for details), we have that for all $\epsilon > 0$ ,
492
+
493
+ $$
494
+ \operatorname* { l i m } _ { | D | \to \infty } \mathbb { P } \left( \left| \arg \operatorname* { m a x } _ { \theta } F \left( \hat { C } _ { D } ( h _ { \theta } ) \right) - \arg \operatorname* { m a x } _ { \theta } F \left( \bar { C } ( h _ { \theta } ) \right) \right| < \epsilon \right) = 1
495
+ $$
496
+
497
+ i.e. Algorithm 2 is consistent.
498
+
499
+ Proof. To prove consistency, it suffices to prove that (Vapnik (1992)):
500
+
501
+ $$
502
+ \operatorname* { l i m } _ { | D | \to \infty } \mathbb { P } \left( \operatorname* { s u p } _ { \theta } \left| F \left( { \hat { C } } _ { D } ( h _ { \theta } ) \right) - F \left( { \bar { C } } ( h _ { \theta } ) \right) \right| < \epsilon \right) = 1
503
+ $$
504
+
505
+ Because $F$ is well behaved, by the union bound argument in previous proofs, it suffices to show that
506
+
507
+ $$
508
+ \operatorname* { l i m } _ { | D | \infty } \mathbb { P } ( \operatorname* { s u p } _ { \theta } | ( \hat { C } _ { D } ( h _ { \theta } ) ) _ { i j } - \bar { C } _ { i j } ( h _ { \theta } ) | < \epsilon ) = 1 \qquad 1 \leq i , j \leq | \mathcal { X } |
509
+ $$
510
+
511
+ Because $\begin{array} { r } { ( \hat { C } _ { D } ( h _ { \theta } ) ) _ { i j } = \frac { p _ { j } } { n _ { j } } \sum _ { k = 1 } ^ { n _ { j } } p _ { \theta } ( i | \pmb { x } _ { k } ^ { j } ) } \end{array}$ , it suffices to show that
512
+
513
+ $$
514
+ \operatorname* { l i m } _ { | D | \infty } \mathbb { P } ( \operatorname* { s u p } _ { \theta } | \frac { p _ { j } } { n _ { j } } \sum _ { k = 1 } ^ { n _ { j } } p _ { \theta } ( i | x _ { k } ^ { j } ) - \bar { C } _ { i j } ( h _ { \theta } ) | < \epsilon ) = 1 \qquad 1 \leq i , j \leq | \mathcal { X } |
515
+ $$
516
+
517
+ which holds for $p _ { \theta }$ with finite VC-dimension by Lemma 29.1 in Devroye (2010) because
518
+
519
+ $$
520
+ \mathbb { E } _ { D } \left[ \frac { p _ { j } } { n _ { j } } \sum _ { k = 1 } ^ { n _ { j } } p _ { \theta } ( i | \pmb { x } _ { k } ^ { j } ) \right] = \bar { C } _ { i j } \left( h _ { \theta } \right)
521
+ $$
522
+
523
+ # WELL BEHAVED PERFORMANCE METRICS
524
+
525
+ The following is a non-exhaustive list of non-decomposable and non-differentiable, yet wellbehaved performance metrics in the setting of binary classification. They can be extended to the setting of multi-class classification in the same way that the $F$ -measure is extended to multi-class classification in Section 3.
526
+
527
+ $$
528
+ { \begin{array} { r l } & { \bullet \operatorname { A U C } = { \frac { \mathrm { f p } \cdot \mathrm { f n } } { ( \mathrm { i p } + \mathrm { f n } ) ( \mathrm { f p } + \mathrm { f n } ) } } } \\ & { \bullet F _ { \beta } = ( 1 + \beta ^ { 2 } ) \cdot { \frac { p ^ { + } - \mathrm { f n } } { ( 1 + \beta ^ { 2 } ) p ^ { + } - \mathrm { f n } + \mathrm { f p } } } } \\ & { \bullet \operatorname { G - M e a n } = { \sqrt { \mathrm { t p } \cdot \mathrm { t n } } } } \\ & { \bullet \operatorname { J a c c a r d } = { \frac { \mathrm { t p } } { \mathrm { t p } + \mathrm { f p } + \mathrm { f n } } } } \\ & { \bullet \operatorname { Q - M e a n } = 1 - { \sqrt { \frac { ( 1 - \mathrm { t p } ) ^ { 2 } + ( 1 - \mathrm { t n } ) ^ { 2 } } { 2 } } } } \end{array} }
529
+ $$
530
+
531
+ We refer interested readers to Choi et al. (2010) for a more exahustive list of these performance metrics.
parse/train/H1zxjsCqKQ/H1zxjsCqKQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1zxjsCqKQ/H1zxjsCqKQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1zxjsCqKQ/H1zxjsCqKQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/Iz3zU3M316D/Iz3zU3M316D.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/Iz3zU3M316D/Iz3zU3M316D_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/QIRlze3I6hX/QIRlze3I6hX.md ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LEARNING CROSS-DOMAIN CORRESPONDENCE FOR CONTROL WITH DYNAMICS CYCLE-CONSISTENCY
2
+
3
+ Qiang Zhang Shanghai Jiao Tong University zhangqiang2016@sjtu.edu.cn
4
+
5
+ Tete Xiao
6
+ UC Berkeley
7
+ txiao@eecs.berkeley.edu
8
+ Alexei A. Efros
9
+ UC Berkeley
10
+ efros@eecs.berkeley.edu
11
+
12
+ Lerrel Pinto New York University lerrel@cs.nyu.edu
13
+
14
+ Xiaolong Wang UC San Diego xiw012@ucsd.edu
15
+
16
+ # ABSTRACT
17
+
18
+ At the heart of many robotics problems is the challenge of learning correspondences across domains. For instance, imitation learning requires obtaining correspondence between humans and robots; sim-to-real requires correspondence between physics simulators and the real world; transfer learning requires correspondences between different robotics environments. This paper aims to learn correspondence across domains differing in representation (vision vs. internal state), physics parameters (mass and friction), and morphology (number of limbs). Importantly, correspondences are learned using unpaired and randomly collected data from the two domains. We propose dynamics cycles that align dynamic robot behavior across two domains using a cycle-consistency constraint. Once this correspondence is found, we can directly transfer the policy trained on one domain to the other, without needing any additional fine-tuning on the second domain. We perform experiments across a variety of problem domains, both in simulation and on real robot. Our framework is able to align uncalibrated monocular video of a real robot arm to dynamic state-action trajectories of a simulated arm without paired data. Video demonstrations of our results are available at: https://sjtuzq.github.io/cycle_dynamics.html.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ Humans have a remarkable ability to learn motor skills by mimicking behaviors of agents that look and act very differently from them. For example, developmental psychologists has shown that 18-month-old children are able to infer the intentions and imitate behaviors of adults (Meltzoff, 1995). Imitation is not easy: children likely need to infer correspondences between their observations and their internal representations, which effectively aligns the two domains. Learning such a cross-domain correspondence is particularly valuable for robotics and control. For example, in imitation learning, if we want robots to imitate the motor skills of humans (or robots with different morphologies), we need to find the correspondence in both visual observations and morphology dynamics. Similarly, when transferring a policy trained in simulation to a real robot, we, again, need to align visual inputs and physics parameters across different environments.
23
+
24
+ To align the skills across different domains, several prior approaches have proposed learning invariant feature representations across the domains (Gupta et al., 2017; Sermanet et al., 2018). Policies or visual representations are trained to be invariant to the changes which are irrelevant to the downstream task, while maintaining useful information for cross-domain alignment. However, these methods require paired and aligned trajectories, usually collected by pre-trained policies or human labeling, which is often too expensive to collect for real-world learning problems. Additionally, invariance is a rather strong constraint, and might not be universally suitable. The reason is that different invariances might be beneficial for different downstream tasks, which has been recently studied in self-supervised visual representation learning (Tian et al., 2020).
25
+
26
+ ![](images/633ba4debb9b4bc5474f43154ebff1f1faebddd7101f677785c547c69af0f7ca.jpg)
27
+ Figure 1: We propose to learn observation correspondence (blue arrow) and action correspondence (red arrow) across domains using Dynamics Cycle-Consistency. Our applications include: (a) Aligning real robot images with simulation states; (b) Aligning actions between environments with different physics parameters (We use different rendering to indicate that the physics are different); (c) Aligning both actions and observations between agents at the same time with different morphology.
28
+
29
+ Instead of learning invariances, an emerging line of research focuses on finding correspondences by learning to translate between two different domains with unpaired data (Zhu et al., 2017; Bansal et al., 2018). While this translation technique has shown encouraging results in imitation learning (Smith et al., 2019) and sim-to-real transfer (Hoffman et al., 2017; James et al., 2019), it is limited to finding correspondences only in the visual observation space. However, in real-world applications, besides visual observations, the physics parameters and morphology dynamics between two domains are also often misaligned. Hence, solely learning with passive visual correspondences, one is unable to reason about the effects of dynamics. We must go beyond the image space and explicitly incorporate dynamics information to truly extend correspondence learning to aligning behaviors.
30
+
31
+ In this paper, we take the first steps toward learning correspondences which can align behaviors on a range of domains including different modalities (vision vs. agent state), different physical parameters (friction and mass), and different morphologies. Importantly, we use unpaired and unaligned data from the two domains to learn the correspondences. Specifically, we propose to find observation correspondences and action correspondences at the same time using dynamics cycle-consistency. Our dynamics cycles chain the observations and actions across time and domains together. The consistency in the dynamics cycle indicates consistent translation and prediction results. The input data to our learning algorithm takes the form of 3-element tuples from both domains: current state, action and the next state. Figure 1(a) exemplifies our model, which is a 4-cycle chain containing the observations of one domain $\left( \mathbf { x } _ { t } , \mathbf { x } _ { t + 1 } \right)$ (real robot in Figure 1(a)) at two time steps, and another domain $\left( \mathbf { y } _ { t } , \mathbf { y } _ { t + 1 } \right)$ (simulation in Figure 1(a)). To form a cycle, we learn a domain translator $G : \mathbf x _ { t } \mapsto \mathbf y _ { t }$ to translate images to states and a predictive forward dynamics model in state space $F : { \bf y } _ { t } \times { \bf u } _ { t } \mapsto { \bf y } _ { t + 1 }$ where $\mathbf { u } _ { t }$ represents the action taken at time $t$ , and $\mathbf { a } _ { t }$ is the corresponding action in the real robot domain. The forward model in the real robot domain is not necessary in our framework. The training signal is: given observations in time $t$ , the future prediction in time $t + 1$ should be consistent under the consistent action taken across two domains, namely dynamics cycle-consistency.
32
+
33
+ We explore applications both in simulation and with a real robot. In simulation, we adopt multiple tasks in the MuJoCo (Todorov et al., 2012) physics engine, and show that our model can find correspondence and align two domains across different modalities, physical parameters (Figure 1(b)), and morphologies (Figure 1(c)). Given the alignment, we can transfer a reinforcement learning (RL) policy trained in one domain directly to another domain without further optimizing the RL objective. For our real robot experiments, we use the xArm Robot (Figure 1(a)). Given only uncalibrated monocular videos of the xArm performing random actions, our method learns correspondences between the real robot and simulated robot without any paired data. At test time, given a video of the robot arm executing a smooth trajectory, we can generate the same trajectory in simulation.
34
+
35
+ # 2 RELATED WORK
36
+
37
+ Learning invariant representations. To find cross-domain alignment, researchers have proposed to learn representations which are invariant to the changes unrelated to the downstream task (Tobin et al., 2017; Peng et al., 2018; Gupta et al., 2017; Sermanet et al., 2018; Liu et al., 2017b; Pinto et al.,
38
+
39
+ 2017; Sadeghi & Levine, 2016; Yan et al., 2020; Chen et al., 2020; Andrychowicz et al., 2018). For example, domain randomization (Tobin et al., 2017; Sadeghi & Levine, 2016; Andrychowicz et al., 2018; Ramos et al., 2019; Zakharov et al., 2019; Wu et al., 2019) aligns the simulated and real world for policy transfer. However, it assumes that differences between two domains can be covered by hand-crafted augmentations, which may not hold when the domain changes happen to lie outside of these assumptions. To align two domains where the dynamics are different, Gupta et al. (2017) propose to learn invariant features with pairs of states from two domains. However, paired data is hard to collect, and the method is limited to state space, while real-world observations are often based on images (Taylor & Stone, 2009).
40
+
41
+ Learning translation. Instead of learning invariance, our method is related to works which learn the mapping across two domains for alignment (Taylor et al., 2007; Ammar et al., 2015; Tzeng et al., 2015; Joshi & Chowdhary, 2018; Kim et al., 2019; Smith et al., 2019). For example, Tzeng et al. (2015) design an approach to weakly align pairs of images in the source and target domains. Given the paired images, they can perform adaption from simulation to real robot. However, this work has only focused on translation between visual observations. Going beyond visual adaptation, Ammar et al. (2015) utilize unsupervised manifold alignment to find correspondence between states across domains from demonstrations. However, this method uses hand designed features, which restricts its generalization ability. Kim et al. (2019) propose imitation learning with unpaired and unaligned demonstrations. While with less constraint, it requires a trained RL policy to collect demonstrations in both domains for training, and RL is involved in the correspondence learning process. This leads to learning correspondence only relevant to a specific task. In contrast, most of our experiments assume that we do not know the downstream task and we do not have access to the rewards for RL. Hence, it is a more general problem setting and can be used for a variety of applications. Our method can learn correspondence between simulated and real robot through unpaired and randomly collected trajectories.
42
+
43
+ In transfer learning, several works have looked at architectural novelties to improve transfer across RL problems (Parisotto et al., 2015; Pinto et al., 2016; Rusu et al., 2016a; Barreto et al., 2017; Omidshafiei et al., 2017; Rusu et al., 2016b). Our method of using cycle consistency pursues an orthogonal direction of architecture design and is compatible with these approaches.
44
+
45
+ Cycle-Consistency. Our work is inspired by literature on cycle-consistency (Zhou et al., 2016; Zhu et al., 2017; Liu et al., 2017a; Hoffman et al., 2017; Bansal et al., 2018; Bousmalis et al., 2018; James et al., 2019). For example, CycleGAN (Zhu et al., 2017) uses cycle-consistency loss with the Generative Adversarial Networks (Goodfellow et al., 2014) for unpaired image-to-image translation, which is subsequently extended for videos (Bansal et al., 2018) and domain adaptation (Hoffman et al., 2017). Similar techniques are applied in sim-to-real transfer by training a image translation model between simulation and real-world images (Stein & Roy, 2018) or aligning both the simulation and real images to the same canonical space (James et al., 2019). Recently, Rao et al. (2020) propose RL-CycleGAN to perform sim2real image translations by adding an extra supervision signal from the Q function. However, all these works are restricted to visual alignments, while ours can align agents cross different dynamics and structures.
46
+
47
+ # 3 LEARN CORRESPONDENCE USING DYNAMICS CYCLE-CONSISTENCY
48
+
49
+ Problem setup. We aim to learn correspondence across various domains, i.e., input modalities, physics parameters, and morphology. We formulate the trajectories of domain $X$ and $Y$ as $\tau _ { X } \doteq$ $\left( \mathbf { x } _ { t } , \mathbf { a } _ { t } , \mathbf { x } _ { t + 1 } \right)$ and $\boldsymbol { \tau } _ { Y } \doteq \left( \mathbf { y } _ { t } , \mathbf { u } _ { t } , \mathbf { y } _ { t + 1 } \right)$ , where $\mathbf { x } \in \mathcal { R } ^ { n _ { 1 } }$ and $\mathbf { y } \in \mathcal { R } ^ { n _ { 2 } }$ are observation representations in domain $X$ and $Y$ , $\mathbf { a } \in \mathcal { R } ^ { m _ { 1 } }$ and $\mathbf { u } \in \mathcal { R } ^ { m _ { 2 } }$ are action representations in domain $X$ and $Y$ , and $t$ is time step. Without loss of generality, we assume to learn correspondence from domain $X$ to domain $Y$ . 1 Suppose that we have observation alignment functions $G : X \mapsto Y$ , and action alignment function $\boldsymbol { H } : \boldsymbol { X } \times \boldsymbol { A } \mapsto \boldsymbol { U }$ and its inverse counterpart $H ^ { - 1 }$ as a function $P : Y { \times } U \mapsto A$ . We define two types of correspondence as follows.
50
+
51
+ Observation Correspondence, i.e., what the representation of one observation in domain $X$ should correspond to if it is in domain $Y$ , and vice versa. For example, if $X$ is visual sensing of an agent while $Y$ is the state (e.g., joint angle) of the same agent, $G$ functions as a state estimator. If $X$ is the state of one agent while $Y$ is the state of a structurally different agent, such as a Sawyer arm and a UR5 arm, $G$ aligns the states at a same stage towards a common goal (e.g., robot joint positions). We denote two correspondent observations between $X$ and $Y$ as $\mathbf x \Leftrightarrow \mathbf y$ .
52
+
53
+ ![](images/d97b37ac7b95ddb5357086f32dd467514796d502c794e03ead8609e0ceed3330.jpg)
54
+ Figure 2: Model framework: (a) Model for only cross-physics alignment; (b) Model for only cross-modality alignment; (c) Joint model for cross-modality-and-physics alignment. Red arrows indicate correspondences between actions and blue arrows indicate correspondence between observations.
55
+
56
+ Action Correspondence, i.e., with correspondent initial observations which actions to execute so that the next observations in two domains remain correspondent. For example, if $X$ and $Y$ are two environments with different physics parameters, with the initial observations $\mathbf { x } _ { t }$ , $\mathbf { y } _ { t }$ and $\mathbf { x _ { t } } \nleftrightarrow \mathbf { y _ { t } }$ , after action $\mathbf { a } _ { t }$ is executed in domain $X$ and leads to the next observation $\mathbf { x } _ { t + 1 }$ , alignment function $H$ should find the action $\mathbf { u } _ { t }$ which leads to next observation $\mathbf { y } _ { t + 1 }$ in domain $Y$ where $\mathbf x _ { t + 1 } \Leftrightarrow \mathbf y _ { t + 1 }$ , and vice versa for $H ^ { - 1 }$ . We denote two correspondent actions from $X$ and $Y$ as $( \mathbf { x } _ { t } , \mathbf { a } _ { t } ) \Leftrightarrow ( \mathbf { y } _ { t } , \mathbf { u } _ { t } )$
57
+
58
+ Learning observation correspondence and action correspondence enables estimating states from visual input, adapting to environments with different physics, and being able to function even when the structure of the agent changes.
59
+
60
+ Method. We begin by simply mapping states across domains by adversarial training. Given unpaired samples $\{ { \bf x } _ { i } \} \in X$ , and $\{ \mathbf { y } _ { i } \} \in \breve { Y }$ , a mapping function $G$ can be learned with a discriminator $D _ { Y } ^ { - }$ with the adversarial objective, where $G$ tries to map $\mathbf { x }$ onto the distribution of $\mathbf { y }$ , while $D _ { Y }$ tries to distinguish translated samples $G ( \mathbf { x } )$ against real samples y:
61
+
62
+ $$
63
+ \underset { G } { \mathrm { m i n } } \underset { D _ { Y } } { \mathrm { m a x } } \mathcal { L } _ { \mathrm { a d v } } \left( G , D _ { Y } \right) = \mathbb { E } _ { { \mathbf { y } } \sim p ( { \mathbf { y } } ) } \left[ \log D _ { Y } ( { \mathbf { y } } ) \right] + \mathbb { E } _ { { \mathbf { x } } \sim p ( { \mathbf { x } } ) } \left[ \log \left( 1 - D _ { Y } ( G ( { \mathbf { x } } ) ) \right) \right]
64
+ $$
65
+
66
+ The adversarial objective reaches global optimal when the mapping function $G$ can perfectly ground the translated samples onto the distribution defined by $\{ \mathrm { y } _ { i } \}$ .
67
+
68
+ We learn an action mapping function $\boldsymbol { H } : \boldsymbol { X } \times \boldsymbol { A } \mapsto \boldsymbol { U }$ which maps actions from domain $X$ to domain $Y$ , and model its inverse counterpart $H ^ { - 1 }$ as a function $P : Y { \times } U \mapsto A$ with separate parameters. Besides using two adversarial losses with discriminators $D _ { U }$ in $Y$ and $D _ { A }$ in $X$ , i.e., $\mathcal { L } _ { \mathrm { a d v } } ^ { \mathrm { ~ \tiny ~ { ~ \cdot ~ } ~ } } ( H , D _ { U } )$ and $\mathcal { L } _ { \mathrm { a d v } } ( P , \mathbf { \bar { \jmath } } _ { D _ { A } } )$ , we add cross-domain cycle consistency loss (Zhu et al., 2017) into the objective:
69
+
70
+ $$
71
+ \operatorname* { m i n } _ { H , P } \mathcal { L } _ { \mathrm { d o m . c y c } } \left( H , P \right) = \mathbb { E } _ { \mathbf { a } \sim p ( \mathbf { a } ) } \left[ \left| \left| P ( \mathbf { y } , H ( \mathbf { x } , \mathbf { a } ) ) - \mathbf { a } \right| \right| _ { 1 } \right] ,
72
+ $$
73
+
74
+ which implies that the translated action should be able to be translated back: $P ( \mathbf { y } , H ( \mathbf { x } , \mathbf { a } ) ) \approx \mathbf { a }$
75
+
76
+ Nevertheless, the structure of learnt mapping by adversarial training is loosely constrained. Vanilla adversarial training may map all samples $X$ to a few samples of $Y$ , which still minimizes the adversarial objective. Adding domain cycle consistency loss does not solve the problem fundamentally: for example, given two correspondent but unpaired observations, i.e., $\mathbf { x } _ { t } , \mathbf { y } _ { t }$ and $\mathbf x _ { t + 1 } , \mathbf y _ { t + 1 }$ , $G$ can map $\mathbf { x } _ { t }$ to $\mathbf { y } _ { t + 1 }$ and $G ^ { - 1 }$ can still map $\mathbf { y } _ { t + 1 }$ back to $\mathbf { x } _ { t }$ , which does not violate domain cycle-consistency.
77
+
78
+ Beyond only relying domain cycle consistency, we exploit the transition dynamics of two domains, termed as dynamics cycle-consistency. As illustrated in Figure 2(c), we map the observation-action pair at time step $t \ \mathbf { x } _ { t }$ and $\mathbf { a } _ { t }$ from domain $X$ to $Y$ using $G$ and $H$ , then execute the translated observation and action $\tilde { \mathbf { y } } _ { t }$ and $\tilde { \mathbf { u } } _ { t }$ ) in domain $Y$ by its transition dynamics $T _ { Y } : Y { \times } U \mapsto Y$ to get the next observation, which is expected to be correspondent to the next observation from domain $\breve { X }$ , i.e., $T _ { Y } ( \tilde { \mathbf { y } } _ { t } , \tilde { \mathbf { u } } _ { t } ) \Leftrightarrow \mathbf { x } _ { t + 1 }$ . According to the definition of observation correspondence, $T _ { Y } ( \tilde { \mathbf { y } } _ { t } , \tilde { \mathbf { u } } _ { t } )$ should be the same as $G ( \mathbf { x } _ { t + 1 } )$ , as expressed in the objective:
79
+
80
+ $$
81
+ \operatorname* { m i n } _ { G , H } \mathcal { L } ( G , H ) _ { \mathrm { d y n . c y c } } = \mathbb { E } _ { ( \mathbf { x } _ { t } , \mathbf { a } _ { t } , \mathbf { x } _ { t + 1 } ) \sim p ( \tau _ { X } ) } \left[ \left| \left| G ( \mathbf { x } _ { t + 1 } ) - T _ { Y } ( G ( \mathbf { x } _ { t } ) , H ( \mathbf { x } _ { t } , \mathbf { a } _ { t } ) ) \right| \right| _ { 1 } \right] .
82
+ $$
83
+
84
+ One obstacle remains. The transition dynamics $T _ { Y }$ in Equation 3 is in fact the physical property of a simulator or the real world, hence it is not differentiable for back-propagation. In consequence, we train a forward model which takes an observation-action pair as input and predicts the next observation to approximate the dynamics of the environment. Since we have access to trajectories from $Y$ , we can directly train the forward model using supervised regression objective:
85
+
86
+ $$
87
+ \operatorname* { m i n } _ { F } \mathcal { L } _ { \mathrm { f o r w a r d } } ( F ) = \mathbb { E } _ { ( \mathbf { y } _ { t } , \mathbf { u } _ { t } , \mathbf { y } _ { t + 1 } ) \sim p ( \tau _ { Y } ) } \left[ \left| \left| \mathbf { y } _ { t + 1 } - F ( \mathbf { y } _ { t } , \mathbf { u } _ { t } ) \right| \right| _ { 1 } \right]
88
+ $$
89
+
90
+ Note that forward model $F$ is first pre-trained and it is not optimized together with the dynamics cycle-consistency objective, as otherwise $G$ and $F$ can learn to map everything to zero so that $\Breve { L _ { \mathrm { d y n \_ c y c } } }$ becomes zero, which leads to a trivial solution. Consequently, our full objective is:
91
+
92
+ $$
93
+ { \mathcal { L } } _ { \mathrm { f u l l } } = \lambda _ { 0 } { \mathcal { L } } _ { \mathrm { d y n . c y c } } ( G , H ) + \lambda _ { 1 } \left( { \mathcal { L } } _ { \mathrm { a d v } } ( H , D _ { U } ) + { \mathcal { L } } _ { \mathrm { a d v } } ( P , D _ { A } ) + { \mathcal { L } } _ { \mathrm { d o m . c y c } } ( H , P ) \right) + \lambda _ { 2 } { \mathcal { L } } _ { \mathrm { a d v } } ( G , D _ { Y } )
94
+ $$
95
+
96
+ where $\lambda _ { 0 } , \lambda _ { 1 }$ and $\lambda _ { 2 }$ are constants balancing the losses.
97
+
98
+ Optimization. We collect unpaired trajectories $\tau _ { X }$ and $\tau _ { Y }$ by executing random actions from both domains. Directly optimizing the full objective end-to-end leads to model collapse, as it involves joint optimization with multiple neural networks: $G$ and $H$ can easily discover a “shortcut” solution, where the translated observations and actions are not valid but they can fool the forward model to optimize the dynamics cycle-consistency objective. Since the forward model is only optimized on trajectory data $\tau _ { Y }$ , thus we first pre-train the forward model and fix its parameters throughout the following training procedure. We initialize the action mapping function using an algorithm detailed in the Appendix A.4. We pro
99
+
100
+ # Algorithm 1: Alternatingly Joint Training Algorithm
101
+
102
+ Input: Domain X: $\tau _ { X } = \{ ( \mathbf { x } _ { t } , \mathbf { a } _ { t } , \mathbf { x } _ { t + 1 } ) \}$
103
+ Domain Y: $\boldsymbol { \tau } _ { Y } = \{ ( \mathbf { y } _ { t } , \mathbf { u } _ { t } , \mathbf { y } _ { t + 1 } ) \}$
104
+ $/ /$ Training Forward Model Stage
105
+ train ${ \mathcal { L } } _ { \mathrm { f o r w a r d } } ( F )$ (Eq. 4) to learn transition dynamics
106
+ $T _ { Y }$ in domain Y;
107
+ // Alternatingly Training Stage
108
+ for $i = 1$ to e do reset $\lambda _ { 1 }$ , set $\lambda _ { 2 } = 0$ ; fix weight of $G$ ; for $j = 1$ to $e _ { 1 }$ do using ${ \mathcal { L } } _ { \mathrm { f u l l } }$ (Eq. 5) to train model $H$ and $P$ ; reset $\lambda _ { 2 }$ , set $\lambda _ { 1 } = 0$ ; fix weight of $H$ and $P$ ; for $j = 1$ to $e _ { 2 }$ do using ${ \mathcal { L } } _ { \mathrm { f u l l } }$ (Eq. 5) to train model $G$ ;
109
+ return State alignment model $G$
110
+ Action alignment model $H$ and $P$
111
+
112
+ pose to employ alternating training procedure for the full objective: When we train the observation mapping function $G$ and its auxiliary discriminator $D _ { Y }$ , we fix the action mapping function $H$ and $P$ ; then when the action mapping function $H$ and $P$ with $D _ { U }$ and $D _ { A }$ are trained, we fix the observation mapping function $G$ . Since the action mapping functions are reasonably initialized, at the beginning of training procedure the observation mapping function is optimized. It is grounded on good action mappings, as well as the dynamics of environments by dynamics cycle consistency, thus it is constrained from learning an arbitrary short cut. Subsequently, action mapping functions can be further fine-tuned once we obtain a good observation mapping function (Algorithm 1).
113
+
114
+ Tasks. Our formation of correspondence learning is broad and general, and it enables many applications which typically require intricately designed frameworks or are hard to solve without paired data. Specifically, we study the following three tasks:
115
+
116
+ The first task is cross-physics alignment, where domain $X$ and domain $Y$ are two environments with different physics parameters but same input modality. As shown in Figure 2(a), same input modality indicates that observation correspondence always holds, i.e., $\mathbf { x } _ { t } \equiv \mathbf { y } _ { t }$ ; different physics parameter indicates that executing a same action at the same initial observation in separate environments results in different next observation. After learning correspondences, assuming we have a policy in domain $Y$ , we can transfer it to domain $X$ by mapping the predicted action of the policy u from domain $Y$ to $X$ with action mapping function $P$ . The translated action a˜ can then be executed in domain $X$ .
117
+
118
+ The second task is cross-modality alignment, where domain $X$ and domain $Y$ are different sensing (observation) modality of the same agent, which implies that action correspondence between two domains always hold (see Figure $2 ( \mathbf { b } ) _ { \cdot }$ ). In other words, $H$ and $P$ are both identity mapping, and $\mathbf { a } _ { t } \equiv \mathbf { u } _ { t }$ . Thus we can set $\gamma = 0$ in Eq. 5 in training. A predominant choice is $X$ being image while
119
+
120
+ $Y$ being state, where $G$ essentially learns to perform state estimation. Moreover, we can execute a policy which is originally trained on state space in image space, as the input $\mathbf { x } _ { t }$ in image space can be translated by $G$ before fed into the policy based on state space, yielding a predicted action $\mathbf { u } _ { t }$ , which can be directly executed in domain $X$ .
121
+
122
+ Combining the above-discusses two tasks yields the third task, in which cross-physics and crossmodality alignment are realized simultaneously, thanks to our proposed joint alternative training procedure. We refer to it as cross-modality-and-physics alignment, as shown in Figure 2(c). This formulation can be further extended to another task, where domain $X$ and $Y$ are two agents with different morphologies, termed as cross-morphology alignment. For example, domain $X$ can be a three-leg cheetah and domain $Y$ can be a two-leg cheetah. In this case, the representations of $\mathbf { x } \wedge \mathbf { y }$ and $\mathbf { a } / \mathbf { u }$ are fundamentally different, yet intrinsically they share similarities in locomotion.
123
+
124
+ As the correspondence is established between two domains, it can be applied to different downstream applications. Suppose that our goal is to transfer a policy trained in domain $Y$ to $X$ . Inference includes three steps: (i) Given an observation $\mathbf { x } _ { t }$ in domain $X$ , use observation mapping function $G$ to translate $\mathbf { x } _ { t }$ to $\mathbf { y } _ { t }$ ; (ii) Execute the policy in domain $Y$ given $\mathbf { y } _ { t }$ , and obtain the action output $\mathbf { u } _ { t }$ ; (iii) Translate the action $\mathbf { u } _ { t }$ from domain $Y$ back to domain $X$ with the action mapping function $P$ .
125
+
126
+ Implementation Details. The networks $D , F , H , P$ are implemented by MLPs, and network $G$ is a ResNet-18 (He et al., 2016) with a 4-layer MLP head. For the inputs of $G$ , instead of using one static image, we concatenate the current frame and two consecutive past frames together to capture any motion information. We first train the forward dynamics model $F$ for 20 epochs using Adam (Kingma & Ba, 2014) with 0.0001 learning rate. We then train the other networks for 50 epochs with the same learning rate. We set $e _ { 1 }$ and $e _ { 2 }$ to 5000 steps in Algorithm 1. See Appendix B for more details.
127
+
128
+ # 4 SIMULATION EXPERIMENTS
129
+
130
+ We first test the efficiency of our framework and conduct ablation studies in simulation environments. We choose MuJoCo physics simulator as our test bed. We model domain $X$ and $Y$ as two different environments, where input modality, physics parameters, and morphology structures of the agents can vary. We believe that our method can be applied to a lot of environments. However, in this paper we focus on the representative ones including four tasks based on OpenAI Gym (Brockman et al., 2016), i.e., “HalfCheetah”, “FetchReach”, ”Walker” and ”Hopper”, and one task based on DeepMind Control (Tassa et al., 2018), i.e., “FingerSpin”. We perform experiments with different settings including: (i) Cross-physics alignment, where only the physical parameters are different in two domains; (ii) Cross-modality alignment, where only the observation space is different; (iii) Cross-modality-and-physics alignment, a joint task of (i) and (ii); (iv) Cross-morphology alignment, where agent structures in two domains are different. To sample the training data, we randomly collect $5 0 k$ unpaired trajectories in both domain $X$ and domain $Y$ in most settings. The evaluation dataset size is $1 0 k$ . Besides evaluating on the alignment errors, we also benchmark how well the pre-trained RL policies in one domain can be transferred to another domain. To pre-train the policy, we use DDPG (Lillicrap et al., 2015) with HER (Andrychowicz et al., 2017) for “FetchReach” and TD3 algorithm (Fujimoto et al., 2018) for other environments. Note that we do not need to further fine-tune the policy for transferring to a new domain. We report the task success rate for “FetchReach” and task rewards for the other environments. All RL policies are trained with 5 different seeds. More details about our method implementation and the reference policies can be found in the Appendix B.
131
+
132
+ Cross-physics alignment. In order to create environments with different physics parameters, we modify armature and mass in the environments. We use default armature and torso mass parameters in domain $Y$ . To create domain $X$ , we increase the armature for tasks including
133
+
134
+ <table><tr><td>Tasks</td><td></td><td>Oracle,YDirect,Y→X DR,Y→X Ours,Y→X</td><td></td><td></td><td>Oracle,X</td></tr><tr><td>HalfCheetah</td><td>6270±123</td><td>3651±665</td><td>3763±752</td><td>3997±438</td><td>6769±185</td></tr><tr><td>FingerSpin</td><td>804±89</td><td>483±186</td><td>492±284</td><td>562±124</td><td>765±68</td></tr><tr><td>FetchReach†</td><td>100%</td><td>100%</td><td>100%</td><td>100%</td><td>100%</td></tr><tr><td>Walker2d</td><td>875±24</td><td>516±395</td><td>546±258</td><td>667±174</td><td>816±17</td></tr><tr><td>Hopper</td><td>2364±635</td><td>1542±1041</td><td>1683±869</td><td>1919±794</td><td>2640±454</td></tr></table>
135
+
136
+ Table 1: Cross-physics. Results on transferring a policy trained on domain $Y$ to domain $X$ . DR: domain randomization. †: Task successful rate is reported.
137
+
138
+ “HalfCheetah”, “FetchReach”, “FingerSpin”, and modify the torso mass for “Walker” and “Hopper” (see details in Appendix A.1). Different tasks are sensitive for different physical parameters, e.g., while changing armature yields noticeable effect on “HalfCheetah”, changing mass does not. We tackle the hard cases where physical changes matter. In this setting, we obtain the unpaired training data from two domains with a pre-trained policy in domain $Y$ .
139
+
140
+ ![](images/469422993d89eb277a151d72a0aa7cd90b94935e4f7896cc1300eaba1661d601.jpg)
141
+ Figure 3: Ablation study with HalfCheetah. (a) L1 error for different dataset scale; (b) Ablation with discriminators; (c) Combining our method with supervised state estimation (using paired image-state data).
142
+
143
+ Table 2: Evaluation of cross-modality alignment, including L1 error of state estimation, and RL policy performance on the original domain $Y$ and after transferring to domain $X$ . $^ \dagger$ : Task successful rate is reported.
144
+
145
+ <table><tr><td rowspan="2">Tasks</td><td colspan="3">L1 Error↓</td><td colspan="5">RL Score↑</td></tr><tr><td>Random</td><td>Cycle-GAN</td><td>Ours</td><td>Oracle,Y</td><td>Random,X</td><td>Cycle-GAN</td><td>Ours,Y→X</td><td>Oracle, X</td></tr><tr><td>HalfCheetah</td><td>2.18</td><td>2.07</td><td>0.57</td><td>6270±123</td><td>-289±81</td><td>-119±65</td><td>1504±256</td><td>3689±247</td></tr><tr><td>FingerSpin</td><td>1.61</td><td>1.92</td><td>0.23</td><td>804±89</td><td>0±0</td><td>0±0</td><td>341±39</td><td>765±68</td></tr><tr><td>FetchReach†</td><td>0.87</td><td>0.94</td><td>0.05</td><td>100%</td><td>0%</td><td>0%</td><td>92%</td><td>100%</td></tr></table>
146
+
147
+ Results are shown in Table 1. The 1st column (Oracle, $Y$ ) reports the performance of the policy in the original domain $Y$ . Directly testing this policy in environment $X$ results in significant drop in terms of RL scores (2nd column), due to the disparity in physics parameters. We also train a policy with physics domain randomization (DR, 3rd column) for direct transfer (see Appendix A.1 for details). Our method (4th column), which maps actions predicted by RL policy from domain $Y$ to $X$ , demonstrates superior performance across all tasks compared to the direct deployment as well as DR baselines. We provide results of training RL in domain $X$ in the last column (Oracle $X$ ) as an upperbound. We also implement Cycle-GAN, which only learns random projections between actions in two domains, thus we do not report the numbers.
148
+
149
+ Cross-modality alignment. In this setting, we use RGB images as observations in domain $X$ and the internal state of agents as observations in domain $Y$ , while keeping physics parameters the same. $G$ is then essentially a state estimator. We execute random actions without pre-trained policies in both domains to obtain unpaired training trajectories. As even supervised learning for state estimation with the same number of image-state pairs works poorly for “Walker” and “Hopper”, we report the results on “HalfCheetah”, “FetchReach”, “FingerSpin” in this setting. We compute $L 1$ -distance between the predicted states and the ground-truth states from simulator $X$ (although we do not use them for training) as an evaluation metric. We also use RL performance as another metric: we train an RL policy in state space (domain $Y$ ), and test it in image space (domain $X$ ) by executing the predicted action based on estimated states from images.
150
+
151
+ We compare with two baselines: a random projection baseline; a image-state Cycle-GAN baseline, performing unpaired image-state translations without using dynamics (see Appendix C for details). As shown in Table 2, our approach performs significantly better than the Cycle-GAN baseline in both $L 1$ error and the RL scores (the return reward), which shows the importance of incorporating the dynamics into the cycle. Note that even when the ground-truth paired (image, state) samples are provided, this is still difficult since images lie in a high-dimensional space. By exploiting the dynamics cycle-consistency, our method is able to do state estimation for transferring RL policies. We also provide results on directly training policy on the two domains (Oracle, $Y$ and Oracle, $X$ ).
152
+
153
+ We perform ablation studies on different elements in training with the “HalfCheetah” environment: (i) the number of training samples; (ii) the role of the discriminator. We report the results in Figure 3. It can be seen that the L1 error of state estimation reduces as training data for our dynamic cycles increases (a); training with the discriminators improves both L1 error and transferring policies by a large margin , comparing to training without the discriminator (b), as adversarial learning with the discriminator can largely reduce the search space for finding correspondence.
154
+
155
+ We further explore our approach with supervised state estimation: Given paired image-state data, we can train a state estimator with supervised learning. We combine our dynamics cycle-consistency objective with the supervised objective to train the state estimator. As shown in Figure 3(c), We compare the results on the model using dynamics cycle-consistency (“w”) and without the dynamics cycle-consistency (“w/o”). The “L1 error” measured here are on the training states which are randomly collected, the “Task reward” are from running the policy which sees states collected by the policy. We observe improvement on transferring policies with the joint model over the counterpart trained only with the supervised learning objective. In terms of L1 error of state estimation, although using paired data (strong supervision) per se will yield the best model on L1 metric (especially the state estimator in this way is trained via L1 loss. However, overfitting to the L1 loss does not completely transfer to better policy performance on downstream tasks, since the policy can observe novel states that are not in the training set. In our case, adding dynamics objective biases the L1 error by a small margin as the model cannot solely optimize for state estimation error, but it must learn dynamics as well and in turn increases the task performance. Consequently, incorporating the dynamics cycle-consistency can provide extra regularization and improve generalization on test data.
156
+
157
+ Cross-modality-andphysics alignment. Evaluation on two domains with different physics parameters and different input modalities. Following the cross-modality setting,
158
+
159
+ <table><tr><td>Tasks</td><td>Oracle, Y</td><td>Random</td><td></td><td>Cycle-GAN Ours (only M)</td><td>)Ours (Full)</td></tr><tr><td>HalfCheetah</td><td>6270±123</td><td>-248±74</td><td>-226±84</td><td>856±385</td><td>1251±297</td></tr><tr><td>FingerSpin</td><td>804±89</td><td>0±0</td><td>0±0</td><td>243±54</td><td>305±43</td></tr><tr><td>FetchReach†</td><td>100%</td><td>0%</td><td>0%</td><td>92%</td><td>92%</td></tr></table>
160
+
161
+ Table 3: Cross-modality-and-physics. Results on transferring RL policies.
162
+
163
+ we sample our unpaired training data randomly. We report the results of transferring RL policy in Table 3. While this setting is very challenging and the cross-modality Cycle-GAN method fails (3rd column), our method can discover the correspondence from randomly collected unpaired trajectories (last column). We perform ablation by only training to align the observations, without the translator between the actions (4th column). This shows the importance of our joint optimization approach.
164
+
165
+ Cross-morphology alignment. Evaluation on two domains with different morphology. We experiment with two tasks (see Appendix A.3): (i) domain $Y$ with 2-leg HalfCheetah and
166
+
167
+ Table 4: Cross-morphology. Results on transferring RL policies.
168
+
169
+ <table><tr><td>Tasks</td><td>Oracle,Y1</td><td></td><td>Random Cycle-GAN</td><td>INIT</td><td>Ours,Y→X</td></tr><tr><td>Cheetah</td><td>6270±123</td><td>-250±59</td><td>-43±52</td><td>-37±60</td><td>2471±382</td></tr><tr><td>Swimmer</td><td>366±26</td><td>-1±4</td><td>14±5</td><td>-15±3</td><td>204±56</td></tr></table>
170
+
171
+ domain $X$ with 3-leg HalfCheetah; (ii) domain $Y$ with 3-limb Swimmer and domain $X$ with 4-limb Swimmer. In this setting, the unpaired trajectories are also randomly sampled and our model learns to align the observations and actions at the same time. Once the correspondence is found, we can transfer the RL policies from domain $Y$ to $X$ . We compare to two baselines: one is the Cycle-GAN to perform both state-state and action-action translations, the other is using our action repetition initialization strategy before training (INIT, this baseline repeats the actions of the shared joints while uses actions for novel joints from its nearest joint, see Appendix A.4). As shown in Table 4, our approach can still perform reasonably well without finetuning the policy while the baselines completely fail. The reason behind this is that both INIT and Cycle-GAN baseline share the critical flaw: they do not take dynamics information into account. Given unpaired agent states, Cycle-GAN cannot find the correspondence between the two domains. In contrast, our method learns dynamics via dynamics cycle-consistency, which outperforms those which don’t by a large margin.
172
+
173
+ # 5 REAL ROBOT EXPERIMENTS
174
+
175
+ We use an xArm robot for the cross-modality alignment task. The goal is to estimate the simulation states (domain $Y$ ) given the real robot images (domain $X$ ), without any paired image-state data. We do not have access to the internal states of the real robot. We use an uncalibrated RGB camera to capture the videos of the robot movements. We collect the real robot videos by randomly executing end-effector positional control. We collect random trajectories in xArm simulator. The training set includes 11k triplets (image, action, next image) of the real robot. We collect two testing sets from the real robot: a) 1,000 samples of random movement (Table 5, 1st col.), and b) 100 samples of smooth movement (Table 5, 2nd col.).
176
+
177
+ ![](images/78d6db8cff237bb7c147ac31afdcc98ab03cd2d85de37e04eae8a7e358fd4c8a.jpg)
178
+ Figure 4: Visualization of learnt correspondence from RGB images to robot joint states with xArm robot. We render the predicted states in simulation with green background. While Cycle-GAN struggles to find the correct correspondence, the results of our method highlights the importance of dynamics cycle-consistency objective. (Best viewed in Adobe Acrobat to see the GIF of the last column.)
179
+
180
+ Table 5: Real robot results. We measure the L1 error (smaller better) of end effector position estimation. We experiment with either (i) end effector position (E), or (ii) joint positions (J) as the observations in simulator.
181
+
182
+ <table><tr><td>Method</td><td>Random</td><td>Smooth</td></tr><tr><td>Random G</td><td>0.30</td><td>0.18</td></tr><tr><td>Cycle-GAN (E)</td><td>0.18</td><td>0.21</td></tr><tr><td>Ours (E)</td><td>0.025</td><td>0.033</td></tr><tr><td>Ours (J)</td><td>0.031</td><td>0.044</td></tr></table>
183
+
184
+ We conduct experiments using either end-effector position or joint poses (7 joint positions) as observations in simulation. Note the action is defined by the delta movement of the end-effector, not the exact position of the end-effector. Thus there is no shortcuts for directly estimating the end-effector position and even harder for joint positions. We measure the L1-distance between the predicted and ground-truth end-effector position for evaluation. We compared our method with Cycle-GAN baseline (Appendix C). As shown in Table 5, the results from Cycle-GAN is close to random and our method with dyanmics cycle-consistency achieves much lower state estimation error. Besides training with end-effector as observations (Ours (E)), we also use joint poses as observations (Ours (J)) which increase the difficulty on learning the correspondence. The reason why Ours (J) is harder is that end-effector (Ours (E)) estimation does not involve the structural information of the robot, and it is of lower dimension. The joint poses contain 7 robot joint positions. Therefore both the state mapper and the dynamic model should perform better with end-effector than joint poses, yielding better overall performance. Even so, our results are still much better than Cycle-GAN with end-effector observations. We also visualize the translation results by rendering the states in simulation in Figure 4, and observes that our state estimation results are well aligned with the real robot video.
185
+
186
+ # 6 CONCLUSION
187
+
188
+ We propose a novel framework to find observations and actions correspondence across two domains using dynamics cycle-consistency. We show the efficacy of our method on multiple downstream applications in both simulation and on a real robot. While previous approaches relies on paired data or RL polices on collecting the data for learning, we provide a general framework that can learn correspondence from randomly sampled, unpaired data, independent of the defined RL task. This allows the correspondence to be generalized to diverse downstream applications.
189
+
190
+ Acknowledgements. We like to thank Jeannette Bohg for helpful discussions on this project. This work was supported, in part, by grants from DARPA, NSF 1730158 CI-New: Cognitive Hardware and Software Ecosystem Community Infrastructure (CHASE-CI), NSF ACI-1541349 CC\*DNI Pacific Research Platform, research grants from Berkeley DeepDrive and SAP, and gifts from Qualcomm and TuSimple.
191
+
192
+ # REFERENCES
193
+
194
+ Haitham Bou Ammar, Eric Eaton, Paul Ruvolo, and Matthew E Taylor. Unsupervised cross-domain transfer in policy gradient reinforcement learning via manifold alignment. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015. 3
195
+
196
+ Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in neural information processing systems, pp. 5048–5058, 2017. 6, 14
197
+
198
+ Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. arXiv preprint arXiv:1808.00177, 2018. 3
199
+
200
+ Aayush Bansal, Shugao Ma, Deva Ramanan, and Yaser Sheikh. Recycle-gan: Unsupervised video retargeting. In Proceedings of the European conference on computer vision (ECCV), pp. 119–135, 2018. 2, 3
201
+
202
+ Andre Barreto, Will Dabney, R ´ emi Munos, Jonathan J Hunt, Tom Schaul, Hado P van Hasselt, and ´ David Silver. Successor features for transfer in reinforcement learning. In Advances in neural information processing systems, pp. 4055–4065, 2017. 3
203
+
204
+ Konstantinos Bousmalis, Alex Irpan, Paul Wohlhart, Yunfei Bai, Matthew Kelcey, Mrinal Kalakrishnan, Laura Downs, Julian Ibarz, Peter Pastor, Kurt Konolige, et al. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 4243–4250. IEEE, 2018. 3
205
+
206
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016. 6
207
+
208
+ Bryan Chen, Alexander Sax, Gene Lewis, Iro Armeni, Silvio Savarese, Amir Zamir, Jitendra Malik, and Lerrel Pinto. Robust policies via mid-level visual representations: An experimental study in manipulation and navigation. arXiv preprint arXiv:2011.06698, 2020. 3
209
+
210
+ Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning, pp. 1582–1591, 2018. 6, 14
211
+
212
+ 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. 3
213
+
214
+ Abhishek Gupta, Coline Devin, YuXuan Liu, Pieter Abbeel, and Sergey Levine. Learning invariant feature spaces to transfer skills with reinforcement learning. arXiv preprint arXiv:1703.02949, 2017. 1, 2, 3
215
+
216
+ 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. 6
217
+
218
+ 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. arXiv preprint arXiv:1711.03213, 2017. 2, 3
219
+
220
+ Stephen James, Paul Wohlhart, Mrinal Kalakrishnan, Dmitry Kalashnikov, Alex Irpan, Julian Ibarz, Sergey Levine, Raia Hadsell, and Konstantinos Bousmalis. Sim-to-real via sim-to-sim: Dataefficient robotic grasping via randomized-to-canonical adaptation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 12627–12637, 2019. 2, 3
221
+
222
+ Girish Joshi and Girish Chowdhary. Cross-domain transfer in reinforcement learning using target apprentice. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7525–7532. IEEE, 2018. 3
223
+
224
+ Kun Ho Kim, Yihong Gu, Jiaming Song, Shengjia Zhao, and Stefano Ermon. Cross domain imitation learning. arXiv preprint arXiv:1910.00105, 2019. 3
225
+
226
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. 6, 14
227
+
228
+ 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. 6, 14
229
+
230
+ Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in neural information processing systems, pp. 700–708, 2017a. 3
231
+
232
+ YuXuan Liu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Imitation from observation: Learning to imitate behaviors from raw video via context translation. arXiv preprint arXiv:1707.03374, 2017b. 2
233
+
234
+ Andrew N Meltzoff. Understanding the intentions of others: re-enactment of intended acts by 18-month-old children. Developmental psychology, 1995. 1
235
+
236
+ Shayegan Omidshafiei, Jason Pazis, Christopher Amato, Jonathan P How, and John Vian. Deep decentralized multi-task multi-agent reinforcement learning under partial observability. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2681–2690. JMLR. org, 2017. 3
237
+
238
+ Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015. 3
239
+
240
+ Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. 2018 IEEE International Conference on Robotics and Automation (ICRA), May 2018. 2
241
+
242
+ 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, pp. 3–18. Springer, 2016. 3
243
+
244
+ Lerrel Pinto, Marcin Andrychowicz, Peter Welinder, Wojciech Zaremba, and Pieter Abbeel. Asymmetric actor critic for image-based robot learning. arXiv preprint arXiv:1710.06542, 2017. 2
245
+
246
+ Fabio Ramos, Rafael Possas, and Dieter Fox. Bayessim: Adaptive domain randomization via probabilistic inference for robotics simulators. Robotics: Science and Systems XV, Jun 2019. 3
247
+
248
+ Kanishka Rao, Chris Harris, Alex Irpan, Sergey Levine, Julian Ibarz, and Mohi Khansari. Rl-cyclegan: Reinforcement learning aware simulation-to-real. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11157–11166, 2020. 3
249
+
250
+ 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, 2016a. 3
251
+
252
+ Andrei A Rusu, Mel Vecerik, Thomas Rothorl, Nicolas Heess, Razvan Pascanu, and Raia Hadsell. ¨ Sim-to-real robot learning from pixels with progressive nets. arXiv preprint arXiv:1610.04286, 2016b. 3
253
+
254
+ Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. arXiv preprint arXiv:1611.04201, 2016. 3
255
+
256
+ Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, Sergey Levine, and Google Brain. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1134–1141. IEEE, 2018. 1, 2
257
+
258
+ Laura Smith, Nikita Dhawan, Marvin Zhang, Pieter Abbeel, and Sergey Levine. Avid: Learning multi-stage tasks via pixel-level translation of human videos. arXiv preprint arXiv:1912.04443, 2019. 2, 3
259
+
260
+ Gregory J Stein and Nicholas Roy. Genesis-rt: Generating synthetic images for training secondary real-world tasks. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7151–7158. IEEE, 2018. 3
261
+
262
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018. 6
263
+
264
+ Matthew E Taylor and Peter Stone. Transfer learning for reinforcement learning domains: A survey. Journal of Machine Learning Research, 10(Jul):1633–1685, 2009. 3
265
+
266
+ Matthew E Taylor, Peter Stone, and Yaxin Liu. Transfer learning via inter-task mappings for temporal difference learning. Journal of Machine Learning Research, 8(Sep):2125–2167, 2007. 3
267
+
268
+ Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020. 1
269
+
270
+ Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. 2017 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Sep 2017. 2, 3
271
+
272
+ Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012. 2
273
+
274
+ Eric Tzeng, Coline Devin, Judy Hoffman, Chelsea Finn, Pieter Abbeel, Sergey Levine, Kate Saenko, and Trevor Darrell. Adapting deep visuomotor representations with weak pairwise constraints. arXiv preprint arXiv:1511.07111, 2015. 3
275
+
276
+ Yilin Wu, Wilson Yan, Thanard Kurutach, Lerrel Pinto, and Pieter Abbeel. Learning to manipulate deformable objects without demonstrations. arXiv preprint arXiv:1910.13439, 2019. 3
277
+
278
+ Wilson Yan, Ashwin Vangipuram, Pieter Abbeel, and Lerrel Pinto. Learning predictive representations for deformable objects using contrastive estimation. arXiv preprint arXiv:2003.05436, 2020. 3
279
+
280
+ Sergey Zakharov, Wadim Kehl, and Slobodan Ilic. Deceptionnet: Network-driven domain randomization. In Proceedings of the IEEE International Conference on Computer Vision, pp. 532–541, 2019. 3
281
+
282
+ Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A Efros. Learning dense correspondence via 3d-guided cycle consistency. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 117–126, 2016. 3
283
+
284
+ Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pp. 2223–2232, 2017. 2, 3, 4
285
+
286
+ # A EXPERIMENT SETTING
287
+
288
+ # A.1 CROSS-PHYSICS AGENT SETTING
289
+
290
+ The physical parameters in cross-physics settings are shown in Table 6. The “Parameter” column represents which type of parameter is changed in each task. Recall that we train the RL policy in domain $Y$ and evaluate in domain $X$ in our evaluation. The numbers in the columns of domain $X$ and domain $Y$ are the physics values for each domain. The physics parameter in domain $Y$ is defined by default in the OpenAI Gym MuJoCo simulation environment. The physics parameter in domain $X$ is selected so that it can cause obvious distortion to the policy trained in domain $Y$ (as shown in Table 1). Note that we did not perform physics parameter search for improving our method. For the domain randomization baseline, the parameter value for each episode is uniformly sampled from the range shown in the last column.
291
+
292
+ <table><tr><td>Parameter</td><td>Envs</td><td>Domain X</td><td>Domain Y</td><td>DR Range</td></tr><tr><td rowspan="4">Armature</td><td>HalfCheetah</td><td>0.3</td><td>0.1</td><td>[0.2,0.4]</td></tr><tr><td>FingerSpin</td><td>2.0</td><td>0.0</td><td>[1.0, 3.0]</td></tr><tr><td>FetchReach</td><td>3.0</td><td>1.0</td><td>[2.0,4.0]</td></tr><tr><td>Walker</td><td>0.4</td><td>1.0</td><td>[0.0,0.8]</td></tr><tr><td>Torso Mass</td><td>Hopper</td><td>1.2</td><td>1.0</td><td>[0.8, 1.6]</td></tr></table>
293
+
294
+ Table 6: Cross physics physical hyperparameter settings. The parameters in domain $X$ , domain $Y$ and parameter range for domain randomization baseline for each task.
295
+
296
+ # A.2 CROSS-MODALITY AGENT SETTING
297
+
298
+ In this setting, the resolution of the image observation in domain $X$ is $2 5 6 \times 2 5 6$ and we concatenate three images (current and previous two frames) as the observation input for $G$ to estimate the state. By concatenating multiple images instead of one, it allows the representation to capture the velocities and motion of the agent, which is a common practice for vision-based RL.
299
+
300
+ # A.3 CROSS-MORPHOLOGY AGENT SETTING
301
+
302
+ We introduce two tasks for the cross-morphology experiments including the “HalfCheetah” and “Swimmer” environments. As shown in Figure 5, for “HalfCheetah”, we modify the agent by adding one more hind leg of the same structure as the original hind leg to obtain a three-leg cheetah. For “Swimmer”, we add one more limb cloned from the original third limb, leading to a four-limb swimmer.
303
+
304
+ ![](images/3cb616e7f2988d80c0f69d3ccd54653899284abc8e4d241e4e54b0974fbd6d28.jpg)
305
+ Figure 5: Cross-morphology agent introduction. Left: two-leg Cheetah and its three-leg counterpart. Right: three-limb swimmer its four-limb counterpart. Please check out our supplementary video for visualization.
306
+
307
+ # A.4 INITIALIZATION FOR ACTION ALIGNMENT MODEL
308
+
309
+ In the cross-modality-and-physics alignment, for agents with the same morphology and structure, we initialize the action translation between two domains by identity mapping, and only train the observation alignment model $( G )$ in the beginning. Then we unfreeze the action alignment model $H$ and $P$ ) and jointly train all models by our alternative training procedure.
310
+
311
+ For agents of different morphology (e.g., different number of limbs and joints), the dimensions of action spaces are naturally different. Thus it is impossible to initiate action mapping functions with identity mapping. Note that we can still use identity mapping for the original joints and limbs between two domains. For extra joints and limbs, we borrow the mapping function from nearby joints to initialize the novel joints. For example, in our experiments, we can find correspondence between the three-leg cheetah and the two-leg cheetah. For the newly-added leg, we use and repeat the nearby original hind leg actions to initialize its actions. There is no correspondence established from this initialization, as shown by the experiment results—we provides this initialization baseline for cross-morphology policy transfer in Table 4. This baseline perform much worse than our approach.
312
+
313
+ # B IMPLEMENTATION DETAILS
314
+
315
+ # B.1 NETWORK ARCHITECTURE
316
+
317
+ The network architectures for each separate settings are as follows:
318
+
319
+ Cross-physics. The discriminator $D$ is a five-layer MLP (hidden size: 32, 64, 128, 32) which takes states as input and predicts whether a state is true or fake. The forward dynamics model $F$ is a four-layer MLP (hidden size: 64, 128, 32) which takes current state and action as input and predicts the next state. The observation alignment function $G$ is an identity mapping. The action alignment functions $H$ and $P$ are MLPs (hidden size: 32, 64, 128, 32) which take current state and action as input and predicts corresponding action in the other domain.
320
+
321
+ Cross-modality. The discriminator $D$ and the forward dynamics model $F$ are the same as that in the “cross-physics” setting. The observation alignment function $G$ is a ResNet-18 and followed by an MLP head (hidden size: 256, 64, 32) which outputs corresponding state. The action alignment functions $H$ and $P$ are identity mapping.
322
+
323
+ Cross-morphology. Newtorks $D , F , H$ and $P$ are the same as that in the “cross-physics” setting.
324
+ The observation alignment function $G$ is the same as that in the “cross-modality” setting.
325
+
326
+ # B.2 TRAINING
327
+
328
+ Given the dataset of unpaired and unaligned samples from two domains, we first train the forward dynamics model $F$ on domain $Y$ until it converges, we use Adam optimizer (Kingma & Ba, 2014) with initial learning rate 0.001 which is decreased by half every three epochs and train the network for 20 epochs. This is the same for all the settings. Secondly, we train the action alignment functions $H , P$ or observation alignment function $G$ by optimizing Eq. 5. The pipeline and optimization chain for each separate settings are as follows:
329
+
330
+ Cross-physics. We optimize the alignment functions $H , P$ here. We set $\lambda _ { 0 } = 2 0 0$ , $\lambda _ { 1 } = 1$ , and $\lambda _ { 2 } = 0$ in Eq. 5, where $\lambda _ { 2 } = 0$ means we are not using the observation alignment function $G$ . Note that although the forward dynamics model $F$ is involved in the back-propagation, we are fixing the weights of $F$ . We train the models by using the Adam optimizer for 50 epochs with a batch size of 32. The learning rate is set to 0.001 and decreased by $1 / 3$ for every 10 epochs.
331
+
332
+ Cross-modality. We optimize the observation alignment function $G$ . We set $\lambda _ { 0 } = 2 0 0$ , $\lambda _ { 1 } = 0$ and $\lambda _ { 2 } = 3$ in Eq. 5, where $\lambda _ { 1 } = 0$ means we are not using the action alignment function $H , P$ Similarly, the forward dyanmics model $F$ is freezed. We train the model with Adam for 50 epochs with a batch size of 32. The learning rate is set to 0.001 and decreased by $1 / 3$ for every 10 epochs.
333
+
334
+ Cross-morphology (Joint training). Networks $H$ , $P$ , and $G$ are optimized by Adam optimizer while the forward dyanmics model $F$ is freezed. We combine the training procedure in cross-physics and cross-modality settings following Algorithm 1. The model is trained for 10 epochs with a batch size of 32. The training alternates every 5000 steps (e1 and e2). Note each epoch contains more training steps in joint training. The learning rate is set to 0.0001.
335
+
336
+ # B.3 REFERENCE POLICY
337
+
338
+ We use DDPG (Lillicrap et al., 2015) with HER (Andrychowicz et al., 2017) for “FetchReach” and TD3 (Fujimoto et al., 2018) for other environments. For DDPG, we train the policy for 50 epochs of 400 episodes in each epoch. The policy exploration epsilon ratio is 0.3 and the reward discount factor is 0.98. For TD3, we train the policy for $4 0 0 \mathrm { k }$ time steps. The initial exploration step is $2 5 \mathrm { k }$ . The reward discount factor is 0.99, the target network update rate is 0.005 and exploration noise standard deviation level is 0.1. When evaluating the performance of the policies, we calculate 50 episode rollout rewards across 5 different seeds. We report the rewards with variance in all tables.
339
+
340
+ # C DETAILS OF CYCLE-GAN BASELINES
341
+
342
+ Here we introduce the details of Cycle-GAN baseline for each different settings.
343
+
344
+ Cross-physics. In this setting, the Cycle-GAN baseline translates actions between two domains. The generators and discriminators are MLPs and the cycle loss is the L1 loss. The MLP network structures follow our approach. The results show that the policy fails to perform across domains and the mapping is close to random, so we have not included this baseline in the table.
345
+
346
+ Cross-modality. In this setting, the Cycle-GAN baseline translates between image and its corresponding state. The image-to-state generator is the same as $G$ . The state-to-image generator is composed of MLPs and six upsampling blocks. Each block consists of one transposed convolution layer, one BatchNorm layer and one ReLU activation layer. The cycle loss is L1 loss. This setting is also applied to our real robot experiment.
347
+
348
+ Cross-morphology. The Cycle-GAN model translates states and actions between two domains.
349
+ All generators and discriminators are MLPs and the cycle loss is L1 loss.
350
+
351
+ We visualize in Figure 6 the learned correspondence from the cross-modality alignment on the HalfCheetah experiment (Table 3), where observations of images are translated to states. In each plot, $\mathbf { X }$ -axis represents the true-state of the image and the y-axis represents the translation result from the network. Each point in the plot represents a random sample. We can see that our method is able to translate the image to the correct states as most of the dots are in the diagonal line $( y = x )$ , while Cycle-GAN yield near random translation similar to the random baseline. The result underlines the significance of incorporating dynamics into cycle-consistency.
352
+
353
+ ![](images/1a3ca700776d5eecc250014638202e7136fcabd2fd767003231b3b900244cdcd.jpg)
354
+ Figure 6: Correspondence visualization for Cycle-GAN baseline and ours. Cycle-GAN model performs nearly the same as the random shuffle baseline while our model can correctly find the correspondence between the image modality and the state modality.
355
+
356
+ The qualitative visualizations for Cycle-GAN and ours are shown in Figure 7 for the cross-modality alignment on HalfCheetah. These five sub-figures from left to right in sequence are as follows: (a) One random image observation sample from the dataset. (b) The rendered image from the state which is predicted by Cycle-GAN model. (c) The rendered image from the state which is predicted by our model. (d) The image with a new renderer for our model prediction, giving a different rendering view of the state. (e) The training curve of L1 error for self-supervised state estimation. After training, our model output is almost the same as the ground-truth while the Cycle-GAN model completely fails.
357
+
358
+ ![](images/c57307c7a2df4f4d91586a8992b51439fca45445c58923a9d9a1b8c0d401c810.jpg)
359
+ Figure 7: Qualitative visualization for Cycle-GAN baseline and ours. The rendered image (c) from our model prediction looks almost the same like the original input image (a) while Cycle-GAN baseline (b) fails. The last small figure visualizes the L1 error between the ground-truth state and our model prediction during the training process and proves the effectiveness of our method in self-supervised state estimation. More visualizations are presented in the project page link given in the abstract.
parse/train/QIRlze3I6hX/QIRlze3I6hX_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r10FA8Kxg/r10FA8Kxg.md ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DO DEEP CONVOLUTIONAL NETS REALLY NEED TO BE DEEP AND CONVOLUTIONAL?
2
+
3
+ Gregor Urban1, Krzysztof J. Geras2, Samira Ebrahimi Kahou3, Ozlem Aslan4, Shengjie Wang5, Abdelrahman Mohamed6, Matthai Philipose6, Matt Richardson6, Rich Caruana6
4
+
5
+ 1UC Irvine, USA
6
+ 2University of Edinburgh, UK
7
+ 3Ecole Polytechnique de Montreal, CA
8
+ 4University of Alberta, CA
9
+ 5University of Washington, USA
10
+ 6Microsoft Research, USA
11
+
12
+ # ABSTRACT
13
+
14
+ Yes, they do. This paper provides the first empirical demonstration that deep convolutional models really need to be both deep and convolutional, even when trained with methods such as distillation that allow small or shallow models of high accuracy to be trained. Although previous research showed that shallow feed-forward nets sometimes can learn the complex functions previously learned by deep nets while using the same number of parameters as the deep models they mimic, in this paper we demonstrate that the same methods cannot be used to train accurate models on CIFAR-10 unless the student models contain multiple layers of convolution. Although the student models do not have to be as deep as the teacher model they mimic, the students need multiple convolutional layers to learn functions of comparable accuracy as the deep convolutional teacher.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ Cybenko (1989) proved that a network with a large enough single hidden layer of sigmoid units can approximate any decision boundary. Empirical work, however, suggests that it can be difficult to train shallow nets to be as accurate as deep nets. Dauphin and Bengio (2013) trained shallow nets on SIFT features to classify a large-scale ImageNet dataset and found that it was difficult to train large, high-accuracy, shallow nets. A study of deep convolutional nets suggests that for vision tasks deeper models are preferred under a parameter budget (e.g. Eigen et al. (2014); He et al. (2015); Simonyan and Zisserman (2014); Srivastava et al. (2015)). Similarly, Seide et al. (2011) and Geras et al. (2015) show that deeper models are more accurate than shallow models in speech acoustic modeling. More recently, Romero et al. (2015) showed that it is possible to gain increases in accuracy in models with few parameters by training deeper, thinner nets (FitNets) to mimic much wider nets. Cohen and Shashua (2016); Liang and Srikant (2016) suggest that the representational efficiency of deep networks scales exponentially with depth, but it is unclear if this applies only to pathological problems, or is encountered in practice on data sets such as TIMIT and CIFAR.
19
+
20
+ Ba and Caruana (2014), however, demonstrated that shallow nets sometimes can learn the functions learned by deep nets, even when restricted to the same number of parameters as the deep nets. They did this by first training state-of-the-art deep models, and then training shallow models to mimic the deep models. Surprisingly, and for reasons that are not well understood, the shallow models learned more accurate functions when trained to mimic the deep models than when trained on the original data used to train the deep models. In some cases shallow models trained this way were as accurate as state-of-the-art deep models. But this demonstration was made on the TIMIT speech recognition benchmark. Although their deep teacher models used a convolutional layer, convolution is less important for TIMIT than it is for other domains such as image classification.
21
+
22
+ Ba and Caruana (2014) also presented results on CIFAR-10 which showed that a shallow model could learn functions almost as accurate as deep convolutional nets. Unfortunately, the results on CIFAR-10 are less convincing than those for TIMIT. To train accurate shallow models on CIFAR-10 they had to include at least one convolutional layer in the shallow model, and increased the number of parameters in the shallow model until it was 30 times larger than the deep teacher model. Despite this, the shallow convolutional student model was several points less accurate than a teacher model that was itself several points less accurate than state-of-the-art models on CIFAR-10.
23
+
24
+ In this paper we show that the methods Ba and Caruana used to train shallow students to mimic deep teacher models on TIMIT do not work as well on problems such as CIFAR-10 where multiple layers of convolution are required to train accurate teacher models. If the student models have a similar number of parameters as the deep teacher models, high accuracy can not be achieved without multiple layers of convolution even when the student models are trained via distillation.
25
+
26
+ To ensure that the shallow student models are trained as accurately as possible, we use Bayesian optimization to thoroughly explore the space of architectures and learning hyperparameters. Although this combination of distillation and hyperparameter optimization allows us to train the most accurate shallow models ever trained on CIFAR-10, the shallow models still are not as accurate as deep models. Our results clearly suggest that deep convolutional nets do, in fact, need to be both deep and convolutional, even when trained to mimic very accurate models via distillation (Hinton et al., 2015).
27
+
28
+ # 2 TRAINING SHALLOW NETS TO MIMIC DEEPER CONVOLUTIONAL NETS
29
+
30
+ In this paper, we revisit the CIFAR-10 experiments in Ba and Caruana (2014). Unlike in that work, here we compare shallow models to state-of-the-art deep convolutional models, and restrict the number of parameters in the shallow student models to be comparable to the number of parameters in the deep convolutional teacher models. Because we anticipated that our results might be different, we follow their approach closely to eliminate the possibility that the results differ merely because of changes in methodology. Note that the goal of this paper is not to train models that are small or fast as in Bucila et al. (2006), Hinton et al. (2015), and Romero et al. (2015), but to examine if shallow models can be as accurate as deep convolutional models given the same parameter budget.
31
+
32
+ There are many steps required to train shallow student models to be as accurate as possible: train state-of-the-art deep convolutional teacher models, form an ensemble of the best deep models, collect and combine their predictions on a large transfer set, and then train carefully optimized shallow student models to mimic the teacher ensemble. For negative results to be informative, it is important that each of these steps be performed as well as possible. In this section we describe the experimental methodology in detail. Readers familiar with distillation (model compression), training deep models on CIFAR-10, data augmentation, and Bayesian hyperparameter optimization may wish to skip to the empirical results in Section 3.
33
+
34
+ # 2.1 MODEL COMPRESSION AND DISTILLATION
35
+
36
+ The key idea behind model compression is to train a compact model to approximate the function learned by another larger, more complex model. Bucila et al. (2006) showed how a single neural net of modest size could be trained to mimic a much larger ensemble. Although the small neural nets contained $1 0 0 0 \times$ fewer parameters, often they were as accurate as the large ensembles they were trained to mimic.
37
+
38
+ Model compression works by passing unlabeled data through the large, accurate teacher model to collect the real-valued scores it predicts, and then training a student model to mimic these scores. Hinton et al. (2015) generalized the methods of Bucila et al. (2006) and Ba and Caruana (2014) by incorporating a parameter to control the relative importance of the soft targets provided by the teacher model to the hard targets in the original training data, as well as a temperature parameter that regularizes learning by pushing targets towards the uniform distribution. Hinton et al. (2015) also demonstrated that much of the knowledge passed from the teacher to the student is conveyed as dark knowledge contained in the relative scores (probabilities) of outputs corresponding to other classes, as opposed to the scores given to just the output for the one correct class.
39
+
40
+ Surprisingly, distillation often allows smaller and/or shallower models to be trained that are nearly as accurate as the larger, deeper models they are trained to mimic, yet these same small models are not as accurate when trained on the 1-hot hard targets in the original training set. The reason for this is not yet well understood. Similar compression and distillation methods have also successfully been used in speech recognition (e.g. Chan et al. (2015); Geras et al. (2015); Li et al. (2014)) and reinforcement learning Parisotto et al. (2016); Rusu et al. (2016). Romero et al. (2015) showed that distillation methods can be used to train small students that are more accurate than the teacher models by making the student models deeper, but thinner, than the teacher model.
41
+
42
+ # 2.2 MIMIC LEARNING VIA L2 REGRESSION ON LOGITS
43
+
44
+ We train shallow mimic nets using data labeled by an ensemble of deep teacher nets trained on the original 1-hot CIFAR-10 training data. The deep teacher models are trained in the usual way using softmax outputs and cross-entropy cost function. Following Ba and Caruana (2014), the student mimic models are not trained with cross-entropy on the ten $p$ values where $\textstyle p _ { k } = e ^ { z _ { k } } / \sum _ { j } e ^ { z _ { j } }$ output by the softmax layer from the deep teacher model, but instead are trained on the un-normalized log probability values $z$ (the logits) before the softmax activation. Training on the logarithms of predicted probabilities (logits) helps provide the dark knowledge that regularizes students by placing emphasis on the relationships learned by the teacher model across all of the outputs.
45
+
46
+ As in Ba and Caruana (2014), the student is trained as a regression problem given training data $\{ ( x ^ { ( 1 ) } , z ^ { ( 1 ) } ) , . . . , ( x ^ { ( T ) } , z ^ { ( T ) } ) \}$ :
47
+
48
+ $$
49
+ \mathcal { L } ( W ) = \frac { 1 } { T } \sum _ { t } | | g ( x ^ { ( t ) } ; W ) - z ^ { ( t ) } | | _ { 2 } ^ { 2 } ,
50
+ $$
51
+
52
+ where $W$ represents all of the weights in the network, and $g ( x ^ { ( t ) } ; W )$ is the model prediction on the $t ^ { t h }$ training data sample.
53
+
54
+ # 2.3 USING A LINEAR BOTTLENECK TO SPEED UP TRAINING
55
+
56
+ A shallow net has to have more hidden units in each layer to match the number of parameters in a deep net. Ba and Caruana (2014) found that training these wide, shallow mimic models with backpropagation was slow, and introduced a linear bottleneck layer between the input and non-linear layers to speed learning. The bottleneck layer speeds learning by reducing the number of parameters that must be learned, but does not make the model deeper because the linear terms can be absorbed back into the non-linear weight matrix after learning. See Ba and Caruana (2014) for details. To match their experiments we use linear bottlenecks when training student models with 0 or 1 convolutional layers, but did not find the linear bottlenecks necessary when training student models with more than 1 convolutional layer.
57
+
58
+ # 2.4 BAYESIAN HYPERPARAMETER OPTIMIZATION
59
+
60
+ The goal of this work is to determine empirically if shallow nets can be trained to be as accurate as deep convolutional models using a similar number of parameters in the deep and shallow models. If we succeed in training a shallow model to be as accurate as a deep convolutional model, this provides an existence proof that shallow models can represent and learn the complex functions learned by deep convolutional models. If, however, we are unable to train shallow models to be as accurate as deep convolutional nets, we might fail only because we did not train the shallow nets well enough.
61
+
62
+ In all our experiments we employ Bayesian hyperparameter optimization using Gaussian process regression to ensure that we thoroughly and objectively explore the hyperparameters that govern learning. The implementation we use is Spearmint (Snoek et al., 2012). The hyperparameters we optimize with Bayesian optimization include the initial learning rate, momentum, scaling of the initial random weights, scaling of the inputs, and terms that determine the width of each of the network’s layers (i.e. number of convolutional filters and neurons). More details of the hyperparameter optimization can be found in Sections 2.5, 2.7, 2.8 and in the Appendix.
63
+
64
+ # 2.5 TRAINING DATA AND DATA AUGMENTATION
65
+
66
+ The CIFAR-10 (Krizhevsky, 2009) data set consists of a set of natural images from 10 different object classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck. The dataset is a labeled subset of the 80 million tiny images dataset (Torralba et al., 2008) and is divided into 50,000 train and
67
+
68
+ 10,000 test images. Each image is $3 2 \times 3 2$ pixels in 3 color channels, yielding input vectors with 3072 dimensions. We prepared the data by subtracting the mean and dividing by the standard deviation of each image vector. We train all models on a subset of 40,000 images and use the remaining 10,000 images as the validation set for the Bayesian optimization. The final trained models only used $80 \%$ of the theoretically available training data (as opposed to retraining on all of the data after hyperparameter optimization).
69
+
70
+ We employ the HSV-data augmentation technique as described by Snoek et al. (2015). Thus we shift hue, saturation and value by uniform random values: $\Delta _ { h } \sim U ( - D _ { h } , D _ { h } )$ , $\Delta _ { s } \sim$ $U ( - D _ { s } , D _ { s } )$ , $\Delta _ { v } ~ \sim ~ U ( - D _ { v } , D _ { v } )$ . Saturation and value values are scaled globally: $a _ { s } \sim$ $\begin{array} { r } { U ( \frac { 1 } { 1 + A _ { s } } , 1 + A _ { s } ) , a _ { v } \sim U ( \frac { 1 } { 1 + A _ { v } } , 1 + A _ { v } ) } \end{array}$ . The five constants $D _ { h } , D _ { s } , D _ { v } , A _ { s } , A _ { v }$ are treated as additional hyperparameters in the Bayesian hyperparameter optimization.
71
+
72
+ All training images are mirrored left-right randomly with a probability of 0.5. The input images are further scaled and jittered randomly by cropping windows of size $2 4 \times 2 4$ up to $3 2 \times 3 2$ at random locations and then scaling them back to $3 2 \times 3 2$ . The procedure is as follows: we sample an integer value $S \sim U ( 2 4 , 3 2 )$ and then a pair of integers $x , y \sim U ( 0 , 3 2 - S )$ . The transformed resulting image is $R = f _ { \mathrm { s p l i n e } , 3 } ( I [ x : x + S , y : y + S ] )$ with $I$ denoting the original image and $f _ { \mathrm { s p l i n e , 3 } }$ denoting the 3rd order spline interpolation function that maps the 2D array back to $3 2 \times 3 2$ (applied to the three color channels separately).
73
+
74
+ All data augmentations for the teacher models are computed on the fly using different random seeds. For student models trained to mimic the ensemble (see Section 2.7 for details of the ensemble teacher model), we pre-generated 160 epochs worth of randomly augmented training data, evaluated the ensemble’s predictions (logits) on these samples, and saved all data and predictions to disk. All student models thus see the same training data in the same order. The parameters for HSV-augmentation in this case had to be selected beforehand; we chose to use the settings found with the best single model $( D _ { h } = 0 . 0 6 , D _ { s } = 0 . 2 6 , D _ { v } = 0 . 2 0 , A _ { s } = 0 . 2 1 , A _ { v } = 0 . 1 3 )$ . Pre-saving the logits and augmented data is important to reduce the computational cost at training time, and to ensure that all student models see the same training data
75
+
76
+ Because augmentation allows us to generate large training sets from the original 50,000 images, we use augmented data as the transfer set for model compression. No extra unlabeled data is required.
77
+
78
+ # 2.6 LEARNING-RATE SCHEDULE
79
+
80
+ We train all models using SGD with Nesterov momentum. The initial learning rate and momentum are chosen by Bayesian optimization. The learning rate is reduced according to the evolution of the model’s validation error: it is halved if the validation error does not drop for ten epochs in a row. It is not reduced within the next eight epochs following a reduction step. Training ends if the error did not drop for 30 epochs in a row or if the learning rate was reduced by a factor of more than 2000 in total.
81
+
82
+ This schedule provides a way to train the highly varying models in a fair manner (it is not feasible to optimize all of the parameters that define the learning schedule). It also decreases the time spent to train each model compared to using a hand-selected overestimate of the number of epochs to train, thus allowing us to train more models in the hyperparameter search.
83
+
84
+ 2.7 SUPER TEACHER: AN ENSEMBLE OF 16 DEEP CONVOLUTIONAL CIFAR-10 MODELS
85
+
86
+ One limitation of the CIFAR-10 experiments performed in Ba and Caruana (2014) is that the teacher models were not state-of-the-art. The best deep models they trained on CIFAR-10 had only $8 8 \%$ accuracy, and the ensemble of deep models they used as a teacher had only $8 9 \%$ accuracy. The accuracies were not state-of-the-art because they did not use augmentation and because their deepest models had only three convolutional layers. Because our goal is to determine if shallow models can be as accurate as deep convolutional models, it is important that the deep models we compare to (and use as teachers) are as accurate as possible.
87
+
88
+ We train deep neural networks with eight convolutional layers, three intermittent max-pooling layers and two fully-connected hidden layers. We include the size of these layers in the hyperparameter optimization, by allowing the first two convolutional layers to contain from 32 to 96 filters each, the next two layers to contain from 64 to 192 filters, and the last four convolutional layers to contain from 128 to 384 filters. The two fully-connected hidden layers can contain from 512 to 1536 neurons. We parametrize these model-sizes by four scalars (the layers are grouped as 2-2-4) and include the scalars in the hyperparameter optimization. All models are trained using Theano (Bastien et al., 2012; Bergstra et al., 2010).
89
+
90
+ We optimize eighteen hyperparameters overall: initial learning rate on [0.01, 0.05], momentum on [0.80, 0.91], $l _ { 2 }$ weight decay on $[ 5 \cdot 1 0 ^ { - 5 } , 4 \cdot 1 0 ^ { - 4 } ]$ , initialization coefficient on [0.8, 1.35] which scales the initial weights of the CNN, four separate dropout rates, five constants controlling the HSV data augmentation, and the four scaling constants controlling the networks’ layer widths. The learning rate and momentum are optimized on a log-scale (as opposed to linear scale) by optimizing the exponent with appropriate bounds, e.g. $L R = e ^ { - x }$ optimized over $x$ on [3.0, 4.6]. See the Appendix for more details about hyperparameter optimization.
91
+
92
+ We trained 129 deep CNN models with Spearmint. The best model obtained an accuracy of $9 2 . 7 8 \%$ the fifth best achieved $9 2 . 6 7 \%$ . See Table 1 for the sizes and architectures of the three best models.
93
+
94
+ We are able to construct a more accurate model on CIFAR-10 by forming an ensemble of multiple deep convolutional neural nets, each trained with different hyperparameters, and each seeing slightly different training data (as the augmentation parameters vary). We experimented with a number of ensembles of the many deep convnets we trained, using accuracy on the validation set to select the best combination. The final ensemble contained 16 deep convnets and had an accuracy of $9 4 . 0 \%$ o n the validation set, and $9 3 . 8 \%$ on the final test set. We believe this is among the top published results for deep learning on CIFAR-10. The ensemble averages the logits predicted by each model before the softmax layers.
95
+
96
+ We used this very accurate ensemble model as the teacher model to label the data used to train the shallower student nets. As described in Section 2.2, the logits (the scores just prior to the final softmax layer) from each of the CNN teachers in the ensemble model are averaged for each class, and the average logits are used as final regression targets to train the shallower student neural nets.
97
+
98
+ 2.8 TRAINING SHALLOW STUDENT MODELS TO MIMIC AN ENSEMBLE OF DEEP CONVOLUTIONAL MODELS
99
+
100
+ We trained student mimic nets with 1, $3 . 1 6 ^ { 1 }$ , 10 and 31.6 million trainable parameters on the pre-computed augmented training data (Section 2.5) that was re-labeled by the teacher ensemble (Section 2.7). For each of the four student sizes we trained shallow fully-connected student MLPs containing 1, 2, 3, 4, or 5 layers of non-linear units (ReLU), and student CNNs with 1, 2, 3 or 4 convolutional layers. The convolutional student models also contain one fully-connected ReLU layer. Models with zero or only one convolutional layer contain an additional linear bottleneck layer to speed up learning (cf. Section 2.3). We did not need to use a bottleneck to speed up learning for the deeper models as the number of learnable parameters is naturally reduced by the max-pooling layers.
101
+
102
+ The student CNNs use max-pooling and Bayesian optimization controls the number of convolutional filters and hidden units in each layer. The hyperparameters we optimized in the student models are: initial learning rate, momentum, scaling of the initially randomly distributed learnable parameters, scaling of all pixel values of the input, and the scale factors that control the width of all hidden and convolutional layers in the model. Weights are initialized as in Glorot and Bengio (2010). We intentionally do not optimize and do not make use of weight decay and dropout when training student models because preliminary experiments showed that these consistently reduced the accuracy of student models by several percent. Please refer to the Appendix for more details on the individual architectures and hyperparameter ranges.
103
+
104
+ # 3 EMPIRICAL RESULTS
105
+
106
+ Table 1 summarizes results after Bayesian hyperparameter optimization for models trained on the original 0/1 hard CIFAR-10 labels. All of these models use weight decay and are trained with the dropout hyperparameters included in the Bayesian optimization. The table shows the accuracy of the best three deep convolutional models we could train on CIFAR-10, as well as the accuracy of
107
+
108
+ Table 1: Accuracy on CIFAR-10 of shallow and deep models trained on the original 0/1 hard class labels using Bayesian optimization with dropout and weight decay. Key: ${ \mathfrak { c } } =$ convolution layer; mp $=$ max-pooling layer; fc $=$ fully-connected layer; lfc $=$ linear bottleneck layer; exponents indicate repetitions of a layer. The last two models $( ^ { * } )$ are numbers reported by Ba and Caruana (2014). The models with 1-4 convolutional layers at the top of the table are included for comparison with student models of similar architecture in Table 2 . All of the student models in Table 2 with 1, 2, 3, and 4 convolutional layers are more accurate than their counterparts in this table that are trained on the original 0/1 hard targets — as expected distillation yields shallow models of higher accuracy than shallow models trained on the original training data.
109
+
110
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1># parameters</td><td rowspan=1 colspan=1> Accuracy</td></tr><tr><td rowspan=1 colspan=1>1 conv. layer</td><td rowspan=1 colspan=1>c-mp-lfc-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>84.6%</td></tr><tr><td rowspan=1 colspan=1>2 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>88.9%</td></tr><tr><td rowspan=1 colspan=1>3 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>91.2%</td></tr><tr><td rowspan=1 colspan=1>4 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>91.75%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 1st</td><td rowspan=1 colspan=1>76c2-mp-126c2-mp-148c4-mp-1200fc²</td><td rowspan=1 colspan=1>5.3M</td><td rowspan=1 colspan=1>92.78%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 2nd</td><td rowspan=1 colspan=1>96c2-mp-171c2-mp-128c4-mp-512fc²</td><td rowspan=1 colspan=1>2.5M</td><td rowspan=1 colspan=1>92.77%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 3rd</td><td rowspan=1 colspan=1>54c²-mp-158c²-mp-189c4-mp-1044fc²</td><td rowspan=1 colspan=1>5.8M</td><td rowspan=1 colspan=1>92.67%</td></tr><tr><td rowspan=1 colspan=1>Ensemble of 16 CNNs</td><td rowspan=1 colspan=1>c²-mp-c²-mp-c4-mp-fc²</td><td rowspan=1 colspan=1>83.4M</td><td rowspan=1 colspan=1>93.8%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN (*)</td><td rowspan=1 colspan=1>128c-mp-128c-mp-128c-mp-1k fc</td><td rowspan=1 colspan=1>2.1M</td><td rowspan=1 colspan=1>88.0%</td></tr><tr><td rowspan=1 colspan=1>Ensemble, 4 CNNs (*)</td><td rowspan=1 colspan=1>128c-mp-128c-mp-128c-mp-1k fc</td><td rowspan=1 colspan=1>8.6M</td><td rowspan=1 colspan=1>89.0%</td></tr></table>
111
+
112
+ Table 2: Comparison of student models with varying number of convolutional layers trained to mimic the ensemble of 16 deep convolutional CIFAR-10 models in Table 1 . The best performing student models have 3 – 4 convolutional layers and $1 0 \mathbf { M } - 3 1 . 6 \mathbf { M }$ parameters. The student models in this table are more accurate than the models of the same architecture in Table 1 that were trained on the original 0/1 hard targets — shallow models trained with distillation are more accurate than shallow models trained on $_ { 0 / 1 }$ hard targets. The student model trained by Ba and Caruana (2014) is shown in the last line for comparison; it is less accurate and much larger than the student models trained here that also have 1 convolutional layer.
113
+
114
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1M</td><td rowspan=1 colspan=1>3.16M</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>31.6M</td><td rowspan=1 colspan=1>70M</td></tr><tr><td rowspan=1 colspan=1>Bottleneck,1 hidden layer</td><td rowspan=1 colspan=1>65.8%</td><td rowspan=1 colspan=1>68.2%</td><td rowspan=1 colspan=1>69.5%</td><td rowspan=1 colspan=1>70.2%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>2 hidden layers</td><td rowspan=1 colspan=1>66.2%</td><td rowspan=1 colspan=1>70.9%</td><td rowspan=1 colspan=1>73.4%</td><td rowspan=1 colspan=1>74.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1> 3 hidden layers</td><td rowspan=1 colspan=1>66.8%</td><td rowspan=1 colspan=1>71.0%</td><td rowspan=1 colspan=1>73.0%</td><td rowspan=1 colspan=1>73.9%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>4 hidden layers</td><td rowspan=1 colspan=1>66.7%</td><td rowspan=1 colspan=1>69.5%</td><td rowspan=1 colspan=1>71.6%</td><td rowspan=1 colspan=1>72.0%</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1> 5 hidden layers</td><td rowspan=1 colspan=1>66.4%</td><td rowspan=1 colspan=1>70.0%</td><td rowspan=1 colspan=1>71.4%</td><td rowspan=1 colspan=1>71.5%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>1 conv. layer,1 max-pool,Bottleneck</td><td rowspan=1 colspan=1>84.5%</td><td rowspan=1 colspan=1>86.3%</td><td rowspan=1 colspan=1>87.3%</td><td rowspan=1 colspan=1>87.7%</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>2 conv. layers,2 max-pool</td><td rowspan=1 colspan=1>87.9%</td><td rowspan=1 colspan=1>89.3%</td><td rowspan=1 colspan=1>90.0%</td><td rowspan=1 colspan=1>90.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>3 conv. layers,3 max-pool</td><td rowspan=1 colspan=1>90.7%</td><td rowspan=1 colspan=1>91.6%</td><td rowspan=1 colspan=1>91.9%</td><td rowspan=1 colspan=1>92.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>4 conv. layers, 3 max-pool</td><td rowspan=1 colspan=1>91.3%</td><td rowspan=1 colspan=1>91.8%</td><td rowspan=1 colspan=1>92.6%</td><td rowspan=1 colspan=1>92.6%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>SNN-ECNN-MIMIC-30k 128c-p-1200L-30ktrained on ensemble (Ba and Caruana, 2014)</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>85.8%</td></tr></table>
115
+
116
+ the ensemble of 16 deep CNNs. For comparison, the accuracy of the ensemble trained by Ba and Caruana (2014)) is included at the bottom of the table.
117
+
118
+ Table 2 summarizes the results after Bayesian hyperparameter optimization for student models of different depths and number of parameters trained on soft targets (average logits) to mimic the teacher ensemble of 16 deep CNNs. For comparison, the student model trained by Ba and Caruana (2014) also is shown.
119
+
120
+ The first four rows in Table 1 show the accuracy of convolutional models with 10 million parameters and 1, 2, 3, and 4 convolutional layers. The accuracies of these same architectures with 1M, 3.16M, 10M, and 31.6M parameters when trained as students on the soft targets predicted by the teacher ensemble are shown in Table 2. Comparing the accuracies of the models with 10 million parameters in both tables, we see that training student models to mimic the ensemble leads to significantly better accuracy in every case. The gains are more pronounced for shallower models, most likely because their learnable internal representations do not naturally lead to good generalization in this task when trained on the 0/1 hard targets: the difference in accuracy for models with one convolutional layer is $2 . 7 \%$ $8 7 . 3 \%$ vs. $8 4 . 6 \%$ ) and only $0 . 8 \%$ $( 9 2 . 6 \%$ vs. $9 1 . 8 \%$ ) for models with four convolutional layers.
121
+
122
+ ![](images/0082c0a75b1f8b77dc2efccde110dfe0dd765f7fd4fb418e2d13ba653c8021d6.jpg)
123
+ Figure 1: Accuracy of student models with different architectures trained to mimic the CIFAR10 ensemble. The average performance of the five best models of each hyperparameter-optimization experiment is shown, together with dashed lines indicating the accuracy of the best and the fifth best model from each setting. The short horizontal lines at 10M parameters are the accuracy of models trained without compression on the original 0/1 hard targets.
124
+
125
+ Figure 1 summarizes the results in Table 2 for student models of different depth, number of convolutional layers, and number of parameters when trained to mimic the ensemble teacher model. Student models trained on the ensemble logits are able to achieve accuracies previously unseen on CIFAR-10 for models with so few layers. Also, it is clear that there is a huge gap between the convolutional student models at the top of the figure, and the non-convolutional student models at the bottom of the figure: the most accurate student MLP has accuracy less than $7 5 \%$ , while the least accurate convolutional student model with the same number of parameters but only one convolutional layer has accuracy above $87 \%$ . And the accuracy of the convolutional student models increases further as more layers of convolution are added. Interestingly, the most accurate student MLPs with no convolutional layers have only 2 or 3 hidden layers; the student MLPs with 4 or 5 hidden layers are not as accurate.
126
+
127
+ Comparing the student MLP with only one hidden layer (bottom of the graph) to the student CNN with 1 convolutional layer clearly suggests that convolution is critical for this problem even when models are trained via distillation, and that it is very unlikely that a shallow non-convolutional model with 100 million parameters or less could ever achieve accuracy comparable to a convolutional model. It appears that if convolution is critical for teacher models trained on the original 0/1 hard targets, it is likely to be critical for student models trained to mimic these teacher models. Adding depth to the student MLPs without adding convolution does not significantly close this “convolutional gap”.
128
+
129
+ Furthermore, comparing student CNNs with 1, 2, 3, and 4 convolutional layers, it is clear that CNN students benefit from multiple convolutional layers. Although the students do not need as many layers as teacher models trained on the original $_ { 0 / 1 }$ hard targets, accuracy increases significantly as multiple convolutional layers are added to the model. For example, the best student with only one convolutional layer has $8 7 . 7 \%$ accuracy, while the student with the same number of parameters (31M) and 4 convolutional layers has $9 2 . 6 \%$ accuracy.
130
+
131
+ Figure 1 includes short horizontal lines at 10M parameters indicating the accuracy of non-student models trained on the original 0/1 hard targets instead of on the soft targets. This “compression gap” is largest for shallower models, and as expected disappears as the student models become architecturally more similar to the teacher models with multiple layers of convolution. The benefits of distillation are most significant for shallow models, yielding an increase in accuracy of $3 \%$ or more.
132
+
133
+ One pattern that is clear in the graph is that all student models benefit when the number of parameters increases from 1 million to 31 million parameters. It is interesting to note, however, that the largest student (31M) with a one convolutional layer is less accurate than the smallest student (1M) with two convolutional layers, further demonstrating the value of depth in convolutional models.
134
+
135
+ In summary, depth-constrained student models trained to mimic a high-accuracy ensemble of deep convolutional models perform better than similar models trained on the original hard targets (the “compression” gaps in Figure 1), student models need at least 3-4 convolutional layers to have high accuracy on CIFAR-10, shallow students with no convolutional layers perform poorly on CIFAR-10, and student models need at least 3-10M parameters to perform well. We are not able to compress deep convolutional models to shallow student models without significant loss of accuracy.
136
+
137
+ We are currently running a reduced set of experiments on ImageNet, though the chances of shallow models performing well on a more challenging problem such as ImageNet appear to be slim.
138
+
139
+ # 4 DISCUSSION
140
+
141
+ Although we are not able to train shallow models to be as accurate as deep models, the models trained via distillation are the most accurate models of their architecture ever trained on CIFAR-10. For example, the best single-layer fully-connected MLP (no convolution) we trained achieved an accuracy of $7 0 . 2 \%$ . We believe this to be the most accurate shallow MLP ever reported for CIFAR-10 (in comparison to $6 3 . 1 \%$ achieved by Le et al. (2013), $6 3 . 9 \%$ by Memisevic et al. (2015) and $6 4 . 3 \%$ b y Geras and Sutton (2015)). Although this model cannot compete with convolutional models, clearly distillation helps when training models that are limited by architecture and/or number of parameters. Similarly, the student models we trained with 1, 2, 3, and 4 convolutional layers are, we believe, the most accurate convnets of those depths reported in the literature. For example, the ensemble teacher model in Ba and Caruana (2014) was an ensemble of four CNNs, each of which had 3 convolutional layers, but only achieved $89 \%$ accuracy, whereas the single student CNNs we train via distillation achieve accuracies above $90 \%$ with only 2 convolutional layers, and above $92 \%$ with 3 convolutional layers. The only other work we are aware of that achieves comparable high accuracy with non-convolutional MLPs is recent work by Lin et al. (2016). They train multi-layer Z-Lin networks, and use a powerful form of data augmentation based on deformations that we did not use.
142
+
143
+ Interestingly, we noticed that mimic networks perform consistently worse when trained using dropout. This surprised us, and suggests that training student models on the soft-targets from a teacher provides significant regularization for the student models obviating the need for extra regularization methods such as dropout. This is consistent with the observation made by Ba and Caruana (2014) that student mimic models did not seem to overfit. Hinton et al. (2015) claim that soft targets convey more information per sample than Boolean hard targets. The also suggest that the dark knowledge in the soft targets for other classes further helped regularization, and that early stopping was unnecessary. Romero et al. (2015) extend distillation by using the intermediate representations learned by the teacher as hints to guide training deep students, and teacher confidences further help regularization by providing a measure of sample simplicity to the student, akin to curriculum learning. In other work, Pereyra et al. (2017) suggest that the soft targets provided by a teacher provide a form of confidence penalty that penalizes low entropy distributions and label smoothing, both of which improve regularization by maintaining a reasonable ratio between the logits of incorrect classes.
144
+
145
+ Zhang et al. (2016) question the traditional view of regularization in deep models. Although they do not discuss distillation, they suggest that in deep learning traditional function approximation appears to be deeply intertwined with massive memorization. The multiple soft targets used to train student models have a high information density (Hinton et al., 2015) and thus provide regularization by reducing the impact of brute-force memorization.
146
+
147
+ # 5 CONCLUSIONS
148
+
149
+ We train shallow nets with and without convolution to mimic state-of-the-art deep convolutional nets. If one controls for the number of learnable parameters, nets containing a single fully-connected non-linear layer and no convolutional layers are not able to learn functions as accurate as deeper convolutional models. This result is consistent with those reported in Ba and Caruana (2014). However, we also find that shallow nets that contain only 1-2 convolutional layers also are unable to achieve accuracy comparable to deeper models if the same number of parameters are used in the shallow and deep models. Deep convolutional nets are significantly more accurate than shallow convolutional models, given the same parameter budget. We do, however, see evidence that model compression allows accurate models to be trained that are shallower and have fewer convolutional layers than the deep convolutional architectures needed to learn high-accuracy models from the original 1-hot hard-target training data. The question remains why extra layers are required to train accurate models from the original training data.
150
+
151
+ # REFERENCES
152
+
153
+ Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In NIPS, 2014.
154
+
155
+ Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian J. Goodfellow, Arnaud Bergeron, Nicolas Bouchard, and Yoshua Bengio. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012.
156
+ James Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: a CPU and GPU math expression compiler. In SciPy, 2010.
157
+ Cristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDD, 2006.
158
+ William Chan, Nan Rosemary Ke, and Ian Laner. Transferring knowledge from a RNN to a DNN. arXiv:1504.01483, 2015.
159
+ Nadav Cohen and Amnon Shashua. Convolutional rectifier networks as generalized tensor decompositions. arXiv preprint arXiv:1603.00162, 2016.
160
+ George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, 1989.
161
+ Yann N. Dauphin and Yoshua Bengio. Big neural networks waste capacity. arXiv:1301.3583, 2013.
162
+ David Eigen, Jason Rolfe, Rob Fergus, and Yann LeCun. Understanding deep architectures using a recursive convolutional network. In ICLR (workshop track), 2014.
163
+ Krzysztof J. Geras and Charles Sutton. Scheduled denoising autoencoders. In ICLR, 2015.
164
+ Krzysztof J. Geras, Abdel-rahman Mohamed, Rich Caruana, Gregor Urban, Shengjie Wang, Ozlem Aslan, Matthai Philipose, Matthew Richardson, and Charles Sutton. Blending LSTMs into CNNs. arXiv:1511.06433, 2015.
165
+ Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010.
166
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv:1512.03385, 2015.
167
+ Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv:1503.02531, 2015.
168
+ Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
169
+ Quoc Le, Tamás Sarlós, and Alexander Smola. Fastfood-computing hilbert space expansions in loglinear time. In ICML, 2013.
170
+ Jinyu Li, Rui Zhao, Jui-Ting Huang, and Yifan Gong. Learning small-size dnn with output-distribution-based criteria. In INTERSPEECH, 2014.
171
+ Shiyu Liang and R Srikant. Why deep neural networks? arXiv preprint arXiv:1610.04161, 2016.
172
+ Zhouhan Lin, Roland Memisevic, Shaoqing Ren, and Kishore Konda. How far can we go without convolution: Improving fully-connected networks. arXiv:1511.02580v1, 2016.
173
+ Roland Memisevic, Kishore Konda, and David Krueger. Zero-bias autoencoders and the benefits of co-adapting features. In ICLR, 2015.
174
+ Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In ICLR, 2016.
175
+ Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing output distributions. ICLR, 2017.
176
+ Adriana Romero, Ballas Nicolas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. FitNets: Hints for thin deep nets. ICLR, 2015.
177
+ Andrei A. Rusu, Sergio Gomez Colmenarejo, Çaglar Gülçehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. In ICLR, 2016.
178
+ Frank Seide, Gang Li, and Dong Yu. Conversational speech transcription using context-dependent deep neural networks. In INTERSPEECH, 2011.
179
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2014.
180
+ Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. NIPS, 2012.
181
+ Jasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Md Patwary, Mostofa Ali, Ryan P Adams, et al. Scalable bayesian optimization using deep neural networks. In ICML, 2015.
182
+ Rupesh K Srivastava, Klaus Greff, and Juergen Schmidhuber. Training very deep networks. In NIPS, 2015.
183
+ Antonio Torralba, Robert Fergus, and William T. Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. TPAMI, 30(11), 2008.
184
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
185
+
186
+ # 6 APPENDIX
187
+
188
+ # 6.1 DETAILS OF TRAINING THE TEACHER MODELS
189
+
190
+ Weights of trained nets are initialized as in Glorot and Bengio (2010). The models trained in Section 2.7 contain eight convolutional layers organized into three groups (2-2-4) and two fully-connected hidden layers. The Bayesian hyperparameter optimization controls four constants $C _ { 1 } , C _ { 2 } , C _ { 3 } , H _ { 1 }$ all in the range [0, 1] that are then linearly transformed to the number of filters/neurons in each layer. The hyperparameters for which ranges were not shown in Section 2.7 are: the four separate dropout rates $( \mathrm { D O c _ { 1 } }$ , $\mathrm { D O c } _ { 2 }$ , $\mathrm { D O c } _ { 3 }$ , DOf) and the five constants $D _ { h } , D _ { s } , D _ { v } , A _ { s } , A _ { v }$ controlling the HSV data augmentation. The ranges we selected are $\mathrm { D O c } _ { 1 } \in [ 0 . 1 , 0 . 3 ]$ , $\mathrm { D O c } _ { 2 } \in [ 0 . 2 5 , 0 . 3 5$ ], $\mathrm { D O c } _ { 3 } \in [ 0 . 3 , 0 . 4 4 ]$ , $\mathrm { D O f _ { 1 } } \in [ 0 . 2 , 0 . 6 5 ]$ , $\mathrm { D O f _ { 2 } } \in [ 0 . 2 , 0 . 6 5 ]$ , $D _ { h } \in$ [0.03, 0.11], $D _ { s } \in [ 0 . 2 , 0 . 3 ]$ , $\bar { D } _ { v } \in [ 0 . 0 , 0 . 2 ]$ , $A _ { s } \in [ 0 . 2 , 0 . 3 ]$ ], $A _ { v } \in [ 0 . 0 3 , 0 . 2 ]$ , partly guided by Snoek et al. (2015) and visual inspection of the resulting augmentations.
191
+
192
+ The number of filters and hidden units for the models have the following bounds:
193
+ 1 conv. layer: $5 0 - 5 0 0$ filters, 200 - 2000 hidden units, number of units in bottleneck is the dependent variable. 2 conv. layers: 50 - 500 filters, $1 0 0 - 4 0 0$ filters, number of hidden units is the dependent variable.
194
+ 3 conv. layers: 50 - 500 filters (layer 1), 100 - 300 filters (layers 2-3), # of hidden units is dependent the variable. 4 conv. layers: 50 - 300 filters (layers 1-2), $1 0 0 \textmd { - } 3 0 0$ filters (layers 3-4), # of hidden units is the dependent variable.
195
+
196
+ All convolutional filters in the model are sized $3 \times 3$ , max-pooling is applied over windows of $2 \times 2$ and we use ReLU units throughout all our models. We apply dropout after each max-pooling layer with the three rates $\mathrm { D O c _ { 1 } }$ , $\mathrm { D O c } _ { 2 }$ , $\mathrm { D O c } _ { 3 }$ and after each of the two fully-connected layers with the same rate DOf.
197
+
198
+ Table 3: Optimization bounds for student models. (Models trained on 0/1 hard targets were described in Sections 6.1 and 6.2.) Abbreviations: fc (fully-connected layer, ReLu), c (convolutional, ReLu), linear (fully-connected bottleneck layer, linear activation function), dependent (dependent variable, chosen s.t. parameter budget is met).
199
+
200
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>18tlayer</td><td rowspan=1 colspan=2>2nd layer</td><td rowspan=1 colspan=1>3rd layer</td><td rowspan=1 colspan=1>4th layer</td><td rowspan=1 colspan=1>5thlayer</td></tr><tr><td rowspan=1 colspan=1>No conv. layer (1M)No conv. layer (3.1M)No conv.layer (10M)No conv.layer (31M)</td><td rowspan=1 colspan=1>500-5000 (fc)1000-20000 (fc)5000-30000 (fc)5000-45000 (fc)</td><td rowspan=1 colspan=2>dependent (linear)dependent (linear)dependent (linear)dependent (linear)</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 conv. layer (1M)1 conv. layer (3.1M)1 conv. layer (10M)1 conv. layer (31M)</td><td rowspan=1 colspan=1>40-150 (c)50-300 (c)50-450 (c)200-600 (c)</td><td rowspan=1 colspan=2>dependent (linear)dependent (linear)dependent (linear)dependent (linear)</td><td rowspan=1 colspan=1>200-1600 (fc)100-4000 (fc)500-20000 (fc)1000-4100 (fc)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>2 conv. layers (1M)2 conv. layers (3.1M)2 conv. layers (10M)2 conv. layers (31M)</td><td rowspan=1 colspan=1>20-120 (c)50-250 (c)50-350 (c)50-800(c)</td><td rowspan=1 colspan=2>20-120 (c)20-120 (c)20-120 (c)20-120 (c)</td><td rowspan=1 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>3 conv.layers (1M)3conv.layers (3.1M)3conv.1layers (10M)3conv.layers (31M)</td><td rowspan=1 colspan=1>20-110 (c)40-200 (c)50-350 (c)50-650(c)</td><td rowspan=1 colspan=2>20-110(c)40-200 (c)50-350(c)50-650 (c)</td><td rowspan=1 colspan=1>20-110 (c)40-200 (c)50-350(c)50-650(c)</td><td rowspan=1 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>4 conv.layers (1M)4 conv.1layers (3.1M)4 conv. layers (10M)4 conv. layers (31M)</td><td rowspan=1 colspan=1>25-100 (c)50 -150 (c)</td><td rowspan=1 colspan=1>25- 100 (c)50-150 (c)</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1>25- 100 (c)50-200 (c)50-350 (c)50-650 (c)</td><td rowspan=2 colspan=1>25-100 (c)50-200 (c)50-350 (c)50-650(c)</td><td rowspan=2 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td></tr><tr><td rowspan=1 colspan=1>50-300 (c)50-500 (c)</td><td rowspan=1 colspan=1>50-300 (c)50-500 (c)</td><td rowspan=1 colspan=1></td></tr></table>
201
+
202
+ 6.2 DETAILS OF TRAINING MODELS OF VARIOUS DEPTHS ON CIFAR-10 HARD 0/1 LABELS
203
+
204
+ Models in the first four rows in Table 1 are trained similarly to those in Section 6.1, and are architecturally equivalent to the four convolutional student models shown in Table 2 with 10 million parameters. The following hyperparameters are optimized: initial learning rate [0.0015, 0.025] (optimized on a log scale), momentum [0.68, 0.97] (optimized on a log scale), constants $C _ { 1 } , C _ { 2 } \in [ 0 , 1 ]$ that control the number of filters or neurons in different layers, and up to four different dropout rates $\mathrm { D O c } _ { 1 } \in [ 0 . 0 5 , 0 . 4 ]$ ], $\mathrm { D O c } _ { 2 } \in [ 0 . 1 , 0 .$ 6], $\mathrm { D O c } _ { 3 } ~ \in$ [0.1, 0.7], $\mathrm { D O f _ { 1 } } \in [ 0 . 1 , \bar { 0 . 7 } ]$ for the different layers. Weight decay was set to $\dot { 2 } \cdot 1 0 ^ { - 4 }$ and we used the same data augmentation settings as for the student models. We use $5 \times 5$ convolutional filters, one nonlinear hidden layer in each model and each max-pooling operation is followed by dropout with a separately optimized rate. We use $2 \times 2$ max-pooling except in the model with only one convolutional layer where we apply $3 \times 3$ pooling as this seemed to boost performance and reduces the number of parameters.
205
+
206
+ 6.3 DETAILS OF TRAINING STUDENT MODELS OF VARIOUS DEPTHS ON ENSEMBLE LABELS
207
+
208
+ Our student models have the same architecture as models in Section 6.2. The model without convolutional layers consists of one linear layer that acts as a bottleneck followed by a hidden layer of ReLU units. The following hyperparameters are optimized: initial learning rate [0.0013, 0.016] (optimized on a log scale), momentum [0.68, 0.97] (optimized on a log scale), input-scale $\in [ 0 . 8 , 1 . 2 5 ]$ , global initialization scale (after initialization) $\in [ 0 . 4 , 2 . 0 ]$ , layer-width constants $C _ { 1 } , C _ { 2 } \in [ 0 , 1 ]$ that control the number of filters or neurons. The exact ranges for the number of filters and implicitly resulting number of hidden units was chosen for all twenty optimization experiments independently, as architectures, number of units and number of parameters strongly interact.
209
+
210
+ For the non-convolutional models we chose a slightly different hyper-parameterization. Given that all layers (in models with “two layers” or more) are nonlinear and fully connected we treat all of them similarly from the hyperparameter-optimizer’s point of view. In order to smoothly enforce the parameter budgets without rejecting any samples from the Bayesian optimizer we instead optimize the ratios of hidden units in each layer (numbers between 0 and 1), and then re-normalize and scale them to the final number of neurons in each layer to match the target parameter budget.
211
+
212
+ As expected, adding capacity to the convolutional students (top of the figure) modestly increases their accuracy. Preliminary results for the MLPs however (too preliminary to include in the graph) may not show the same increase in accuracy with increasing model size. Models with two or three hidden layers may benefit from adding capacity to each layer, but we have yet to see any benefit from adding capacity to the MLPs with four or five hidden layers.
213
+
214
+ ![](images/b84549ec0e97bdce5073b1ee1c8f0a6b395edf4cb9dbe60905a2e2cb2332deb3.jpg)
215
+ Figure 2 is similar to 1 but includes preliminary results from experiments for models with 100M parameters. We are also running experiments with 300M parameters. Unfortunately, Bayesian optimization on models with 100M and 300M parameters is even more expensive than for the other points in the graph.
216
+ Figure 2: See figure 1.
parse/train/r10FA8Kxg/r10FA8Kxg_content_list.json ADDED
@@ -0,0 +1,1043 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "DO DEEP CONVOLUTIONAL NETS REALLY NEED TO BE DEEP AND CONVOLUTIONAL? ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 825,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Gregor Urban1, Krzysztof J. Geras2, Samira Ebrahimi Kahou3, Ozlem Aslan4, Shengjie Wang5, Abdelrahman Mohamed6, Matthai Philipose6, Matt Richardson6, Rich Caruana6 ",
17
+ "bbox": [
18
+ 183,
19
+ 169,
20
+ 856,
21
+ 199
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "1UC Irvine, USA \n2University of Edinburgh, UK \n3Ecole Polytechnique de Montreal, CA \n4University of Alberta, CA \n5University of Washington, USA \n6Microsoft Research, USA ",
28
+ "bbox": [
29
+ 184,
30
+ 200,
31
+ 441,
32
+ 285
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "ABSTRACT ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 454,
42
+ 321,
43
+ 544,
44
+ 337
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Yes, they do. This paper provides the first empirical demonstration that deep convolutional models really need to be both deep and convolutional, even when trained with methods such as distillation that allow small or shallow models of high accuracy to be trained. Although previous research showed that shallow feed-forward nets sometimes can learn the complex functions previously learned by deep nets while using the same number of parameters as the deep models they mimic, in this paper we demonstrate that the same methods cannot be used to train accurate models on CIFAR-10 unless the student models contain multiple layers of convolution. Although the student models do not have to be as deep as the teacher model they mimic, the students need multiple convolutional layers to learn functions of comparable accuracy as the deep convolutional teacher. ",
51
+ "bbox": [
52
+ 233,
53
+ 353,
54
+ 764,
55
+ 505
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 531,
66
+ 336,
67
+ 546
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Cybenko (1989) proved that a network with a large enough single hidden layer of sigmoid units can approximate any decision boundary. Empirical work, however, suggests that it can be difficult to train shallow nets to be as accurate as deep nets. Dauphin and Bengio (2013) trained shallow nets on SIFT features to classify a large-scale ImageNet dataset and found that it was difficult to train large, high-accuracy, shallow nets. A study of deep convolutional nets suggests that for vision tasks deeper models are preferred under a parameter budget (e.g. Eigen et al. (2014); He et al. (2015); Simonyan and Zisserman (2014); Srivastava et al. (2015)). Similarly, Seide et al. (2011) and Geras et al. (2015) show that deeper models are more accurate than shallow models in speech acoustic modeling. More recently, Romero et al. (2015) showed that it is possible to gain increases in accuracy in models with few parameters by training deeper, thinner nets (FitNets) to mimic much wider nets. Cohen and Shashua (2016); Liang and Srikant (2016) suggest that the representational efficiency of deep networks scales exponentially with depth, but it is unclear if this applies only to pathological problems, or is encountered in practice on data sets such as TIMIT and CIFAR. ",
74
+ "bbox": [
75
+ 174,
76
+ 563,
77
+ 825,
78
+ 742
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Ba and Caruana (2014), however, demonstrated that shallow nets sometimes can learn the functions learned by deep nets, even when restricted to the same number of parameters as the deep nets. They did this by first training state-of-the-art deep models, and then training shallow models to mimic the deep models. Surprisingly, and for reasons that are not well understood, the shallow models learned more accurate functions when trained to mimic the deep models than when trained on the original data used to train the deep models. In some cases shallow models trained this way were as accurate as state-of-the-art deep models. But this demonstration was made on the TIMIT speech recognition benchmark. Although their deep teacher models used a convolutional layer, convolution is less important for TIMIT than it is for other domains such as image classification. ",
85
+ "bbox": [
86
+ 174,
87
+ 750,
88
+ 825,
89
+ 875
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Ba and Caruana (2014) also presented results on CIFAR-10 which showed that a shallow model could learn functions almost as accurate as deep convolutional nets. Unfortunately, the results on CIFAR-10 are less convincing than those for TIMIT. To train accurate shallow models on CIFAR-10 they had to include at least one convolutional layer in the shallow model, and increased the number of parameters in the shallow model until it was 30 times larger than the deep teacher model. Despite this, the shallow convolutional student model was several points less accurate than a teacher model that was itself several points less accurate than state-of-the-art models on CIFAR-10. ",
96
+ "bbox": [
97
+ 176,
98
+ 882,
99
+ 823,
100
+ 922
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 174,
109
+ 103,
110
+ 823,
111
+ 159
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "In this paper we show that the methods Ba and Caruana used to train shallow students to mimic deep teacher models on TIMIT do not work as well on problems such as CIFAR-10 where multiple layers of convolution are required to train accurate teacher models. If the student models have a similar number of parameters as the deep teacher models, high accuracy can not be achieved without multiple layers of convolution even when the student models are trained via distillation. ",
118
+ "bbox": [
119
+ 174,
120
+ 166,
121
+ 823,
122
+ 236
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "To ensure that the shallow student models are trained as accurately as possible, we use Bayesian optimization to thoroughly explore the space of architectures and learning hyperparameters. Although this combination of distillation and hyperparameter optimization allows us to train the most accurate shallow models ever trained on CIFAR-10, the shallow models still are not as accurate as deep models. Our results clearly suggest that deep convolutional nets do, in fact, need to be both deep and convolutional, even when trained to mimic very accurate models via distillation (Hinton et al., 2015). ",
129
+ "bbox": [
130
+ 174,
131
+ 243,
132
+ 825,
133
+ 327
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "2 TRAINING SHALLOW NETS TO MIMIC DEEPER CONVOLUTIONAL NETS ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 173,
143
+ 349,
144
+ 797,
145
+ 366
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "In this paper, we revisit the CIFAR-10 experiments in Ba and Caruana (2014). Unlike in that work, here we compare shallow models to state-of-the-art deep convolutional models, and restrict the number of parameters in the shallow student models to be comparable to the number of parameters in the deep convolutional teacher models. Because we anticipated that our results might be different, we follow their approach closely to eliminate the possibility that the results differ merely because of changes in methodology. Note that the goal of this paper is not to train models that are small or fast as in Bucila et al. (2006), Hinton et al. (2015), and Romero et al. (2015), but to examine if shallow models can be as accurate as deep convolutional models given the same parameter budget. ",
152
+ "bbox": [
153
+ 174,
154
+ 382,
155
+ 825,
156
+ 494
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "There are many steps required to train shallow student models to be as accurate as possible: train state-of-the-art deep convolutional teacher models, form an ensemble of the best deep models, collect and combine their predictions on a large transfer set, and then train carefully optimized shallow student models to mimic the teacher ensemble. For negative results to be informative, it is important that each of these steps be performed as well as possible. In this section we describe the experimental methodology in detail. Readers familiar with distillation (model compression), training deep models on CIFAR-10, data augmentation, and Bayesian hyperparameter optimization may wish to skip to the empirical results in Section 3. ",
163
+ "bbox": [
164
+ 174,
165
+ 501,
166
+ 825,
167
+ 612
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "2.1 MODEL COMPRESSION AND DISTILLATION ",
174
+ "text_level": 1,
175
+ "bbox": [
176
+ 174,
177
+ 632,
178
+ 514,
179
+ 646
180
+ ],
181
+ "page_idx": 1
182
+ },
183
+ {
184
+ "type": "text",
185
+ "text": "The key idea behind model compression is to train a compact model to approximate the function learned by another larger, more complex model. Bucila et al. (2006) showed how a single neural net of modest size could be trained to mimic a much larger ensemble. Although the small neural nets contained $1 0 0 0 \\times$ fewer parameters, often they were as accurate as the large ensembles they were trained to mimic. ",
186
+ "bbox": [
187
+ 174,
188
+ 659,
189
+ 823,
190
+ 728
191
+ ],
192
+ "page_idx": 1
193
+ },
194
+ {
195
+ "type": "text",
196
+ "text": "Model compression works by passing unlabeled data through the large, accurate teacher model to collect the real-valued scores it predicts, and then training a student model to mimic these scores. Hinton et al. (2015) generalized the methods of Bucila et al. (2006) and Ba and Caruana (2014) by incorporating a parameter to control the relative importance of the soft targets provided by the teacher model to the hard targets in the original training data, as well as a temperature parameter that regularizes learning by pushing targets towards the uniform distribution. Hinton et al. (2015) also demonstrated that much of the knowledge passed from the teacher to the student is conveyed as dark knowledge contained in the relative scores (probabilities) of outputs corresponding to other classes, as opposed to the scores given to just the output for the one correct class. ",
197
+ "bbox": [
198
+ 174,
199
+ 734,
200
+ 825,
201
+ 861
202
+ ],
203
+ "page_idx": 1
204
+ },
205
+ {
206
+ "type": "text",
207
+ "text": "Surprisingly, distillation often allows smaller and/or shallower models to be trained that are nearly as accurate as the larger, deeper models they are trained to mimic, yet these same small models are not as accurate when trained on the 1-hot hard targets in the original training set. The reason for this is not yet well understood. Similar compression and distillation methods have also successfully been used in speech recognition (e.g. Chan et al. (2015); Geras et al. (2015); Li et al. (2014)) and reinforcement learning Parisotto et al. (2016); Rusu et al. (2016). Romero et al. (2015) showed that distillation methods can be used to train small students that are more accurate than the teacher models by making the student models deeper, but thinner, than the teacher model. ",
208
+ "bbox": [
209
+ 176,
210
+ 867,
211
+ 823,
212
+ 924
213
+ ],
214
+ "page_idx": 1
215
+ },
216
+ {
217
+ "type": "text",
218
+ "text": "",
219
+ "bbox": [
220
+ 174,
221
+ 103,
222
+ 825,
223
+ 159
224
+ ],
225
+ "page_idx": 2
226
+ },
227
+ {
228
+ "type": "text",
229
+ "text": "2.2 MIMIC LEARNING VIA L2 REGRESSION ON LOGITS ",
230
+ "text_level": 1,
231
+ "bbox": [
232
+ 174,
233
+ 176,
234
+ 571,
235
+ 190
236
+ ],
237
+ "page_idx": 2
238
+ },
239
+ {
240
+ "type": "text",
241
+ "text": "We train shallow mimic nets using data labeled by an ensemble of deep teacher nets trained on the original 1-hot CIFAR-10 training data. The deep teacher models are trained in the usual way using softmax outputs and cross-entropy cost function. Following Ba and Caruana (2014), the student mimic models are not trained with cross-entropy on the ten $p$ values where $\\textstyle p _ { k } = e ^ { z _ { k } } / \\sum _ { j } e ^ { z _ { j } }$ output by the softmax layer from the deep teacher model, but instead are trained on the un-normalized log probability values $z$ (the logits) before the softmax activation. Training on the logarithms of predicted probabilities (logits) helps provide the dark knowledge that regularizes students by placing emphasis on the relationships learned by the teacher model across all of the outputs. ",
242
+ "bbox": [
243
+ 173,
244
+ 202,
245
+ 825,
246
+ 315
247
+ ],
248
+ "page_idx": 2
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "As in Ba and Caruana (2014), the student is trained as a regression problem given training data $\\{ ( x ^ { ( 1 ) } , z ^ { ( 1 ) } ) , . . . , ( x ^ { ( T ) } , z ^ { ( T ) } ) \\}$ : ",
253
+ "bbox": [
254
+ 173,
255
+ 321,
256
+ 821,
257
+ 352
258
+ ],
259
+ "page_idx": 2
260
+ },
261
+ {
262
+ "type": "equation",
263
+ "img_path": "images/d2c82989bdc254517fa3b794c0c3c21a00cad875b6274382c86487e90e1fa983.jpg",
264
+ "text": "$$\n\\mathcal { L } ( W ) = \\frac { 1 } { T } \\sum _ { t } | | g ( x ^ { ( t ) } ; W ) - z ^ { ( t ) } | | _ { 2 } ^ { 2 } ,\n$$",
265
+ "text_format": "latex",
266
+ "bbox": [
267
+ 369,
268
+ 363,
269
+ 627,
270
+ 401
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "where $W$ represents all of the weights in the network, and $g ( x ^ { ( t ) } ; W )$ is the model prediction on the $t ^ { t h }$ training data sample. ",
277
+ "bbox": [
278
+ 173,
279
+ 410,
280
+ 823,
281
+ 439
282
+ ],
283
+ "page_idx": 2
284
+ },
285
+ {
286
+ "type": "text",
287
+ "text": "2.3 USING A LINEAR BOTTLENECK TO SPEED UP TRAINING ",
288
+ "text_level": 1,
289
+ "bbox": [
290
+ 174,
291
+ 455,
292
+ 606,
293
+ 470
294
+ ],
295
+ "page_idx": 2
296
+ },
297
+ {
298
+ "type": "text",
299
+ "text": "A shallow net has to have more hidden units in each layer to match the number of parameters in a deep net. Ba and Caruana (2014) found that training these wide, shallow mimic models with backpropagation was slow, and introduced a linear bottleneck layer between the input and non-linear layers to speed learning. The bottleneck layer speeds learning by reducing the number of parameters that must be learned, but does not make the model deeper because the linear terms can be absorbed back into the non-linear weight matrix after learning. See Ba and Caruana (2014) for details. To match their experiments we use linear bottlenecks when training student models with 0 or 1 convolutional layers, but did not find the linear bottlenecks necessary when training student models with more than 1 convolutional layer. ",
300
+ "bbox": [
301
+ 174,
302
+ 481,
303
+ 825,
304
+ 607
305
+ ],
306
+ "page_idx": 2
307
+ },
308
+ {
309
+ "type": "text",
310
+ "text": "2.4 BAYESIAN HYPERPARAMETER OPTIMIZATION ",
311
+ "text_level": 1,
312
+ "bbox": [
313
+ 174,
314
+ 625,
315
+ 534,
316
+ 638
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "text",
322
+ "text": "The goal of this work is to determine empirically if shallow nets can be trained to be as accurate as deep convolutional models using a similar number of parameters in the deep and shallow models. If we succeed in training a shallow model to be as accurate as a deep convolutional model, this provides an existence proof that shallow models can represent and learn the complex functions learned by deep convolutional models. If, however, we are unable to train shallow models to be as accurate as deep convolutional nets, we might fail only because we did not train the shallow nets well enough. ",
323
+ "bbox": [
324
+ 174,
325
+ 650,
326
+ 825,
327
+ 734
328
+ ],
329
+ "page_idx": 2
330
+ },
331
+ {
332
+ "type": "text",
333
+ "text": "In all our experiments we employ Bayesian hyperparameter optimization using Gaussian process regression to ensure that we thoroughly and objectively explore the hyperparameters that govern learning. The implementation we use is Spearmint (Snoek et al., 2012). The hyperparameters we optimize with Bayesian optimization include the initial learning rate, momentum, scaling of the initial random weights, scaling of the inputs, and terms that determine the width of each of the network’s layers (i.e. number of convolutional filters and neurons). More details of the hyperparameter optimization can be found in Sections 2.5, 2.7, 2.8 and in the Appendix. ",
334
+ "bbox": [
335
+ 174,
336
+ 741,
337
+ 825,
338
+ 839
339
+ ],
340
+ "page_idx": 2
341
+ },
342
+ {
343
+ "type": "text",
344
+ "text": "2.5 TRAINING DATA AND DATA AUGMENTATION ",
345
+ "text_level": 1,
346
+ "bbox": [
347
+ 174,
348
+ 854,
349
+ 526,
350
+ 869
351
+ ],
352
+ "page_idx": 2
353
+ },
354
+ {
355
+ "type": "text",
356
+ "text": "The CIFAR-10 (Krizhevsky, 2009) data set consists of a set of natural images from 10 different object classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck. The dataset is a labeled subset of the 80 million tiny images dataset (Torralba et al., 2008) and is divided into 50,000 train and ",
357
+ "bbox": [
358
+ 176,
359
+ 882,
360
+ 825,
361
+ 924
362
+ ],
363
+ "page_idx": 2
364
+ },
365
+ {
366
+ "type": "text",
367
+ "text": "10,000 test images. Each image is $3 2 \\times 3 2$ pixels in 3 color channels, yielding input vectors with 3072 dimensions. We prepared the data by subtracting the mean and dividing by the standard deviation of each image vector. We train all models on a subset of 40,000 images and use the remaining 10,000 images as the validation set for the Bayesian optimization. The final trained models only used $80 \\%$ of the theoretically available training data (as opposed to retraining on all of the data after hyperparameter optimization). ",
368
+ "bbox": [
369
+ 174,
370
+ 103,
371
+ 825,
372
+ 188
373
+ ],
374
+ "page_idx": 3
375
+ },
376
+ {
377
+ "type": "text",
378
+ "text": "We employ the HSV-data augmentation technique as described by Snoek et al. (2015). Thus we shift hue, saturation and value by uniform random values: $\\Delta _ { h } \\sim U ( - D _ { h } , D _ { h } )$ , $\\Delta _ { s } \\sim$ $U ( - D _ { s } , D _ { s } )$ , $\\Delta _ { v } ~ \\sim ~ U ( - D _ { v } , D _ { v } )$ . Saturation and value values are scaled globally: $a _ { s } \\sim$ $\\begin{array} { r } { U ( \\frac { 1 } { 1 + A _ { s } } , 1 + A _ { s } ) , a _ { v } \\sim U ( \\frac { 1 } { 1 + A _ { v } } , 1 + A _ { v } ) } \\end{array}$ . The five constants $D _ { h } , D _ { s } , D _ { v } , A _ { s } , A _ { v }$ are treated as additional hyperparameters in the Bayesian hyperparameter optimization. ",
379
+ "bbox": [
380
+ 174,
381
+ 194,
382
+ 825,
383
+ 265
384
+ ],
385
+ "page_idx": 3
386
+ },
387
+ {
388
+ "type": "text",
389
+ "text": "All training images are mirrored left-right randomly with a probability of 0.5. The input images are further scaled and jittered randomly by cropping windows of size $2 4 \\times 2 4$ up to $3 2 \\times 3 2$ at random locations and then scaling them back to $3 2 \\times 3 2$ . The procedure is as follows: we sample an integer value $S \\sim U ( 2 4 , 3 2 )$ and then a pair of integers $x , y \\sim U ( 0 , 3 2 - S )$ . The transformed resulting image is $R = f _ { \\mathrm { s p l i n e } , 3 } ( I [ x : x + S , y : y + S ] )$ with $I$ denoting the original image and $f _ { \\mathrm { s p l i n e , 3 } }$ denoting the 3rd order spline interpolation function that maps the 2D array back to $3 2 \\times 3 2$ (applied to the three color channels separately). ",
390
+ "bbox": [
391
+ 174,
392
+ 272,
393
+ 825,
394
+ 369
395
+ ],
396
+ "page_idx": 3
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "All data augmentations for the teacher models are computed on the fly using different random seeds. For student models trained to mimic the ensemble (see Section 2.7 for details of the ensemble teacher model), we pre-generated 160 epochs worth of randomly augmented training data, evaluated the ensemble’s predictions (logits) on these samples, and saved all data and predictions to disk. All student models thus see the same training data in the same order. The parameters for HSV-augmentation in this case had to be selected beforehand; we chose to use the settings found with the best single model $( D _ { h } = 0 . 0 6 , D _ { s } = 0 . 2 6 , D _ { v } = 0 . 2 0 , A _ { s } = 0 . 2 1 , A _ { v } = 0 . 1 3 )$ . Pre-saving the logits and augmented data is important to reduce the computational cost at training time, and to ensure that all student models see the same training data ",
401
+ "bbox": [
402
+ 174,
403
+ 377,
404
+ 825,
405
+ 502
406
+ ],
407
+ "page_idx": 3
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "Because augmentation allows us to generate large training sets from the original 50,000 images, we use augmented data as the transfer set for model compression. No extra unlabeled data is required. ",
412
+ "bbox": [
413
+ 174,
414
+ 508,
415
+ 825,
416
+ 536
417
+ ],
418
+ "page_idx": 3
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "2.6 LEARNING-RATE SCHEDULE ",
423
+ "text_level": 1,
424
+ "bbox": [
425
+ 176,
426
+ 556,
427
+ 415,
428
+ 570
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "text",
434
+ "text": "We train all models using SGD with Nesterov momentum. The initial learning rate and momentum are chosen by Bayesian optimization. The learning rate is reduced according to the evolution of the model’s validation error: it is halved if the validation error does not drop for ten epochs in a row. It is not reduced within the next eight epochs following a reduction step. Training ends if the error did not drop for 30 epochs in a row or if the learning rate was reduced by a factor of more than 2000 in total. ",
435
+ "bbox": [
436
+ 174,
437
+ 583,
438
+ 825,
439
+ 654
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "This schedule provides a way to train the highly varying models in a fair manner (it is not feasible to optimize all of the parameters that define the learning schedule). It also decreases the time spent to train each model compared to using a hand-selected overestimate of the number of epochs to train, thus allowing us to train more models in the hyperparameter search. ",
446
+ "bbox": [
447
+ 176,
448
+ 660,
449
+ 825,
450
+ 717
451
+ ],
452
+ "page_idx": 3
453
+ },
454
+ {
455
+ "type": "text",
456
+ "text": "2.7 SUPER TEACHER: AN ENSEMBLE OF 16 DEEP CONVOLUTIONAL CIFAR-10 MODELS ",
457
+ "bbox": [
458
+ 174,
459
+ 736,
460
+ 803,
461
+ 751
462
+ ],
463
+ "page_idx": 3
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "One limitation of the CIFAR-10 experiments performed in Ba and Caruana (2014) is that the teacher models were not state-of-the-art. The best deep models they trained on CIFAR-10 had only $8 8 \\%$ accuracy, and the ensemble of deep models they used as a teacher had only $8 9 \\%$ accuracy. The accuracies were not state-of-the-art because they did not use augmentation and because their deepest models had only three convolutional layers. Because our goal is to determine if shallow models can be as accurate as deep convolutional models, it is important that the deep models we compare to (and use as teachers) are as accurate as possible. ",
468
+ "bbox": [
469
+ 174,
470
+ 762,
471
+ 825,
472
+ 861
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "We train deep neural networks with eight convolutional layers, three intermittent max-pooling layers and two fully-connected hidden layers. We include the size of these layers in the hyperparameter optimization, by allowing the first two convolutional layers to contain from 32 to 96 filters each, the next two layers to contain from 64 to 192 filters, and the last four convolutional layers to contain from 128 to 384 filters. The two fully-connected hidden layers can contain from 512 to 1536 neurons. We parametrize these model-sizes by four scalars (the layers are grouped as 2-2-4) and include the scalars in the hyperparameter optimization. All models are trained using Theano (Bastien et al., 2012; Bergstra et al., 2010). ",
479
+ "bbox": [
480
+ 174,
481
+ 867,
482
+ 823,
483
+ 922
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "",
490
+ "bbox": [
491
+ 174,
492
+ 103,
493
+ 825,
494
+ 159
495
+ ],
496
+ "page_idx": 4
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "We optimize eighteen hyperparameters overall: initial learning rate on [0.01, 0.05], momentum on [0.80, 0.91], $l _ { 2 }$ weight decay on $[ 5 \\cdot 1 0 ^ { - 5 } , 4 \\cdot 1 0 ^ { - 4 } ]$ , initialization coefficient on [0.8, 1.35] which scales the initial weights of the CNN, four separate dropout rates, five constants controlling the HSV data augmentation, and the four scaling constants controlling the networks’ layer widths. The learning rate and momentum are optimized on a log-scale (as opposed to linear scale) by optimizing the exponent with appropriate bounds, e.g. $L R = e ^ { - x }$ optimized over $x$ on [3.0, 4.6]. See the Appendix for more details about hyperparameter optimization. ",
501
+ "bbox": [
502
+ 174,
503
+ 166,
504
+ 825,
505
+ 265
506
+ ],
507
+ "page_idx": 4
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "We trained 129 deep CNN models with Spearmint. The best model obtained an accuracy of $9 2 . 7 8 \\%$ the fifth best achieved $9 2 . 6 7 \\%$ . See Table 1 for the sizes and architectures of the three best models. ",
512
+ "bbox": [
513
+ 176,
514
+ 270,
515
+ 823,
516
+ 299
517
+ ],
518
+ "page_idx": 4
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "We are able to construct a more accurate model on CIFAR-10 by forming an ensemble of multiple deep convolutional neural nets, each trained with different hyperparameters, and each seeing slightly different training data (as the augmentation parameters vary). We experimented with a number of ensembles of the many deep convnets we trained, using accuracy on the validation set to select the best combination. The final ensemble contained 16 deep convnets and had an accuracy of $9 4 . 0 \\%$ o n the validation set, and $9 3 . 8 \\%$ on the final test set. We believe this is among the top published results for deep learning on CIFAR-10. The ensemble averages the logits predicted by each model before the softmax layers. ",
523
+ "bbox": [
524
+ 174,
525
+ 306,
526
+ 825,
527
+ 417
528
+ ],
529
+ "page_idx": 4
530
+ },
531
+ {
532
+ "type": "text",
533
+ "text": "We used this very accurate ensemble model as the teacher model to label the data used to train the shallower student nets. As described in Section 2.2, the logits (the scores just prior to the final softmax layer) from each of the CNN teachers in the ensemble model are averaged for each class, and the average logits are used as final regression targets to train the shallower student neural nets. ",
534
+ "bbox": [
535
+ 174,
536
+ 424,
537
+ 825,
538
+ 479
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "2.8 TRAINING SHALLOW STUDENT MODELS TO MIMIC AN ENSEMBLE OF DEEP CONVOLUTIONAL MODELS ",
545
+ "bbox": [
546
+ 176,
547
+ 500,
548
+ 740,
549
+ 527
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "We trained student mimic nets with 1, $3 . 1 6 ^ { 1 }$ , 10 and 31.6 million trainable parameters on the pre-computed augmented training data (Section 2.5) that was re-labeled by the teacher ensemble (Section 2.7). For each of the four student sizes we trained shallow fully-connected student MLPs containing 1, 2, 3, 4, or 5 layers of non-linear units (ReLU), and student CNNs with 1, 2, 3 or 4 convolutional layers. The convolutional student models also contain one fully-connected ReLU layer. Models with zero or only one convolutional layer contain an additional linear bottleneck layer to speed up learning (cf. Section 2.3). We did not need to use a bottleneck to speed up learning for the deeper models as the number of learnable parameters is naturally reduced by the max-pooling layers. ",
556
+ "bbox": [
557
+ 173,
558
+ 540,
559
+ 825,
560
+ 651
561
+ ],
562
+ "page_idx": 4
563
+ },
564
+ {
565
+ "type": "text",
566
+ "text": "The student CNNs use max-pooling and Bayesian optimization controls the number of convolutional filters and hidden units in each layer. The hyperparameters we optimized in the student models are: initial learning rate, momentum, scaling of the initially randomly distributed learnable parameters, scaling of all pixel values of the input, and the scale factors that control the width of all hidden and convolutional layers in the model. Weights are initialized as in Glorot and Bengio (2010). We intentionally do not optimize and do not make use of weight decay and dropout when training student models because preliminary experiments showed that these consistently reduced the accuracy of student models by several percent. Please refer to the Appendix for more details on the individual architectures and hyperparameter ranges. ",
567
+ "bbox": [
568
+ 174,
569
+ 659,
570
+ 825,
571
+ 784
572
+ ],
573
+ "page_idx": 4
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "3 EMPIRICAL RESULTS ",
578
+ "text_level": 1,
579
+ "bbox": [
580
+ 176,
581
+ 806,
582
+ 382,
583
+ 821
584
+ ],
585
+ "page_idx": 4
586
+ },
587
+ {
588
+ "type": "text",
589
+ "text": "Table 1 summarizes results after Bayesian hyperparameter optimization for models trained on the original 0/1 hard CIFAR-10 labels. All of these models use weight decay and are trained with the dropout hyperparameters included in the Bayesian optimization. The table shows the accuracy of the best three deep convolutional models we could train on CIFAR-10, as well as the accuracy of ",
590
+ "bbox": [
591
+ 174,
592
+ 839,
593
+ 825,
594
+ 895
595
+ ],
596
+ "page_idx": 4
597
+ },
598
+ {
599
+ "type": "table",
600
+ "img_path": "images/a3aa0a852bb4a73a34cc69ceb2a0fb46c9d816d3a45fd05608e2c66b02e80dcb.jpg",
601
+ "table_caption": [
602
+ "Table 1: Accuracy on CIFAR-10 of shallow and deep models trained on the original 0/1 hard class labels using Bayesian optimization with dropout and weight decay. Key: ${ \\mathfrak { c } } =$ convolution layer; mp $=$ max-pooling layer; fc $=$ fully-connected layer; lfc $=$ linear bottleneck layer; exponents indicate repetitions of a layer. The last two models $( ^ { * } )$ are numbers reported by Ba and Caruana (2014). The models with 1-4 convolutional layers at the top of the table are included for comparison with student models of similar architecture in Table 2 . All of the student models in Table 2 with 1, 2, 3, and 4 convolutional layers are more accurate than their counterparts in this table that are trained on the original 0/1 hard targets — as expected distillation yields shallow models of higher accuracy than shallow models trained on the original training data. "
603
+ ],
604
+ "table_footnote": [],
605
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1># parameters</td><td rowspan=1 colspan=1> Accuracy</td></tr><tr><td rowspan=1 colspan=1>1 conv. layer</td><td rowspan=1 colspan=1>c-mp-lfc-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>84.6%</td></tr><tr><td rowspan=1 colspan=1>2 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>88.9%</td></tr><tr><td rowspan=1 colspan=1>3 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>91.2%</td></tr><tr><td rowspan=1 colspan=1>4 conv. layer</td><td rowspan=1 colspan=1>c-mp-c-c-mp-c-mp-fc</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>91.75%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 1st</td><td rowspan=1 colspan=1>76c2-mp-126c2-mp-148c4-mp-1200fc²</td><td rowspan=1 colspan=1>5.3M</td><td rowspan=1 colspan=1>92.78%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 2nd</td><td rowspan=1 colspan=1>96c2-mp-171c2-mp-128c4-mp-512fc²</td><td rowspan=1 colspan=1>2.5M</td><td rowspan=1 colspan=1>92.77%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN 3rd</td><td rowspan=1 colspan=1>54c²-mp-158c²-mp-189c4-mp-1044fc²</td><td rowspan=1 colspan=1>5.8M</td><td rowspan=1 colspan=1>92.67%</td></tr><tr><td rowspan=1 colspan=1>Ensemble of 16 CNNs</td><td rowspan=1 colspan=1>c²-mp-c²-mp-c4-mp-fc²</td><td rowspan=1 colspan=1>83.4M</td><td rowspan=1 colspan=1>93.8%</td></tr><tr><td rowspan=1 colspan=1>Teacher CNN (*)</td><td rowspan=1 colspan=1>128c-mp-128c-mp-128c-mp-1k fc</td><td rowspan=1 colspan=1>2.1M</td><td rowspan=1 colspan=1>88.0%</td></tr><tr><td rowspan=1 colspan=1>Ensemble, 4 CNNs (*)</td><td rowspan=1 colspan=1>128c-mp-128c-mp-128c-mp-1k fc</td><td rowspan=1 colspan=1>8.6M</td><td rowspan=1 colspan=1>89.0%</td></tr></table>",
606
+ "bbox": [
607
+ 176,
608
+ 272,
609
+ 812,
610
+ 498
611
+ ],
612
+ "page_idx": 5
613
+ },
614
+ {
615
+ "type": "text",
616
+ "text": "Table 2: Comparison of student models with varying number of convolutional layers trained to mimic the ensemble of 16 deep convolutional CIFAR-10 models in Table 1 . The best performing student models have 3 – 4 convolutional layers and $1 0 \\mathbf { M } - 3 1 . 6 \\mathbf { M }$ parameters. The student models in this table are more accurate than the models of the same architecture in Table 1 that were trained on the original 0/1 hard targets — shallow models trained with distillation are more accurate than shallow models trained on $_ { 0 / 1 }$ hard targets. The student model trained by Ba and Caruana (2014) is shown in the last line for comparison; it is less accurate and much larger than the student models trained here that also have 1 convolutional layer. ",
617
+ "bbox": [
618
+ 173,
619
+ 559,
620
+ 825,
621
+ 671
622
+ ],
623
+ "page_idx": 5
624
+ },
625
+ {
626
+ "type": "table",
627
+ "img_path": "images/02dac6c244720a560f58f0f50349a18d7b1adb7d80b667a020217990081fa5c9.jpg",
628
+ "table_caption": [],
629
+ "table_footnote": [],
630
+ "table_body": "<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>1M</td><td rowspan=1 colspan=1>3.16M</td><td rowspan=1 colspan=1>10M</td><td rowspan=1 colspan=1>31.6M</td><td rowspan=1 colspan=1>70M</td></tr><tr><td rowspan=1 colspan=1>Bottleneck,1 hidden layer</td><td rowspan=1 colspan=1>65.8%</td><td rowspan=1 colspan=1>68.2%</td><td rowspan=1 colspan=1>69.5%</td><td rowspan=1 colspan=1>70.2%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>2 hidden layers</td><td rowspan=1 colspan=1>66.2%</td><td rowspan=1 colspan=1>70.9%</td><td rowspan=1 colspan=1>73.4%</td><td rowspan=1 colspan=1>74.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1> 3 hidden layers</td><td rowspan=1 colspan=1>66.8%</td><td rowspan=1 colspan=1>71.0%</td><td rowspan=1 colspan=1>73.0%</td><td rowspan=1 colspan=1>73.9%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>4 hidden layers</td><td rowspan=1 colspan=1>66.7%</td><td rowspan=1 colspan=1>69.5%</td><td rowspan=1 colspan=1>71.6%</td><td rowspan=1 colspan=1>72.0%</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1> 5 hidden layers</td><td rowspan=1 colspan=1>66.4%</td><td rowspan=1 colspan=1>70.0%</td><td rowspan=1 colspan=1>71.4%</td><td rowspan=1 colspan=1>71.5%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>1 conv. layer,1 max-pool,Bottleneck</td><td rowspan=1 colspan=1>84.5%</td><td rowspan=1 colspan=1>86.3%</td><td rowspan=1 colspan=1>87.3%</td><td rowspan=1 colspan=1>87.7%</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>2 conv. layers,2 max-pool</td><td rowspan=1 colspan=1>87.9%</td><td rowspan=1 colspan=1>89.3%</td><td rowspan=1 colspan=1>90.0%</td><td rowspan=1 colspan=1>90.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>3 conv. layers,3 max-pool</td><td rowspan=1 colspan=1>90.7%</td><td rowspan=1 colspan=1>91.6%</td><td rowspan=1 colspan=1>91.9%</td><td rowspan=1 colspan=1>92.3%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>4 conv. layers, 3 max-pool</td><td rowspan=1 colspan=1>91.3%</td><td rowspan=1 colspan=1>91.8%</td><td rowspan=1 colspan=1>92.6%</td><td rowspan=1 colspan=1>92.6%</td><td rowspan=1 colspan=1>二</td></tr><tr><td rowspan=1 colspan=1>SNN-ECNN-MIMIC-30k 128c-p-1200L-30ktrained on ensemble (Ba and Caruana, 2014)</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>85.8%</td></tr></table>",
631
+ "bbox": [
632
+ 176,
633
+ 679,
634
+ 813,
635
+ 907
636
+ ],
637
+ "page_idx": 5
638
+ },
639
+ {
640
+ "type": "text",
641
+ "text": "the ensemble of 16 deep CNNs. For comparison, the accuracy of the ensemble trained by Ba and Caruana (2014)) is included at the bottom of the table. ",
642
+ "bbox": [
643
+ 171,
644
+ 103,
645
+ 823,
646
+ 132
647
+ ],
648
+ "page_idx": 6
649
+ },
650
+ {
651
+ "type": "text",
652
+ "text": "Table 2 summarizes the results after Bayesian hyperparameter optimization for student models of different depths and number of parameters trained on soft targets (average logits) to mimic the teacher ensemble of 16 deep CNNs. For comparison, the student model trained by Ba and Caruana (2014) also is shown. ",
653
+ "bbox": [
654
+ 174,
655
+ 140,
656
+ 483,
657
+ 236
658
+ ],
659
+ "page_idx": 6
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "The first four rows in Table 1 show the accuracy of convolutional models with 10 million parameters and 1, 2, 3, and 4 convolutional layers. The accuracies of these same architectures with 1M, 3.16M, 10M, and 31.6M parameters when trained as students on the soft targets predicted by the teacher ensemble are shown in Table 2. Comparing the accuracies of the models with 10 million parameters in both tables, we see that training student models to mimic the ensemble leads to significantly better accuracy in every case. The gains are more pronounced for shallower models, most likely because their learnable internal representations do not naturally lead to good generalization in this task when trained on the 0/1 hard targets: the difference in accuracy for models with one convolutional layer is $2 . 7 \\%$ $8 7 . 3 \\%$ vs. $8 4 . 6 \\%$ ) and only $0 . 8 \\%$ $( 9 2 . 6 \\%$ vs. $9 1 . 8 \\%$ ) for models with four convolutional layers. ",
664
+ "bbox": [
665
+ 174,
666
+ 242,
667
+ 485,
668
+ 520
669
+ ],
670
+ "page_idx": 6
671
+ },
672
+ {
673
+ "type": "image",
674
+ "img_path": "images/0082c0a75b1f8b77dc2efccde110dfe0dd765f7fd4fb418e2d13ba653c8021d6.jpg",
675
+ "image_caption": [
676
+ "Figure 1: Accuracy of student models with different architectures trained to mimic the CIFAR10 ensemble. The average performance of the five best models of each hyperparameter-optimization experiment is shown, together with dashed lines indicating the accuracy of the best and the fifth best model from each setting. The short horizontal lines at 10M parameters are the accuracy of models trained without compression on the original 0/1 hard targets. "
677
+ ],
678
+ "image_footnote": [],
679
+ "bbox": [
680
+ 511,
681
+ 147,
682
+ 834,
683
+ 636
684
+ ],
685
+ "page_idx": 6
686
+ },
687
+ {
688
+ "type": "text",
689
+ "text": "Figure 1 summarizes the results in Table 2 for student models of different depth, number of convolutional layers, and number of parameters when trained to mimic the ensemble teacher model. Student models trained on the ensemble logits are able to achieve accuracies previously unseen on CIFAR-10 for models with so few layers. Also, it is clear that there is a huge gap between the convolutional student models at the top of the figure, and the non-convolutional student models at the bottom of the figure: the most accurate student MLP has accuracy less than $7 5 \\%$ , while the least accurate convolutional student model with the same number of parameters but only one convolutional layer has accuracy above $87 \\%$ . And the accuracy of the convolutional student models increases further as more layers of convolution are added. Interestingly, the most accurate student MLPs with no convolutional layers have only 2 or 3 hidden layers; the student MLPs with 4 or 5 hidden layers are not as accurate. ",
690
+ "bbox": [
691
+ 174,
692
+ 529,
693
+ 485,
694
+ 832
695
+ ],
696
+ "page_idx": 6
697
+ },
698
+ {
699
+ "type": "text",
700
+ "text": "Comparing the student MLP with only one hidden layer (bottom of the graph) to the student CNN with 1 convolutional layer clearly suggests that convolution is critical for this problem even when models are trained via distillation, and that it is very unlikely that a shallow non-convolutional model with 100 million parameters or less could ever achieve accuracy comparable to a convolutional model. It appears that if convolution is critical for teacher models trained on the original 0/1 hard targets, it is likely to be critical for student models trained to mimic these teacher models. Adding depth to the student MLPs without adding convolution does not significantly close this “convolutional gap”. ",
701
+ "bbox": [
702
+ 174,
703
+ 839,
704
+ 825,
705
+ 910
706
+ ],
707
+ "page_idx": 6
708
+ },
709
+ {
710
+ "type": "text",
711
+ "text": "",
712
+ "bbox": [
713
+ 173,
714
+ 103,
715
+ 823,
716
+ 132
717
+ ],
718
+ "page_idx": 7
719
+ },
720
+ {
721
+ "type": "text",
722
+ "text": "Furthermore, comparing student CNNs with 1, 2, 3, and 4 convolutional layers, it is clear that CNN students benefit from multiple convolutional layers. Although the students do not need as many layers as teacher models trained on the original $_ { 0 / 1 }$ hard targets, accuracy increases significantly as multiple convolutional layers are added to the model. For example, the best student with only one convolutional layer has $8 7 . 7 \\%$ accuracy, while the student with the same number of parameters (31M) and 4 convolutional layers has $9 2 . 6 \\%$ accuracy. ",
723
+ "bbox": [
724
+ 174,
725
+ 138,
726
+ 825,
727
+ 222
728
+ ],
729
+ "page_idx": 7
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "Figure 1 includes short horizontal lines at 10M parameters indicating the accuracy of non-student models trained on the original 0/1 hard targets instead of on the soft targets. This “compression gap” is largest for shallower models, and as expected disappears as the student models become architecturally more similar to the teacher models with multiple layers of convolution. The benefits of distillation are most significant for shallow models, yielding an increase in accuracy of $3 \\%$ or more. ",
734
+ "bbox": [
735
+ 174,
736
+ 229,
737
+ 825,
738
+ 299
739
+ ],
740
+ "page_idx": 7
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "One pattern that is clear in the graph is that all student models benefit when the number of parameters increases from 1 million to 31 million parameters. It is interesting to note, however, that the largest student (31M) with a one convolutional layer is less accurate than the smallest student (1M) with two convolutional layers, further demonstrating the value of depth in convolutional models. ",
745
+ "bbox": [
746
+ 174,
747
+ 306,
748
+ 823,
749
+ 362
750
+ ],
751
+ "page_idx": 7
752
+ },
753
+ {
754
+ "type": "text",
755
+ "text": "In summary, depth-constrained student models trained to mimic a high-accuracy ensemble of deep convolutional models perform better than similar models trained on the original hard targets (the “compression” gaps in Figure 1), student models need at least 3-4 convolutional layers to have high accuracy on CIFAR-10, shallow students with no convolutional layers perform poorly on CIFAR-10, and student models need at least 3-10M parameters to perform well. We are not able to compress deep convolutional models to shallow student models without significant loss of accuracy. ",
756
+ "bbox": [
757
+ 173,
758
+ 369,
759
+ 825,
760
+ 452
761
+ ],
762
+ "page_idx": 7
763
+ },
764
+ {
765
+ "type": "text",
766
+ "text": "We are currently running a reduced set of experiments on ImageNet, though the chances of shallow models performing well on a more challenging problem such as ImageNet appear to be slim. ",
767
+ "bbox": [
768
+ 176,
769
+ 459,
770
+ 823,
771
+ 488
772
+ ],
773
+ "page_idx": 7
774
+ },
775
+ {
776
+ "type": "text",
777
+ "text": "4 DISCUSSION ",
778
+ "text_level": 1,
779
+ "bbox": [
780
+ 174,
781
+ 502,
782
+ 310,
783
+ 518
784
+ ],
785
+ "page_idx": 7
786
+ },
787
+ {
788
+ "type": "text",
789
+ "text": "Although we are not able to train shallow models to be as accurate as deep models, the models trained via distillation are the most accurate models of their architecture ever trained on CIFAR-10. For example, the best single-layer fully-connected MLP (no convolution) we trained achieved an accuracy of $7 0 . 2 \\%$ . We believe this to be the most accurate shallow MLP ever reported for CIFAR-10 (in comparison to $6 3 . 1 \\%$ achieved by Le et al. (2013), $6 3 . 9 \\%$ by Memisevic et al. (2015) and $6 4 . 3 \\%$ b y Geras and Sutton (2015)). Although this model cannot compete with convolutional models, clearly distillation helps when training models that are limited by architecture and/or number of parameters. Similarly, the student models we trained with 1, 2, 3, and 4 convolutional layers are, we believe, the most accurate convnets of those depths reported in the literature. For example, the ensemble teacher model in Ba and Caruana (2014) was an ensemble of four CNNs, each of which had 3 convolutional layers, but only achieved $89 \\%$ accuracy, whereas the single student CNNs we train via distillation achieve accuracies above $90 \\%$ with only 2 convolutional layers, and above $92 \\%$ with 3 convolutional layers. The only other work we are aware of that achieves comparable high accuracy with non-convolutional MLPs is recent work by Lin et al. (2016). They train multi-layer Z-Lin networks, and use a powerful form of data augmentation based on deformations that we did not use. ",
790
+ "bbox": [
791
+ 174,
792
+ 529,
793
+ 825,
794
+ 736
795
+ ],
796
+ "page_idx": 7
797
+ },
798
+ {
799
+ "type": "text",
800
+ "text": "Interestingly, we noticed that mimic networks perform consistently worse when trained using dropout. This surprised us, and suggests that training student models on the soft-targets from a teacher provides significant regularization for the student models obviating the need for extra regularization methods such as dropout. This is consistent with the observation made by Ba and Caruana (2014) that student mimic models did not seem to overfit. Hinton et al. (2015) claim that soft targets convey more information per sample than Boolean hard targets. The also suggest that the dark knowledge in the soft targets for other classes further helped regularization, and that early stopping was unnecessary. Romero et al. (2015) extend distillation by using the intermediate representations learned by the teacher as hints to guide training deep students, and teacher confidences further help regularization by providing a measure of sample simplicity to the student, akin to curriculum learning. In other work, Pereyra et al. (2017) suggest that the soft targets provided by a teacher provide a form of confidence penalty that penalizes low entropy distributions and label smoothing, both of which improve regularization by maintaining a reasonable ratio between the logits of incorrect classes. ",
801
+ "bbox": [
802
+ 174,
803
+ 743,
804
+ 825,
805
+ 924
806
+ ],
807
+ "page_idx": 7
808
+ },
809
+ {
810
+ "type": "text",
811
+ "text": "Zhang et al. (2016) question the traditional view of regularization in deep models. Although they do not discuss distillation, they suggest that in deep learning traditional function approximation appears to be deeply intertwined with massive memorization. The multiple soft targets used to train student models have a high information density (Hinton et al., 2015) and thus provide regularization by reducing the impact of brute-force memorization. ",
812
+ "bbox": [
813
+ 174,
814
+ 103,
815
+ 825,
816
+ 172
817
+ ],
818
+ "page_idx": 8
819
+ },
820
+ {
821
+ "type": "text",
822
+ "text": "5 CONCLUSIONS ",
823
+ "text_level": 1,
824
+ "bbox": [
825
+ 176,
826
+ 194,
827
+ 328,
828
+ 210
829
+ ],
830
+ "page_idx": 8
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "We train shallow nets with and without convolution to mimic state-of-the-art deep convolutional nets. If one controls for the number of learnable parameters, nets containing a single fully-connected non-linear layer and no convolutional layers are not able to learn functions as accurate as deeper convolutional models. This result is consistent with those reported in Ba and Caruana (2014). However, we also find that shallow nets that contain only 1-2 convolutional layers also are unable to achieve accuracy comparable to deeper models if the same number of parameters are used in the shallow and deep models. Deep convolutional nets are significantly more accurate than shallow convolutional models, given the same parameter budget. We do, however, see evidence that model compression allows accurate models to be trained that are shallower and have fewer convolutional layers than the deep convolutional architectures needed to learn high-accuracy models from the original 1-hot hard-target training data. The question remains why extra layers are required to train accurate models from the original training data. ",
835
+ "bbox": [
836
+ 174,
837
+ 224,
838
+ 825,
839
+ 391
840
+ ],
841
+ "page_idx": 8
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "REFERENCES ",
846
+ "text_level": 1,
847
+ "bbox": [
848
+ 174,
849
+ 412,
850
+ 285,
851
+ 426
852
+ ],
853
+ "page_idx": 8
854
+ },
855
+ {
856
+ "type": "text",
857
+ "text": "Jimmy Ba and Rich Caruana. Do deep nets really need to be deep? In NIPS, 2014. ",
858
+ "bbox": [
859
+ 176,
860
+ 434,
861
+ 661,
862
+ 446
863
+ ],
864
+ "page_idx": 8
865
+ },
866
+ {
867
+ "type": "text",
868
+ "text": "Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian J. Goodfellow, Arnaud Bergeron, Nicolas Bouchard, and Yoshua Bengio. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012. \nJames Bergstra, Olivier Breuleux, Frédéric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: a CPU and GPU math expression compiler. In SciPy, 2010. \nCristian Bucila, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In KDD, 2006. \nWilliam Chan, Nan Rosemary Ke, and Ian Laner. Transferring knowledge from a RNN to a DNN. arXiv:1504.01483, 2015. \nNadav Cohen and Amnon Shashua. Convolutional rectifier networks as generalized tensor decompositions. arXiv preprint arXiv:1603.00162, 2016. \nGeorge Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, 1989. \nYann N. Dauphin and Yoshua Bengio. Big neural networks waste capacity. arXiv:1301.3583, 2013. \nDavid Eigen, Jason Rolfe, Rob Fergus, and Yann LeCun. Understanding deep architectures using a recursive convolutional network. In ICLR (workshop track), 2014. \nKrzysztof J. Geras and Charles Sutton. Scheduled denoising autoencoders. In ICLR, 2015. \nKrzysztof J. Geras, Abdel-rahman Mohamed, Rich Caruana, Gregor Urban, Shengjie Wang, Ozlem Aslan, Matthai Philipose, Matthew Richardson, and Charles Sutton. Blending LSTMs into CNNs. arXiv:1511.06433, 2015. \nXavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010. \nKaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv:1512.03385, 2015. \nGeoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv:1503.02531, 2015. \nAlex Krizhevsky. Learning multiple layers of features from tiny images, 2009. \nQuoc Le, Tamás Sarlós, and Alexander Smola. Fastfood-computing hilbert space expansions in loglinear time. In ICML, 2013. \nJinyu Li, Rui Zhao, Jui-Ting Huang, and Yifan Gong. Learning small-size dnn with output-distribution-based criteria. In INTERSPEECH, 2014. \nShiyu Liang and R Srikant. Why deep neural networks? arXiv preprint arXiv:1610.04161, 2016. \nZhouhan Lin, Roland Memisevic, Shaoqing Ren, and Kishore Konda. How far can we go without convolution: Improving fully-connected networks. arXiv:1511.02580v1, 2016. \nRoland Memisevic, Kishore Konda, and David Krueger. Zero-bias autoencoders and the benefits of co-adapting features. In ICLR, 2015. \nEmilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. In ICLR, 2016. \nGabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey Hinton. Regularizing neural networks by penalizing output distributions. ICLR, 2017. \nAdriana Romero, Ballas Nicolas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. FitNets: Hints for thin deep nets. ICLR, 2015. \nAndrei A. Rusu, Sergio Gomez Colmenarejo, Çaglar Gülçehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. In ICLR, 2016. \nFrank Seide, Gang Li, and Dong Yu. Conversational speech transcription using context-dependent deep neural networks. In INTERSPEECH, 2011. \nKaren Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2014. \nJasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. NIPS, 2012. \nJasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Md Patwary, Mostofa Ali, Ryan P Adams, et al. Scalable bayesian optimization using deep neural networks. In ICML, 2015. \nRupesh K Srivastava, Klaus Greff, and Juergen Schmidhuber. Training very deep networks. In NIPS, 2015. \nAntonio Torralba, Robert Fergus, and William T. Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. TPAMI, 30(11), 2008. \nChiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. ",
869
+ "bbox": [
870
+ 169,
871
+ 450,
872
+ 828,
873
+ 924
874
+ ],
875
+ "page_idx": 8
876
+ },
877
+ {
878
+ "type": "text",
879
+ "text": "",
880
+ "bbox": [
881
+ 171,
882
+ 90,
883
+ 828,
884
+ 647
885
+ ],
886
+ "page_idx": 9
887
+ },
888
+ {
889
+ "type": "text",
890
+ "text": "6 APPENDIX ",
891
+ "text_level": 1,
892
+ "bbox": [
893
+ 174,
894
+ 102,
895
+ 294,
896
+ 117
897
+ ],
898
+ "page_idx": 10
899
+ },
900
+ {
901
+ "type": "text",
902
+ "text": "6.1 DETAILS OF TRAINING THE TEACHER MODELS ",
903
+ "text_level": 1,
904
+ "bbox": [
905
+ 174,
906
+ 138,
907
+ 542,
908
+ 152
909
+ ],
910
+ "page_idx": 10
911
+ },
912
+ {
913
+ "type": "text",
914
+ "text": "Weights of trained nets are initialized as in Glorot and Bengio (2010). The models trained in Section 2.7 contain eight convolutional layers organized into three groups (2-2-4) and two fully-connected hidden layers. The Bayesian hyperparameter optimization controls four constants $C _ { 1 } , C _ { 2 } , C _ { 3 } , H _ { 1 }$ all in the range [0, 1] that are then linearly transformed to the number of filters/neurons in each layer. The hyperparameters for which ranges were not shown in Section 2.7 are: the four separate dropout rates $( \\mathrm { D O c _ { 1 } }$ , $\\mathrm { D O c } _ { 2 }$ , $\\mathrm { D O c } _ { 3 }$ , DOf) and the five constants $D _ { h } , D _ { s } , D _ { v } , A _ { s } , A _ { v }$ controlling the HSV data augmentation. The ranges we selected are $\\mathrm { D O c } _ { 1 } \\in [ 0 . 1 , 0 . 3 ]$ , $\\mathrm { D O c } _ { 2 } \\in [ 0 . 2 5 , 0 . 3 5$ ], $\\mathrm { D O c } _ { 3 } \\in [ 0 . 3 , 0 . 4 4 ]$ , $\\mathrm { D O f _ { 1 } } \\in [ 0 . 2 , 0 . 6 5 ]$ , $\\mathrm { D O f _ { 2 } } \\in [ 0 . 2 , 0 . 6 5 ]$ , $D _ { h } \\in$ [0.03, 0.11], $D _ { s } \\in [ 0 . 2 , 0 . 3 ]$ , $\\bar { D } _ { v } \\in [ 0 . 0 , 0 . 2 ]$ , $A _ { s } \\in [ 0 . 2 , 0 . 3 ]$ ], $A _ { v } \\in [ 0 . 0 3 , 0 . 2 ]$ , partly guided by Snoek et al. (2015) and visual inspection of the resulting augmentations. ",
915
+ "bbox": [
916
+ 173,
917
+ 166,
918
+ 826,
919
+ 282
920
+ ],
921
+ "page_idx": 10
922
+ },
923
+ {
924
+ "type": "text",
925
+ "text": "The number of filters and hidden units for the models have the following bounds: \n1 conv. layer: $5 0 - 5 0 0$ filters, 200 - 2000 hidden units, number of units in bottleneck is the dependent variable. 2 conv. layers: 50 - 500 filters, $1 0 0 - 4 0 0$ filters, number of hidden units is the dependent variable. \n3 conv. layers: 50 - 500 filters (layer 1), 100 - 300 filters (layers 2-3), # of hidden units is dependent the variable. 4 conv. layers: 50 - 300 filters (layers 1-2), $1 0 0 \\textmd { - } 3 0 0$ filters (layers 3-4), # of hidden units is the dependent variable. ",
926
+ "bbox": [
927
+ 174,
928
+ 287,
929
+ 825,
930
+ 364
931
+ ],
932
+ "page_idx": 10
933
+ },
934
+ {
935
+ "type": "text",
936
+ "text": "All convolutional filters in the model are sized $3 \\times 3$ , max-pooling is applied over windows of $2 \\times 2$ and we use ReLU units throughout all our models. We apply dropout after each max-pooling layer with the three rates $\\mathrm { D O c _ { 1 } }$ , $\\mathrm { D O c } _ { 2 }$ , $\\mathrm { D O c } _ { 3 }$ and after each of the two fully-connected layers with the same rate DOf. ",
937
+ "bbox": [
938
+ 174,
939
+ 371,
940
+ 825,
941
+ 410
942
+ ],
943
+ "page_idx": 10
944
+ },
945
+ {
946
+ "type": "table",
947
+ "img_path": "images/a1b1613e44fded02eebd8762cef50a40f0fbb57a372cfa78429bf98e4fc2f144.jpg",
948
+ "table_caption": [
949
+ "Table 3: Optimization bounds for student models. (Models trained on 0/1 hard targets were described in Sections 6.1 and 6.2.) Abbreviations: fc (fully-connected layer, ReLu), c (convolutional, ReLu), linear (fully-connected bottleneck layer, linear activation function), dependent (dependent variable, chosen s.t. parameter budget is met). "
950
+ ],
951
+ "table_footnote": [],
952
+ "table_body": "<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>18tlayer</td><td rowspan=1 colspan=2>2nd layer</td><td rowspan=1 colspan=1>3rd layer</td><td rowspan=1 colspan=1>4th layer</td><td rowspan=1 colspan=1>5thlayer</td></tr><tr><td rowspan=1 colspan=1>No conv. layer (1M)No conv. layer (3.1M)No conv.layer (10M)No conv.layer (31M)</td><td rowspan=1 colspan=1>500-5000 (fc)1000-20000 (fc)5000-30000 (fc)5000-45000 (fc)</td><td rowspan=1 colspan=2>dependent (linear)dependent (linear)dependent (linear)dependent (linear)</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 conv. layer (1M)1 conv. layer (3.1M)1 conv. layer (10M)1 conv. layer (31M)</td><td rowspan=1 colspan=1>40-150 (c)50-300 (c)50-450 (c)200-600 (c)</td><td rowspan=1 colspan=2>dependent (linear)dependent (linear)dependent (linear)dependent (linear)</td><td rowspan=1 colspan=1>200-1600 (fc)100-4000 (fc)500-20000 (fc)1000-4100 (fc)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>2 conv. layers (1M)2 conv. layers (3.1M)2 conv. layers (10M)2 conv. layers (31M)</td><td rowspan=1 colspan=1>20-120 (c)50-250 (c)50-350 (c)50-800(c)</td><td rowspan=1 colspan=2>20-120 (c)20-120 (c)20-120 (c)20-120 (c)</td><td rowspan=1 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>3 conv.layers (1M)3conv.layers (3.1M)3conv.1layers (10M)3conv.layers (31M)</td><td rowspan=1 colspan=1>20-110 (c)40-200 (c)50-350 (c)50-650(c)</td><td rowspan=1 colspan=2>20-110(c)40-200 (c)50-350(c)50-650 (c)</td><td rowspan=1 colspan=1>20-110 (c)40-200 (c)50-350(c)50-650(c)</td><td rowspan=1 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>4 conv.layers (1M)4 conv.1layers (3.1M)4 conv. layers (10M)4 conv. layers (31M)</td><td rowspan=1 colspan=1>25-100 (c)50 -150 (c)</td><td rowspan=1 colspan=1>25- 100 (c)50-150 (c)</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=1>25- 100 (c)50-200 (c)50-350 (c)50-650 (c)</td><td rowspan=2 colspan=1>25-100 (c)50-200 (c)50-350 (c)50-650(c)</td><td rowspan=2 colspan=1>dependent (fc)dependent (fc)dependent (fc)dependent (fc)</td></tr><tr><td rowspan=1 colspan=1>50-300 (c)50-500 (c)</td><td rowspan=1 colspan=1>50-300 (c)50-500 (c)</td><td rowspan=1 colspan=1></td></tr></table>",
953
+ "bbox": [
954
+ 199,
955
+ 507,
956
+ 792,
957
+ 724
958
+ ],
959
+ "page_idx": 10
960
+ },
961
+ {
962
+ "type": "text",
963
+ "text": "6.2 DETAILS OF TRAINING MODELS OF VARIOUS DEPTHS ON CIFAR-10 HARD 0/1 LABELS ",
964
+ "bbox": [
965
+ 176,
966
+ 767,
967
+ 821,
968
+ 782
969
+ ],
970
+ "page_idx": 10
971
+ },
972
+ {
973
+ "type": "text",
974
+ "text": "Models in the first four rows in Table 1 are trained similarly to those in Section 6.1, and are architecturally equivalent to the four convolutional student models shown in Table 2 with 10 million parameters. The following hyperparameters are optimized: initial learning rate [0.0015, 0.025] (optimized on a log scale), momentum [0.68, 0.97] (optimized on a log scale), constants $C _ { 1 } , C _ { 2 } \\in [ 0 , 1 ]$ that control the number of filters or neurons in different layers, and up to four different dropout rates $\\mathrm { D O c } _ { 1 } \\in [ 0 . 0 5 , 0 . 4 ]$ ], $\\mathrm { D O c } _ { 2 } \\in [ 0 . 1 , 0 .$ 6], $\\mathrm { D O c } _ { 3 } ~ \\in$ [0.1, 0.7], $\\mathrm { D O f _ { 1 } } \\in [ 0 . 1 , \\bar { 0 . 7 } ]$ for the different layers. Weight decay was set to $\\dot { 2 } \\cdot 1 0 ^ { - 4 }$ and we used the same data augmentation settings as for the student models. We use $5 \\times 5$ convolutional filters, one nonlinear hidden layer in each model and each max-pooling operation is followed by dropout with a separately optimized rate. We use $2 \\times 2$ max-pooling except in the model with only one convolutional layer where we apply $3 \\times 3$ pooling as this seemed to boost performance and reduces the number of parameters. ",
975
+ "bbox": [
976
+ 173,
977
+ 796,
978
+ 825,
979
+ 924
980
+ ],
981
+ "page_idx": 10
982
+ },
983
+ {
984
+ "type": "text",
985
+ "text": "6.3 DETAILS OF TRAINING STUDENT MODELS OF VARIOUS DEPTHS ON ENSEMBLE LABELS ",
986
+ "bbox": [
987
+ 173,
988
+ 103,
989
+ 823,
990
+ 117
991
+ ],
992
+ "page_idx": 11
993
+ },
994
+ {
995
+ "type": "text",
996
+ "text": "Our student models have the same architecture as models in Section 6.2. The model without convolutional layers consists of one linear layer that acts as a bottleneck followed by a hidden layer of ReLU units. The following hyperparameters are optimized: initial learning rate [0.0013, 0.016] (optimized on a log scale), momentum [0.68, 0.97] (optimized on a log scale), input-scale $\\in [ 0 . 8 , 1 . 2 5 ]$ , global initialization scale (after initialization) $\\in [ 0 . 4 , 2 . 0 ]$ , layer-width constants $C _ { 1 } , C _ { 2 } \\in [ 0 , 1 ]$ that control the number of filters or neurons. The exact ranges for the number of filters and implicitly resulting number of hidden units was chosen for all twenty optimization experiments independently, as architectures, number of units and number of parameters strongly interact. ",
997
+ "bbox": [
998
+ 174,
999
+ 128,
1000
+ 823,
1001
+ 218
1002
+ ],
1003
+ "page_idx": 11
1004
+ },
1005
+ {
1006
+ "type": "text",
1007
+ "text": "For the non-convolutional models we chose a slightly different hyper-parameterization. Given that all layers (in models with “two layers” or more) are nonlinear and fully connected we treat all of them similarly from the hyperparameter-optimizer’s point of view. In order to smoothly enforce the parameter budgets without rejecting any samples from the Bayesian optimizer we instead optimize the ratios of hidden units in each layer (numbers between 0 and 1), and then re-normalize and scale them to the final number of neurons in each layer to match the target parameter budget. ",
1008
+ "bbox": [
1009
+ 174,
1010
+ 224,
1011
+ 825,
1012
+ 300
1013
+ ],
1014
+ "page_idx": 11
1015
+ },
1016
+ {
1017
+ "type": "text",
1018
+ "text": "As expected, adding capacity to the convolutional students (top of the figure) modestly increases their accuracy. Preliminary results for the MLPs however (too preliminary to include in the graph) may not show the same increase in accuracy with increasing model size. Models with two or three hidden layers may benefit from adding capacity to each layer, but we have yet to see any benefit from adding capacity to the MLPs with four or five hidden layers. ",
1019
+ "bbox": [
1020
+ 174,
1021
+ 188,
1022
+ 483,
1023
+ 301
1024
+ ],
1025
+ "page_idx": 12
1026
+ },
1027
+ {
1028
+ "type": "image",
1029
+ "img_path": "images/b84549ec0e97bdce5073b1ee1c8f0a6b395edf4cb9dbe60905a2e2cb2332deb3.jpg",
1030
+ "image_caption": [
1031
+ "Figure 2 is similar to 1 but includes preliminary results from experiments for models with 100M parameters. We are also running experiments with 300M parameters. Unfortunately, Bayesian optimization on models with 100M and 300M parameters is even more expensive than for the other points in the graph. ",
1032
+ "Figure 2: See figure 1. "
1033
+ ],
1034
+ "image_footnote": [],
1035
+ "bbox": [
1036
+ 511,
1037
+ 99,
1038
+ 810,
1039
+ 587
1040
+ ],
1041
+ "page_idx": 12
1042
+ }
1043
+ ]
parse/train/r10FA8Kxg/r10FA8Kxg_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r10FA8Kxg/r10FA8Kxg_model.json ADDED
The diff for this file is too large to render. See raw diff