Datasets:
Add files using upload-large-folder tool
Browse files- parse/dev/ATiz_CDA66/ATiz_CDA66_middle.json +0 -0
- parse/dev/B72HXs80q4/B72HXs80q4.md +354 -0
- parse/dev/B72HXs80q4/B72HXs80q4_content_list.json +1910 -0
- parse/dev/B72HXs80q4/B72HXs80q4_middle.json +0 -0
- parse/dev/B72HXs80q4/B72HXs80q4_model.json +0 -0
- parse/dev/JTmO2V9Xpz/JTmO2V9Xpz_middle.json +0 -0
- parse/dev/PvOo1sHKzf/PvOo1sHKzf_content_list.json +0 -0
- parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9.md +472 -0
- parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9_content_list.json +0 -0
- parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9_model.json +0 -0
- parse/dev/URNZQmbxpwh/URNZQmbxpwh.md +0 -0
- parse/dev/URNZQmbxpwh/URNZQmbxpwh_content_list.json +0 -0
- parse/dev/URNZQmbxpwh/URNZQmbxpwh_middle.json +0 -0
- parse/dev/URNZQmbxpwh/URNZQmbxpwh_model.json +0 -0
- parse/dev/akddwRG6EGi/akddwRG6EGi_content_list.json +0 -0
- parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl.md +360 -0
- parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_content_list.json +1842 -0
- parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_middle.json +0 -0
- parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_model.json +0 -0
- parse/dev/tZmqS73_07/tZmqS73_07_middle.json +0 -0
parse/dev/ATiz_CDA66/ATiz_CDA66_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/B72HXs80q4/B72HXs80q4.md
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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ACTIVATED TRANSFORMER WITH STOCHASTIC EXPERTS
|
| 2 |
+
|
| 3 |
+
Simiao Zuo†∗, Xiaodong $\mathbf { L i u } ^ { \diamond }$ , Jian Jiao, Young Jin ${ \bf K i m } ^ { \diamond }$ , Hany Hassan, Ruofei Zhang, Tuo Zhao† and Jianfeng Gao
|
| 4 |
+
|
| 5 |
+
†Georgia Institute of Technology Microsoft
|
| 6 |
+
{simiaozuo,tourzhao}@gatech.edu,
|
| 7 |
+
{xiaodl,jian.jiao,youki,hanyh,bzhang,jfgao}@microsoft.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Sparsely activated models (SAMs), such as Mixture-of-Experts (MoE), can easily scale to have outrageously large amounts of parameters without significant increase in computational cost. However, SAMs are reported to be parameter inefficient such that larger models do not always lead to better performance. While most on-going research focuses on improving SAMs models by exploring methods of routing inputs to experts, our analysis reveals that such research might not lead to the solution we expect, i.e., the commonly-used routing methods based on gating mechanisms do not work better than randomly routing inputs to experts. In this paper, we propose a new expert-based model, THOR (Transformer witH StOchastic ExpeRts). Unlike classic expert-based models, such as the Switch Transformer (Fedus et al., 2021), experts in THOR are randomly activated for each input during training and inference. THOR models are trained using a consistency regularized loss, where experts learn not only from training data but also from other experts as teachers, such that all the experts make consistent predictions. We validate the effectiveness of THOR on machine translation tasks. Results show that THOR models are more parameter efficient in that they significantly outperform the Transformer and MoE models across various settings. For example, in multilingual translation, THOR outperforms the Switch Transformer by 2 BLEU scores, and obtains the same BLEU score as that of a state-of-the-art MoE model (Kim et al., 2021) that is 18 times larger. Our code is publicly available at: https://github.com/microsoft/ Stochastic-Mixture-of-Experts.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Large neural network models have shown to be effective in many natural language processing tasks such as machine translation (Lewis et al., 2020; Conneau & Lample, 2019), natural language understanding (Devlin et al., 2019; Liu et al., 2019; He et al., 2020), and natural language generation (Radford et al., 2019; Brown et al., 2020). These models are usually densely activated. That is, a model uses all its parameters to process all inputs. One drawback of these models is the prohibitive training cost. Moreover, the extreme size drastically reduces inference speed, further limiting the models’ practicality.
|
| 16 |
+
|
| 17 |
+
To address these issues, sparsely activated models (SAMs, Shazeer et al. 2017) have been proposed. A SAM adaptively selects a subset of its parameters for different inputs during model training and inference. This makes it possible to train SAMs that are an order of magnitude larger than densely activated models without significant increase in computational cost. For example, the sparsely activated GShard (Lepikhin et al., 2020) consists of over 600 billion parameters and the Switch Transformer (Fedus et al., 2021) 1.5 trillion parameters, while GPT-3 (Brown et al., 2020), which is arguably the largest densely activated model, consists of only 175 billion parameters.
|
| 18 |
+
|
| 19 |
+
The building block of SAMs is the expert layer, which contains an attention mechanism and multiple feed-forward neural networks (FFNs) in parallel. Each FFN is referred to as an expert. During training, an input is routed to a fixed number of experts, such that the number of floating point operations (FLOPs) of one forward pass remains constant, regardless of the total number of experts. Thus, training SAMs is much more cost-efficient than training densely activated models. For example, training of Switch-large (Fedus et al., 2021) and that of T5-large (Raffel et al., 2019) require the same forward FLOPs, despite that the former is 35 times larger (26.3 vs. 0.74 billion parameters).
|
| 20 |
+
|
| 21 |
+
However, SAMs have been reported to be parameter inefficient. For example, although the Switchlarge model is 35 times larger than T5-large, its performance on the GLUE benchmark (Wang et al., 2019a) is only slightly better (88.5 vs. 87.8). There are also cases where the performance of SAMs is even worse than smaller densely activated models. For example, the performance of Switchlarge is worse than T5-large on the ARC Reasoning Challenge (66.0 vs. 68.8) (Clark et al., 2018). In another example, although GShard (Lepikhin et al., 2020) shows substantial gains over densely activated models, a diminishing return with larger number of parameters has been observed.
|
| 22 |
+
|
| 23 |
+
Most on-going research has focused on improving SAMs by developing effective routing methods. Since only a subset of model parameters (i.e., experts) are updated for each input during training, we need to decide which experts to be activated given an input. Existing works (Shazeer et al., 2017; Lepikhin et al., 2020; Fedus et al., 2021; Yang et al., 2021) use a gating network for input routing. However, the gating mechanism suffers from the notorious load imbalance issue: the gate’s weight could collapse such that nearly all the inputs are routed to the same expert. Therefore, many methods are proposed to mitigate this issue, such as noisy gating (Shazeer et al., 2017), expert capacity (Lepikhin et al., 2020), load balancing loss (Lepikhin et al., 2020; Fedus et al., 2021), and $k$ Top-1 gating (Yang et al., 2021). However, these routing methods have not been proved effective to make SAMs more parameter efficient. To understand why SAMs are not parameter efficient, we analyze the performance of several classic MoE models. Our analysis reveals that a SAM does not always outperform a densely activated model of a similar size, confirming the results reported in Yang et al. (2021). Moreover, we also observe that the widely-used routing method based on the gating mechanism does not work better than randomly routing inputs to experts,
|
| 24 |
+
|
| 25 |
+
Inspired by our findings, we propose a new SAM, THOR (Transformer witH StOchastic ExpeRts). Unlike classic SAMs, such as the Switch Transformer, experts in THOR are randomly activated (with no need of any gating mechanism) for each input during training and inference. THOR models are trained by minimizing both the cross-entropy loss and a consistency regularization term, such that experts can learn not only from training data but also from other experts as teachers so that all the experts make consistent predictions.
|
| 26 |
+
|
| 27 |
+
To validate the effectiveness of THOR, we have conducted extensive experiments on machine translation using three settings: low-resource, rich-resource, and multilingual. Results show that THOR models outperform state-of-the-art MoE models by an average of 2 BLEU score on twelve low-resource translation tasks. In the rich-resource setting, THOR achieves new state-of-the-art results on the two widely-used translation benchmarks, WMT’16 En-De and WMT’14 En-Fr. On multilingual translation tasks, the THOR model with 300 million parameters achieves 2 BLEU score improvement over a state-of-the-art MoE model of the same size. Moreover, our model achieves state-of-the-art results on these tasks — the same BLEU score that is achieved by the Z-code MoE model (Kim et al., 2021) with 5.5 billion parameters (18 times larger).
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND
|
| 30 |
+
|
| 31 |
+
Transformer. The Transformer (Vaswani et al., 2017) model has demonstrated its superior performance in many sequence-to-sequence natural language processing tasks, such as neural machine translation. The model contains an encoder and a decoder. The encoder consists of multiple encoder layers, each having an identical structure. An encoder layer employs a self-attention mechanism and a feed-forward neural network (FFN). The decoder is similarly constructed, except for an additional cross-attention mechanism in each decoder layer.
|
| 32 |
+
|
| 33 |
+
Sparsely Activated Models. The building block of SAMs is the expert layer, which is similar to the Transformer layer. Each of these expert layers contain an attention mechanism and multiple FFNs in parallel, where each FFN is referred to as an expert. Let $\{ E _ { i } \} _ { i = 1 } ^ { N }$ denote the experts, and $N$ denotes the total number of experts. A gating mechanism decides to which expert(s) an input should be routed. At each expert layer, given an input vector $x \in \mathbb { R } ^ { d }$ , where $d$ is the embedding dimension, the gate value of routing $x$ to expert $E _ { i }$ is
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
p _ { i } ( { \ ' } x ) = [ \mathrm { S o f t m a x } \left( W _ { g } x \right) ] _ { i } ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $W _ { g } \in \mathbb { R } ^ { N \times d }$ is the trainable weight matrix of the gating mechanism. Given the gate values $\{ p _ { i } ( x ) \} _ { i = 1 } ^ { N }$ , we select the top- $K$ experts to form an activated set of experts $\mathcal { T } \subset \{ 1 \cdots N \}$ , where $| \mathcal { T } | = K$ . Then the output $x _ { \mathrm { o u t } }$ of the expert layer is
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
x _ { \mathrm { o u t } } = \sum _ { i \in \mathcal { T } } p _ { i } ( x ) E _ { i } ( x ) .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Notice that in Eq. 2, input $x$ only activates $K$ instead of $N$ experts, where $K \ll N$ , e.g., $K = 2$ and $N = 2 0 4 8$ in GShard (Lepikhin et al., 2020). This implies that the number of FLOPs required for one forward pass does not increase with the number of experts $N$ . Therefore, SAMs can scale to an enormous size without any significant increase in training time and inference time.
|
| 46 |
+
|
| 47 |
+
The gate weight matrix $W _ { g }$ (Eq. 1) is trained together with the rest of the model parameters. Because there is no constraint on the learned weights, it is possible that $W _ { g }$ collapses such that one row dominates, i.e., all the inputs are routed to one expert. This problem is referred to as load imbalance. Existing works adopt various ad-hoc heuristics to mitigate this issue, e.g., adding Gaussian noise to Eq. 1 (noisy gating, Shazeer et al. 2017), limiting the maximum number of inputs that can be routed to an expert (expert capacity, Lepikhin et al. 2020), imposing a load balancing loss (Lepikhin et al., 2020; Fedus et al., 2021), and using linear assignment (Lewis et al., 2021). There are other works that remove the gating mechanism such that load imbalance is no longer an issue, e.g., by incorporating hash functions (Roller et al., 2021). Besides the load imbalance issue, there are also heated discussions on how to construct $\tau$ in Eq. 2. For example, Shazeer et al. (2017); Lepikhin et al. (2020); Yang et al. (2021) conjecture that routing inputs to $K > 1$ experts is necessary, while Fedus et al. (2021) argue that using $K = 1$ is sufficient and more computationally efficient.
|
| 48 |
+
|
| 49 |
+
# 3 ANALYSIS OF SPARSELY ACTIVATED MODELS
|
| 50 |
+
|
| 51 |
+
We investigate behavior of the gating mechanism of several classic MoE models. We conduct experiments on a multilingual translation task, $\{ \mathrm { D e } , \mathrm { V i } \} \to \mathrm { E n }$ . More details are presented in Appendix A.
|
| 52 |
+
|
| 53 |
+
We consider two MoE models proposed in Shen et al. (2019), referred to as MoE(dec) and MoE(tok), respectively, and three variants of the Switch Transformer proposed in Fedus et al. (2021). The number of experts is set to two for all the MoE models. We compare them with the Transformer (Vaswani et al., 2017) model of the same model size.
|
| 54 |
+
|
| 55 |
+
Figure 1 shows the validation losses and BLEU scores of three models: Transformer, MoE(dec), and MoE(tok). We see that the two MoE models perform very similarly, and neither outperforms the Transformer by a significant margin.
|
| 56 |
+
|
| 57 |
+
To interpret the results of Figure 1, we examine the load of each expert and the confidence scores of routing inputs to different experts. An expert’s load is defined as the proportion of inputs that are assigned to it. For an input that is routed to an expert, its routing confidence score (output of the gating mechanism) determines the level of preference, e.g., if the routing confidence score is 0.5, then the gate has no preference for either expert. For each expert, we compute the average routing confidence score over all the inputs assigned to it.
|
| 58 |
+
|
| 59 |
+
Figure 2 shows that after the early stage of training (i.e., the first 200 iterations), the gate weight collapses and nearly all the inputs are routed to expert 2. Also, the average routing confidence score of expert 2 is close to 1.0, which means that the gate strongly prefers expert 2 to expert 1. In this case, only one of the experts is sufficiently trained. Figure 3 depicts a different scenario, where the inputs are randomly dispatched to the experts. Notice that after approximately 4000 iterations, the two experts are equally loaded, and the probabilities of assigning any input to expert 1 and expert 2 are almost identical, indicating that the gating mechanism has no preference for either expert.
|
| 60 |
+
|
| 61 |
+
We have identified two behaviors of the gating mechanism: load imbalance and random routing. The former is also reported in recent papers (Shazeer et al., 2017; Lepikhin et al., 2020; Fedus et al., 2021). We further investigate the Switch Transformer (Fedus et al., 2021), which is a state-of-theart MoE variant that incorporates various methods to resolve the load imbalance issue. In addition, because behavior of the gating mechanism in the Switch Transformer mimics random routing (see Appendix A), we examine the effect of discarding the gate and randomly assigning inputs to experts. Figure 4 demonstrates the validation losses and BLEU scores of the Transformer and three variants of the Switch Transformer, where inputs are routed according to tokens (referred to as Switch(t)), sentences (Switch(s)), or are routed randomly (Switch(r)). Similar to the results in Figure 1, we see that the four models perform similarly. This shows that even after we alleviate load imbalance, model performance is not improved (i.e., the Switch Transformers do not outperform the vanilla Transformer), and the performance of the Switch Transformer does not vary much among different routing methods, including random routing.
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 1: Validation results of MoE(dec) and MoE(tok).
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: Gating mechanism of MoE(dec). Left: average routing confidence; Right: load of experts.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Gating mechanism of MoE(tok). Left: average routing confidence; Right: load of experts.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 4: Performance of three variants of the Switch Transformer.
|
| 74 |
+
|
| 75 |
+
We remark that in this paper, we focus on natural language processing tasks, in particular neural machine translation. There are other works in different research fields (e.g., computer vision) that draw different conclusions than ours (Riquelme et al., 2021). We attribute this to the intrinsic differences between image classification and language generation, e.g., each input in the former belongs to a clearly-defined category, while no such knowledge exists in the latter.
|
| 76 |
+
|
| 77 |
+
In summary, the experiments reveal
|
| 78 |
+
|
| 79 |
+
• A sparsely activated model does not always outperform a densely activated model of the same model size.
|
| 80 |
+
• The widely-used routing method based on the gating mechanism does not work better than randomly routing inputs to experts.
|
| 81 |
+
|
| 82 |
+
# 4 THOR: TRANSFORMER WITH STOCHASTIC EXPERTS
|
| 83 |
+
|
| 84 |
+
The ineffectiveness of the gating mechanism, as shown in our experiments, motivates us to propose a new expert-based model, THOR (Transformer witH StOchastic ExpeRts). In THOR, a pair of experts are randomly selected and activated in each layer during a training iteration, and then all the inputs in a batch are processed using the same pair of experts. Our method drastically simplifies model design, and has two additional advantages. First, it eliminates the load imbalance issue because randomly selecting a pair of experts in each iteration allows each expert to have a fair chance to be sufficiently trained. The ad-hoc heuristics, such as the load balancing loss, as discussed in Section 2, are no longer needed. Second, unlike the gating mechanism, THOR does not introduce any additional model parameters.
|
| 85 |
+
|
| 86 |
+
One problem of THOR is that without a gating mechanism, experts need to be randomly selected during inference, and we may obtain inconsistent inference results due to different random seeds. For example, on a Czech-to-English translation dataset, our experiments show that randomness can result in a 0.5 BLEU score difference.
|
| 87 |
+
|
| 88 |
+
To address this issue, we introduce a consistency regularizer in the training objective of THOR. Concretely, let $N$ denotes the number of experts, $L$ the number of layers, and $\mathsf { \bar { E } } _ { i } ^ { l }$ an activated expert (which is a FFN) in layer $l$ , where $1 \leq i \leq N$ and $1 \le l \le L$ . We use $p = f ( \boldsymbol { x } ; \{ E _ { i } ^ { l } \} _ { l = 1 } ^ { L } )$ to indicate the prediction probability of input $x$ using the model $f$ where experts $\{ E _ { i } ^ { l } \} _ { l = 1 } ^ { L }$ are activated. Figure 5 illustrates one training iteration. Notice that instead of activating one expert for each layer in an iteration, we select to activate a pair of experts in THOR. As a result, we obtain two prediction probabilities produced by the two selections, respectively: $p _ { 1 } \ = \ f ( x ; \{ E _ { i } ^ { l } \} _ { l = 1 } ^ { L } ) )$ and $p _ { 2 } = f ( \boldsymbol { x } ; \{ E _ { j } ^ { l } \} _ { l = 1 } ^ { L } ) )$ . Then, the training objective of THOR with respect to training samples $( x , y )$ in the dataset $\bar { \mathcal { D } }$ is
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 5: Illustration of a training iteration with stochastic experts. For conciseness, we show a model with only one Transformer layer.
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \operatorname* { m i n } _ { ( x , y ) \in \mathcal { D } } \ell ( x , y ) = \mathrm { C E } ( p _ { 1 } ; y ) + \mathrm { C E } ( p _ { 2 } ; y ) + \alpha \mathrm { C R } ( p _ { 1 } ; p _ { 2 } ) , } \\ & { \quad \mathrm { ~ w h e r e ~ C R } ( p _ { 1 } ; p _ { 2 } ) = \displaystyle \frac { 1 } { 2 } \left( \mathrm { K L } ( p _ { 1 } \| p _ { 2 } ) + \mathrm { K L } ( p _ { 2 } \| p _ { 1 } ) \right) . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Here, CE is the cross-entropy loss, the consistency regularizer CR is defined as the average of the two Kullback–Leibler (KL) divergence terms, and $\alpha$ is a hyper-parameter that controls the strength of the regularizer. In mini-batch SGD training, we randomly sample a pair of experts to activate at each layer for each batch. During inference, we can also randomly select an expert to activate at each layer for each input, similar to that in training. We can also use different expert-selection methods, such as expert-ensemble, as to be discussed in Section 5 (Table 5).
|
| 98 |
+
|
| 99 |
+
The THOR training objective of Eq. 3 forces all the experts to minimize training errors while making the same predictions as much as possible. Thus, in each training step, each expert optimizes its parameters by learning from both the training data (via minimizing the cross-entropy loss) and its paired expert as a teacher (via minimizing the KL divergence). Although these experts are learned to make consistent predictions, they converge to different (local) optima given the randomness introduced in training, e.g., initialization, mini-batch SGD, random routing, etc. Thus, every expert learns from a set of diverse teachers during the course of training, which helps to improve model’s performance. In addition, by penalizing experts that yield inconsistent predictions from the others, the consistency regularizer also helps reducing the variance of model prediction.
|
| 100 |
+
|
| 101 |
+
THOR is conceptually similar to dropout (Srivastava et al., 2014) since both methods route an input to some randomly selected sub-net components (i.e., experts in THOR and neurons in dropout). However, THOR differs from dropout in several important aspects, making it a better choice for efficient training and serving of large-scale neural models. First, THOR can be applied to both training and inference, while dropout is only used for training. Second, THOR is shown to be more robust in large-scale model training than dropout. For example, our models are less likely to overfit with the increase in the number of experts (see Figure 9). Third, THOR leads to a sparse model that is more structured than that of dropout, such that a large-scale THOR model can be much more easily trained using GPU clusters, e.g., by putting different experts on different GPUs in parallel.
|
| 102 |
+
|
| 103 |
+
# 5 EXPERIMENTS
|
| 104 |
+
|
| 105 |
+
We evaluate THOR on neural machine translation. We adopt three settings: low-resource translation, rich-resource translation, and multilingual translation. For low-resource and rich-resource translation, we train all the models using Fairseq1 (Ott et al., 2019). For multilingual translation, we use DeepSpeed $M o E ^ { 2 }$ (Kim et al., 2021) to implement the MoE models. All the experiments are conducted on NVIDIA V100 GPUs. Additional experiments, including model scale-up and comparison of inference speed, are deferred to Appendix D.
|
| 106 |
+
|
| 107 |
+
# 5.1 BASELINE
|
| 108 |
+
|
| 109 |
+
We use two baselines in the experiments.
|
| 110 |
+
|
| 111 |
+
• Transformer (Vaswani et al., 2017) achieves superior performance in many sequence-tosequence learning tasks, such as neural machine translation. • Switch Transformer (Fedus et al., 2021) is a state-of-the-art MoE model, which employs a gating mechanism to route inputs and uses a load balancing loss to reduce load imbalance.
|
| 112 |
+
|
| 113 |
+
To verify the effectiveness of the imposed consistency regularizer in Eq. 3, we also compare THOR with Transformer models trained using two popular regularization methods. We remark that these two methods share similar computational costs with THOR, i.e., they also require two forward passes in each training iteration.
|
| 114 |
+
|
| 115 |
+
• SMART (Jiang et al., 2020) utilizes a smoothness inducing adversarial regularizer to penalize the worst case difference between predictions of a clean input and a perturbed input. • R3F (Aghajanyan et al., 2020) uses a regularizer to reduce representational collapse. The method has shown to be effective in various natural language processing tasks.
|
| 116 |
+
|
| 117 |
+
All the methods are trained for the same number of FLOPs in the experiments for fair comparison.
|
| 118 |
+
|
| 119 |
+
# 5.2 LOW-RESOURCE TRANSLATION
|
| 120 |
+
|
| 121 |
+
We use six language pairs: English to Vietnamese, English to German, and English to French from IWSLT; English to Romanian, English to Latvian, and English to Czech from Europarl3. Dataset statistics are summarized in Table 6 (Appendix B).
|
| 122 |
+
|
| 123 |
+
Table 1: Experimental results on low resource datasets. The best result on each dataset is in bold.
|
| 124 |
+
|
| 125 |
+
<table><tr><td></td><td>En-Vi</td><td>Vi-En</td><td>En-De</td><td>De-En</td><td>En-Fr</td><td>Fr-En</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>31.3</td><td>29.4</td><td>28.1</td><td>34.8</td><td>39.2</td><td>38.1</td></tr><tr><td>SMART (Jiang et al., 2020)</td><td>32.5</td><td>30.5</td><td>29.3</td><td>35.8</td><td>40.0</td><td>38.8</td></tr><tr><td>R3F (Aghajanyan et al., 2020)</td><td>32.2</td><td>30.7</td><td>29.2</td><td>35.7</td><td>39.7</td><td>38.9</td></tr><tr><td>Switch (Fedus et al., 2021)</td><td>31.7</td><td>29.5</td><td>28.4</td><td>34.6</td><td>39.1</td><td>38.2</td></tr><tr><td>THOR</td><td>34.0</td><td>33.0</td><td>31.1</td><td>37.8</td><td>40.7</td><td>40.0</td></tr><tr><td></td><td>En-Ro</td><td>Ro-En</td><td>En-Lv</td><td>Lv-En</td><td>En-Cs</td><td>Cs-En</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>23.5</td><td>25.0</td><td>13.6</td><td>15.8</td><td>16.1</td><td>20.4</td></tr><tr><td>SMART (Jiang et al., 2020)</td><td>24.6</td><td>25.7</td><td>14.2</td><td>16.3</td><td>16.7</td><td>21.4</td></tr><tr><td>R3F (Aghajanyan et al., 2020)</td><td>23.8</td><td>25.8</td><td>14.4</td><td>16.3</td><td>16.8</td><td>21.6</td></tr><tr><td>Switch (Fedus et al., 2021)</td><td>23.8</td><td>24.4</td><td>13.8</td><td>16.1</td><td>16.1</td><td>20.6</td></tr><tr><td>THOR</td><td>25.2</td><td>27.1</td><td>15.2</td><td>17.4</td><td>17.6</td><td>22.4</td></tr></table>
|
| 126 |
+
|
| 127 |
+
To evaluate THOR with different model sizes, we use the Transformer-base (Vaswani et al., 2017) architecture on Europarl datasets, and a smaller model on IWSLT datasets. Compared with Transformer-base, the smaller model decreases the hidden dimension from 2048 to 1024, and decreases the number of heads from 8 to 4 with the dimension of each head doubled. We use two experts for the expert-based models. We remark that even though THOR increases the number of parameters, its inference speed (in terms of FLOPs) is the same as Transformer-base because only one expert is activated for each input. Interested readers refer to Appendix C for more details.
|
| 128 |
+
|
| 129 |
+
The experimental results in Table 1 show that performance of the Switch Transformer is on par with the vanilla Transformer, e.g., its average BLEU score on the 12 datasets is 26.3, the same as the Transformer. The results confirm that SAMs do not outperform densely activated models with similar model sizes. In contrast, THOR achieves more than 1.0 BLEU score improvement over the Switch Transformer in all the 12 tasks. THOR also significantly outperforms the models trained using the two competing regularization methods, SMART and R3F.
|
| 130 |
+
|
| 131 |
+
# 5.3 RICH-RESOURCE TRANSLATION
|
| 132 |
+
|
| 133 |
+
We use two widely adopted rich-resource translation benchmarks: English to German translation from WMT’16 and English to French translation from WMT’14. The former dataset consists of 4.5 million training sentence pairs, and the latter 36 million pairs. We follow the pre-processing steps in Ott et al. (2018).
|
| 134 |
+
|
| 135 |
+
To evaluate THOR , We use the Transformer-big architecture (Vaswani et al., 2017) and we set the number of experts for both THOR and the Switch Transformer to 4. Interested readers refer to Appendix C for more details.
|
| 136 |
+
|
| 137 |
+
Table 2 reports the BLEU scores and the sacreBLEU scores (Post, 2018) of different models. We see that THOR achieves new state-ofthe-art results in the setting where neither data augmentation nor pre-trained language model is used. Specifically, THOR lifts the previous state-of-the-art (Liu et al., 2020b;c) by 0.3 BLEU score on the En-De translation task and 0.1 BLEU score on the En-Fr translation task. THOR also significantly outperforms the models trained using the other two regularization methods, SMART (Jiang et al., 2020) and R3F (Aghajanyan et al., 2020). Similar to what is observed in low-resource translation, the Switch Transformer (Fedus et al., 2021) does not outperform the vanilla Transformer (Ott et al., 2018).
|
| 138 |
+
|
| 139 |
+
Table 2: BLEU and sacreBLEU scores on WMT’14 En-Fr and WMT’16 En-De. Results of Jiang et al. (2020), Aghajanyan et al. (2020), and Fedus et al. (2021) are from our implementation.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>BLEU</td><td>En-De</td><td>En-Fr</td></tr><tr><td>Vas wani et al. (2017)</td><td>28.4</td><td>41.8</td></tr><tr><td>Ott et al. (2018)</td><td>29.3</td><td>43.2</td></tr><tr><td>Wang et al. (2019b)</td><td>29.6</td><td>一</td></tr><tr><td>Wu et al. (2019a)</td><td>29.7</td><td>43.2</td></tr><tr><td>So et al. (2019)</td><td>29.8</td><td>41.3</td></tr><tr><td>Jiang et al. (2020)</td><td>29.8</td><td>43.4</td></tr><tr><td>Wu et al. (2019b)</td><td>29.9</td><td>43.3</td></tr><tr><td>Aghajanyan et al. (2020)</td><td>29.4</td><td>43.3</td></tr><tr><td>Liu et al. (2020c)</td><td>30.1</td><td>43.8</td></tr><tr><td>Fedus et al. (2021)</td><td>29.3</td><td>43.0</td></tr><tr><td>THOR</td><td>30.4</td><td>43.8</td></tr><tr><td>sacreBLEU</td><td>En-De</td><td>En-Fr</td></tr><tr><td>Ott et al. (2018)</td><td>28.6</td><td>41.4</td></tr><tr><td> Jiang et al. (2020)</td><td>29.1</td><td>41.5</td></tr><tr><td>So et al. (2019)</td><td>29.2</td><td></td></tr><tr><td>Aghajanyan et al. (2020)</td><td>29.0</td><td>41.5</td></tr><tr><td>Liu et al. (2020c)</td><td>29.5</td><td>41.8</td></tr><tr><td>Fedus et al. (2021)</td><td>28.6</td><td>41.1</td></tr><tr><td>THOR</td><td>29.6</td><td>41.9</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 5.4 MULTILINGUAL TRANSLATION
|
| 144 |
+
|
| 145 |
+
We have collected 10 language pairs from WMT datasets, and built a $6 4 k$ -entry dictionary for all the languages. The detailed statistics are summarized in Table 7 (Appendix B). Please refer to Kim et al. (2021) for more details. We do not use multi-task learning or additional monolingual data in the experiments.
|
| 146 |
+
|
| 147 |
+
We use the following model architecture: the embedding dimension is set to 768 and the hidden dimension for the FFN is set to 3072; we use 12 encoder layers and 6 decoder layers, where each layer has 12 attention heads, and the dimension of each head is 64. We set the number of experts to 4 for both THOR and the Switch Transformer.
|
| 148 |
+
|
| 149 |
+
Table 3 reports the average BLEU score of translating English to other languages, translating other languages to English, and the overall score of the 20 tasks. We see that compared with the Switch
|
| 150 |
+
|
| 151 |
+
Transformer of the same size (i.e., 300 million parameters), our model achieves a 2-point improvement in the overall BLEU score. In addition, our model is far more parameter efficient than the Switch Transformer. The THOR model with 300 million parameters achieves the same BLEU score (24.4) that is achieved by the Switch Transformer with 5.5 billion parameters, which is more than 18 times larger.
|
| 152 |
+
|
| 153 |
+
Table 3: Multilingual translation results. Here $\mathbf { \vec { E } } ^ { \prime } \mathbf { \vec { \Sigma } }$ means the number of experts.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>En-→Others</td><td>Others-En</td><td>Average</td></tr><tr><td>Switch (32E,5.5B)</td><td>一</td><td>一</td><td>24.4</td></tr><tr><td>Switch (4E,300M)</td><td>20.3</td><td>24.6</td><td>22.4</td></tr><tr><td>THOR (4E,300M)</td><td>21.4</td><td>27.4</td><td>24.4</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Figure 6 shows BLEU scores in all the 20 translation tasks. Notice that THOR outperforms the baseline on 17 out of the 20 tasks. The improvement is in general more significant on the tasks with smaller datasets. For example, our model achieves BLEU score improvement of 4.7 and 6.7 on Gu-En $( 8 5 k )$ and Hi-En $( 2 6 4 k )$ , respectively. On the tasks with larger datasets, the improvement obtained by our model is less substantial, but still significant, e.g., $+ 0 . 9$ BLEU score on Cs-En $( 1 0 M )$ and $+ 1 . 1$ Fi-En $( 4 . 8 M )$ . For the only three tasks where our model underperforms the baseline, the gaps are small, e.g., $- 0 . 4 , - 0 . 2$ , and $- 0 . 4$ BLEU scores on En-Cs, En-De, and En-Fr, respectively.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 6: Details of multilingual translation results.
|
| 161 |
+
|
| 162 |
+
# 5.5 ABLATION EXPERIMENTS
|
| 163 |
+
|
| 164 |
+
Training Objective. We examine the relative contributions of the three loss terms used in the THOR training objective of Eq. 3: $\mathrm { C E _ { 1 } }$ , $\mathrm { C E _ { 2 } }$ and CR. The result in Table 4 shows that the consistency regularizer CR is crucial to the model performance, and that dropping one of the two CE terms leads to only very small BLEU score loss since the two cross-entropy terms play the same role in training.
|
| 165 |
+
|
| 166 |
+
Inference Methods. We compare three inference methods: (1) Dispatch(s) uses sentencelevel random routing, where all tokens in one sentence are routed to the same expert; (2) Dispatch(t) uses token-level random routing, where tokens within a sentence are routed to different experts; (3) Ensemble, where each sentence is routed to all the $N$ experts, and the $N$ hidden representations in each layer are averaged. Note that the number of FLOPs is larger for Ensemble because we need to run forward pass for each input through $N$ experts. Table 5 shows that Dispatch(s) and Dispatch(t) perform similarly, and Ensemble yields the best BLEU score with a cost of longer inference time.
|
| 167 |
+
|
| 168 |
+
Table 4: Effect of the three loss terms in training object of Eq. 3, tested on Cs-En translation.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Loss terms</td><td>BLEU</td></tr><tr><td>CE1+CE2+CR</td><td>22.4</td></tr><tr><td>CE+CR</td><td>22.2</td></tr><tr><td>CEi+CE2 CE1</td><td>20.8 20.6</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 5: Performance and costs of three inference methods, tested on CsEn translation.
|
| 173 |
+
|
| 174 |
+
<table><tr><td></td><td>BLEU</td><td>time</td></tr><tr><td>Dispatch(s)</td><td>22.4</td><td>×1</td></tr><tr><td>Dispatch(t)</td><td>22.4</td><td>×1</td></tr><tr><td>Ensemble</td><td>22.6</td><td>×N</td></tr></table>
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 7: Effect of the consistency regularization strength $\alpha$ on Cs-En translation.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 8: Violin plot of performance consistency on CsEn translation.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 9: BLEU vs. model size on De-En translation.
|
| 184 |
+
|
| 185 |
+
Regularization strength. To investigate the effect of the regularization strength $\alpha$ , we run experiments on the Cs-En translation dataset in the low-resource setting. Figure 7 shows that model performance is not very sensitive to $\alpha$ as long as the value is large enough, say $\alpha > 2 . 0$ .
|
| 186 |
+
|
| 187 |
+
Consistency of Model Prediction. We study the variance of model prediction due to the use of randomly activated experts during inference. We compare THOR and the Switch Transformer, where we remove the trained gate during inference. For each model, we compute the variance of model prediction based on 20 runs. As shown in Figure 8, THOR makes more consistent predictions than Switch Transformer due to the use of the consistency regularizer for model training. The variance of THOR is below 0.002, whereas the variance of Switch Transformer is 0.008, four times larger. We remark that by removing the trained router from the Switch Transformer, model performance only marginally decreases (from 20.6 to 20.4). This further indicates that a trained router may not be better than a random router.
|
| 188 |
+
|
| 189 |
+
Overfitting. We compare the THOR model and the Transformer model regarding how likely they overfit the training data when the model size increases. We run experiments on the De-En data in the low-resource setting, where the dropout rate of the FFNs in the Transformer is selected such that the number of parameters trained in one iteration is the same as the THOR model. As shown in Figure 9, THOR does not show any sign of overfitting — we observe a consistent improvement in BLEU score as we increase the number of experts from 2 to 8. In contrast, the Transformer model’s performance deteriorates as we increase the hidden dimension of its FFN from $2 k$ to $8 k$ . We remark that we also observe the overfitting phenomenon on larger datasets, e.g., the Transformer overfits on the Cs-En dataset when we set the hidden dimension of its FFN to $1 6 k$ .
|
| 190 |
+
|
| 191 |
+
# 6 CONCLUSION
|
| 192 |
+
|
| 193 |
+
We present a new expert-based sparsely activated model, THOR. Unlike existing SAMs, such as the Switch Transformer, experts in THOR are randomly activated for each input during training and inference. THOR models are trained using a consistency regularized loss, where every expert learns not only from training data but also from other experts as teachers so that all the experts make consistent predictions. As a result, not only can large-scale THOR models be trained and served as efficiently as classic MoE models, THOR models also demonstrate a better generalization capability in that they are more parameter-efficient, less likely to overfit, make more consistent predictions, and achieve better results consistently across different settings. We validate the effectiveness of THOR via a comprehensive empirical study on machine translation. In all the three settings (i.e., low-resource, rich-resource, and multilingual translation), THOR models significantly outperform the vanilla Transformer, and Switch Transformer, a state-of-the-art MoE model.
|
| 194 |
+
|
| 195 |
+
# ACKNOWLEDGMENTS
|
| 196 |
+
|
| 197 |
+
We thank Rukmini Lyer, Kevin Duh, Hao Cheng, Chunyuan Li, Johannes Gehrke, colleagues from Microsoft Bing Ads team and Microsoft Research for their valuable discussions and comments.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Armen Aghajanyan, Akshat Shrivastava, Anchit Gupta, Naman Goyal, Luke Zettlemoyer, and Sonal Gupta. Better fine-tuning by reducing representational collapse. ArXiv preprint, abs/2008.03156, 2020. URL https://arxiv.org/abs/2008.03156.
|
| 202 |
+
|
| 203 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html.
|
| 204 |
+
|
| 205 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv preprint, abs/1803.05457, 2018. URL https://arxiv.org/abs/1803.05457.
|
| 206 |
+
|
| 207 |
+
Alexis Conneau and Guillaume Lample. Cross-lingual language model pretraining. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman ´ Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 7057–7067, 2019. URL https://proceedings.neurips.cc/paper/ 2019/hash/c04c19c2c2474dbf5f7ac4372c5b9af1-Abstract.html.
|
| 208 |
+
|
| 209 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423.
|
| 210 |
+
|
| 211 |
+
William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. ArXiv preprint, abs/2101.03961, 2021. URL https: //arxiv.org/abs/2101.03961.
|
| 212 |
+
|
| 213 |
+
Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. ArXiv preprint, abs/2006.03654, 2020. URL https://arxiv. org/abs/2006.03654.
|
| 214 |
+
|
| 215 |
+
Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. SMART: Robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2177–2190, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.197. URL https://aclanthology.org/2020. acl-main.197.
|
| 216 |
+
|
| 217 |
+
Young Jin Kim, Ammar Ahmad Awan, Alexandre Muzio, Andres Felipe Cruz Salinas, Liyang Lu, Amr Hendy, Samyam Rajbhandari, Yuxiong He, and Hany Hassan Awadalla. Scalable and efficient moe training for multitask multilingual models. ArXiv preprint, abs/2109.10465, 2021. URL https://arxiv.org/abs/2109.10465.
|
| 218 |
+
|
| 219 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http: //arxiv.org/abs/1412.6980.
|
| 220 |
+
|
| 221 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. ArXiv preprint, abs/2006.16668, 2020. URL https: //arxiv.org/abs/2006.16668.
|
| 222 |
+
|
| 223 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://aclanthology.org/2020.acl-main.703.
|
| 224 |
+
|
| 225 |
+
Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. Base layers: Simplifying training of large, sparse models. ArXiv preprint, abs/2103.16716, 2021. URL https://arxiv.org/abs/2103.16716.
|
| 226 |
+
|
| 227 |
+
Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020a. URL https://openreview.net/forum?id $\equiv$ rkgz2aEKDr.
|
| 228 |
+
|
| 229 |
+
Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. Understanding the difficulty of training transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5747–5763, Online, 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.463. URL https:// aclanthology.org/2020.emnlp-main.463.
|
| 230 |
+
|
| 231 |
+
Xiaodong Liu, Kevin Duh, Liyuan Liu, and Jianfeng Gao. Very deep transformers for neural machine translation. ArXiv preprint, abs/2008.07772, 2020c. URL https://arxiv.org/abs/ 2008.07772.
|
| 232 |
+
|
| 233 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. ArXiv preprint, abs/1907.11692, 2019. URL https://arxiv.org/abs/1907. 11692.
|
| 234 |
+
|
| 235 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 1–9, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6301. URL https://aclanthology.org/W18-6301.
|
| 236 |
+
|
| 237 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pp. 48–53, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-4009. URL https://aclanthology.org/N19-4009.
|
| 238 |
+
|
| 239 |
+
Matt Post. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 186–191, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6319. URL https://aclanthology. org/W18-6319.
|
| 240 |
+
|
| 241 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 242 |
+
|
| 243 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-totext transformer. ArXiv preprint, abs/1910.10683, 2019. URL https://arxiv.org/abs/ 1910.10683.
|
| 244 |
+
|
| 245 |
+
Carlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, Andre Su- ´ sano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. arXiv preprint arXiv:2106.05974, 2021. URL https://arxiv.org/abs/2106.05974.
|
| 246 |
+
|
| 247 |
+
Stephen Roller, Sainbayar Sukhbaatar, Arthur Szlam, and Jason Weston. Hash layers for large sparse models. ArXiv preprint, abs/2106.04426, 2021. URL https://arxiv.org/abs/ 2106.04426.
|
| 248 |
+
|
| 249 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://aclanthology. org/P16-1162.
|
| 250 |
+
|
| 251 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixtureof-experts layer. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1ckMDqlg.
|
| 252 |
+
|
| 253 |
+
Tianxiao Shen, Myle Ott, Michael Auli, and Marc’Aurelio Ranzato. Mixture models for diverse machine translation: Tricks of the trade. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9- 15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 5719–5728. PMLR, 2019. URL http://proceedings.mlr.press/v97/ shen19c.html.
|
| 254 |
+
|
| 255 |
+
David R. So, Quoc V. Le, and Chen Liang. The evolved transformer. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 5877–5886. PMLR, 2019. URL http://proceedings. mlr.press/v97/so19a.html.
|
| 256 |
+
|
| 257 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
|
| 258 |
+
|
| 259 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 2818–2826. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.308. URL https: //doi.org/10.1109/CVPR.2016.308.
|
| 260 |
+
|
| 261 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/ 3f5ee243547dee91fbd053c1c4a845aa-Abstract.html.
|
| 262 |
+
|
| 263 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ rJ4km2R5t7.
|
| 264 |
+
|
| 265 |
+
Qiang Wang, Bei Li, Tong Xiao, Jingbo Zhu, Changliang Li, Derek F. Wong, and Lidia S. Chao. Learning deep transformer models for machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1810–1822, Florence, Italy, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1176. URL https://aclanthology.org/P19-1176.
|
| 266 |
+
|
| 267 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann N. Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SkVhlh09tX.
|
| 268 |
+
|
| 269 |
+
Lijun Wu, Yiren Wang, Yingce Xia, Fei Tian, Fei Gao, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. Depth growing for neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 5558–5563, Florence, Italy, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1558. URL https:// aclanthology.org/P19-1558.
|
| 270 |
+
|
| 271 |
+
An Yang, Junyang Lin, Rui Men, Chang Zhou, Le Jiang, Xianyan Jia, Ang Wang, Jie Zhang, Jiamang Wang, Yong Li, et al. Exploring sparse expert models and beyond. ArXiv preprint, abs/2105.15082, 2021. URL https://arxiv.org/abs/2105.15082.
|
| 272 |
+
|
| 273 |
+
# A ANALYSIS OF SPARSELY ACTIVATED MODELS
|
| 274 |
+
|
| 275 |
+
# A.1 TRAINING DETAILS
|
| 276 |
+
|
| 277 |
+
We consider two Mixture-of-Experts (MoE) models proposed in Shen et al. (2019), which are denoted “MoE(dec)” and “MoE(tok)”. In the first variant, each expert is a separate Transformer decoder. In the second variant, each expert is a different token, i.e., if we route the input to expert one, then we replace the $\left. b o s \right.$ (begin-of-sentence) token in the input sentence with a $\langle e x p e r t _ { 1 } \rangle$ token. Note that embeddings of these expert tokens are trained together with the rest of the model parameters. These models are equipped with an expectation-maximization optimization framework. Such a framework facilitates computing the probability of assigning an input to a specific expert according to the gating mechanism. Please refer to Shen et al. (2019) for details about these models.
|
| 278 |
+
|
| 279 |
+
We use a multilingual translation setting, where we adopt two datasets: De-En from IWSLT’14 and Vi-En from IWSLT’15. For each dataset, we use byte pair encoding (BPE, Sennrich et al. 2016) with 10, 000 merge operations for pre-processing. Then we concatenate the two pre-processed datasets. We learn a separate dictionary for En and $\mathrm { \bar { \{ D e + V i \} } }$ , which resulted in approximately $9 k$ and $1 2 k$ vocabularies, respectively.
|
| 280 |
+
|
| 281 |
+
For training, we use Adam (Kingma & Ba, 2015) as the optimizer and we set the learning rate to 0.001. We set the batch size to be equivalent to $6 4 k$ tokens, e.g., we use $8 k$ tokens per GPU with 8 GPUs. Other training details follow the Fairseq4 implementation. For inference, we use a beam size of 5 and a length penalty of 1.0.
|
| 282 |
+
|
| 283 |
+
# A.2 ADDITIONAL RESULTS
|
| 284 |
+
|
| 285 |
+
We also plot the average routing confidence score and the load of experts for Switch(s) and Switch(t), similar to Figure 2 and Figure 3. We first investigate the Switch Transformer without the load balancing loss.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure 10: Switch(s) w/o load balancing. Left: average routing confidence; Right: load of experts.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 11: Switch(t) w/o load balancing. Left: average routing confidence; Right: load of experts.
|
| 292 |
+
|
| 293 |
+
Figure 10 shows the results for Switch(s) without the load balancing loss, where we route inputs to experts on the sentence-level. We see that after about $1 0 k$ training iterations, the average routing confidence score of expert 1 and expert 2 becomes similar, and both of these scores are around 0.60. Moreover, the load of the experts are not balanced, i.e., there is a $1 0 \%$ difference in the loads $( 5 5 \%$ vs. $4 5 \%$ ). We conclude that behavior of the gating mechanism of Switch(s) is similar to Figure 3, i.e., the gate is essentially randomly routing inputs to experts without any preference.
|
| 294 |
+
|
| 295 |
+
Figure 11 shows the results for Switch(t) without the load balancing loss, where we route inputs to experts on the token-level, i.e., different tokens within the same sentence may be routed to different experts. Similar to the Switch(s) case, the average routing confidence score of both of the two experts converges to around 0.55. This indicates that the gate do not prefer any expert given an input. Moreover, the load of the experts are not balanced, the same as in Figure 10. Based on these observations, we conclude that behavior of the gating mechanism of Switch(t) is also random routing.
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 12: Switch(s) w/ load balancing. Left: average routing confidence; Right: load of experts.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 13: Switch(t) w/ load balancing. Left: average routing confidence; Right: load of experts.
|
| 302 |
+
|
| 303 |
+
Figure 12 and Figure 13 show behavior of the gating mechanism of Switch(s) and Switch(t) equipped with the load balancing loss, respectively. We see that the load balancing loss indeed balances the load for both Switch(s) and Switch(t), e.g., there is a less than $0 . 4 \%$ imbalance for Switch(s) and less than $0 . 2 \%$ imbalance for Switch(t). In comparison, the imbalance is around $1 0 \%$ for the two Switch Transformer variants without the load balancing loss. Also, similar to the case without the load balancing loss, the average routing confidence score converges to around 0.60 for Switch(s) and around 0.55 for Switch(t). Based on the observations, we conclude that behavior of the gating mechanism is still random routing when Switch(s) and Switch(t) are equipped with the load balancing loss.
|
| 304 |
+
|
| 305 |
+
# B DATASETS
|
| 306 |
+
|
| 307 |
+
Statistics of low-resource datasets are shown in Table 6. The English-Vietnamese, English-German, and English-French datasets are from5 IWSLT’14, ’15, and ’16, respectively. The training data of
|
| 308 |
+
|
| 309 |
+
English-Romanian, English-Latvian, and English-Czech are from Europarl6, and the validation and testing data are from WMT’17.
|
| 310 |
+
|
| 311 |
+
Statistics and data sources used in the multilingual translation task are shown in Table 7.
|
| 312 |
+
|
| 313 |
+
Table 6: Statistics of low resource translation datasets.
|
| 314 |
+
|
| 315 |
+
<table><tr><td></td><td>En-Vi</td><td>En-De</td><td>En-Fr</td><td>En-Ro</td><td>En-Lv</td><td>En-Cs</td></tr><tr><td>Train</td><td>117,055</td><td>160,239</td><td>218,256</td><td>390,746</td><td>591,631</td><td>619,029</td></tr><tr><td>Validation</td><td>5,098</td><td>7,283</td><td>8,453</td><td>1,900</td><td>1,949</td><td>2,902</td></tr><tr><td>Test</td><td>1,268</td><td>6,750</td><td>1,133</td><td>1,999</td><td>2.,001</td><td>3,005</td></tr></table>
|
| 316 |
+
|
| 317 |
+
Table 7: Statistics of multilingual translation datasets. The other language in the translation tasks is English (En) for all the datasets.
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Language</td><td>Czech (Cs)</td><td>German (De)</td><td>Estonian (Et)</td><td>Finnish (Fi)</td><td>French (Fr)</td></tr><tr><td>Data source # Samples</td><td>WMT'19</td><td>WMT'19</td><td>WMT'18</td><td>WMT'19</td><td>WMT'15</td></tr><tr><td></td><td>10,273,696</td><td>4,613,192</td><td>695,227</td><td>4,838,576</td><td>9,999,995</td></tr><tr><td>Language</td><td>Gujarati (Gu)</td><td>Hindi (Hi)</td><td>Latvian (Lv)</td><td>Romanian (Ro)</td><td>Turkish (Tr)</td></tr><tr><td>Data source</td><td>WMT'19</td><td>WMT'14</td><td>WMT'17</td><td>WMT'16</td><td>WMT'18</td></tr><tr><td># Samples</td><td>85,688</td><td>264,199</td><td>1,444,235</td><td>540,562</td><td>182,269</td></tr></table>
|
| 320 |
+
|
| 321 |
+
# C TRAINING DETAILS
|
| 322 |
+
|
| 323 |
+
# C.1 LOW RESOURCE TRANSLATION
|
| 324 |
+
|
| 325 |
+
We build a joined dictionary for the source and target languages for each dataset. To facilitate this, we use byte pair encoding (BPE) with 10, 000 and 40, 000 split operations for the IWSLT and the WMT datasets, respectively. Other pre-processing steps follow the Fairseq implementation.
|
| 326 |
+
|
| 327 |
+
For training, the regularization strength is chosen to be $\alpha \ : = \ : 5 . 0$ . We set the batch size to be equivalent to $3 2 k$ tokens, i.e., if we have four GPUs, then we set the number of tokens on each GPU to be $4 k$ and accumulate gradients for two steps. We use Adam as the optimizer with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 8$ , and we set the learning rate to be 0.0015. We train the model for $4 0 k$ steps, and we test the model that yield the highest validation BLEU. For validation and testing, we use a beam size 5 and a length penalty 1.0. Other training and inference details follow the Fairseq implementation.
|
| 328 |
+
|
| 329 |
+
# C.2 RICH RESOURCE TRANSLATION
|
| 330 |
+
|
| 331 |
+
Strength of the consistency regularizer is set as $\alpha = 2 . 0$ . We use Adam (Kingma & Ba, 2015) as the optimizer with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 8$ , and the learning rate is chosen as 0.001. For inference, we use a beam size 4 and a length penalty 0.6 for En-De; we use a beam size 10 and a length penalty 1.0 for En-Fr. Other post-processing steps follow Ott et al. (2018). We report both the BLEU score and the sacreBLEU score (Post, 2018), where the latter is a safer token-agnostic version of BLEU.
|
| 332 |
+
|
| 333 |
+
# C.3 MULTILINGUAL TRANSLATION
|
| 334 |
+
|
| 335 |
+
For training, we set the batch size to be equivalent to 1.6 million tokens, e.g., 4096 tokens per GPU with 24 GPUs, and we accumulate gradients for 16 steps. We use RAdam (Liu et al., 2020a) as the optimizer with parameters $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 8$ . The learning rate is set to be 0.05. Also, we set the dropout ratio to be 0.1, and we use label smoothed cross entropy (Szegedy et al., 2016) with a smoothing factor 0.1. The regularization strength is set to be $\alpha = 4 . 0$ . For inference, we use a beam size 5 and a length penalty 1.0.
|
| 336 |
+
|
| 337 |
+
# D ADDITIONAL EXPERIMENTS
|
| 338 |
+
|
| 339 |
+
We further test behavior of THOR and the Switch Transformer when we increase the number of experts. To avoid overfitting, we use a small model (Transformer-IWSLT) on the WMT’16 En-De translation dataset. In this experiment, the Transformer model has $4 8 M$ parameters, models with 2, 16, and 64 experts have $5 5 M$ , $1 4 3 M$ , and $4 5 6 M$ parameters, respectively.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 14: Effects of the number of experts on WMT’16 En-De translation. Left: training perplexity (lower the better) with respect to wall-time (measured in GPU hours); Right: validation BLEU (higher the better) after training for 180 GPU hours with respect to the number of experts, where the size of Transformer does not change.
|
| 343 |
+
|
| 344 |
+
Figure 14 demonstrates the results. In Figure 14 (left), notice that the Switch Transformer trains faster than the vanilla Transformer, and this scaling property is more significant when we increase the number of experts.
|
| 345 |
+
|
| 346 |
+
From Figure 14 (right), we see that with 2 experts, the Switch Transformer behaves slightly worse the vanilla Transformer in terms of validation BLEU. However, when we increase the number of experts, performance of the Switch Transformer continues to improve and outperforms the vanilla Transformer with the same number of FLOPs. This indicates that in order for a sparsely activated model to outperform a densely activated one, we need to scale the former to contain much more parameters than the latter. Our observations are consistent with existing literature (Lepikhin et al., 2020; Fedus et al., 2021). For example, in Fedus et al. 2021, the sparsely activated Switch-base outperforms the densely activated T5-base using the same number of FLOPs. However, the former is more than 30 times larger (7.5 billion vs. 0.22 billion parameters).
|
| 347 |
+
|
| 348 |
+
Our method is more parameter efficient than the conventional methods. From Figure 14 (right), we see that THOR significantly outperforms the vanilla Transformer and the Switch Transformer even with only 2 experts. Moreover, when we increase the number of experts, performance of THOR also improves.
|
| 349 |
+
|
| 350 |
+
We also compare inference speed of Transformer, Switch Transformer, and THOR in Table 8. Note that for THOR , we use the Dispatch(s) method in Table 5. Note that the inference speed of Switch Transformer and THOR is slower than the vanilla Transformer because of the computation and communication overhead induced by input routing. Such an overhead is more noticeable when the number of experts is large. We remark that in Fedus et al. 2021, the speed of Switch-base is about half of T5-base (780 vs. 1600 samples per second).
|
| 351 |
+
|
| 352 |
+
Table 8: Inference speed (tokens/second).
|
| 353 |
+
|
| 354 |
+
<table><tr><td></td><td>Transformer</td><td colspan="3">Switch</td><td colspan="3">THOR</td></tr><tr><td># experts</td><td></td><td>2</td><td>16</td><td>64</td><td>2</td><td>16</td><td>64</td></tr><tr><td>Speed</td><td>15.2k</td><td>15.0k</td><td>10.4k</td><td>7.4k</td><td>15.1k</td><td>10.6k</td><td>7.5k</td></tr></table>
|
parse/dev/B72HXs80q4/B72HXs80q4_content_list.json
ADDED
|
@@ -0,0 +1,1910 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "TAMING SPARSELY ACTIVATED TRANSFORMER WITH STOCHASTIC EXPERTS ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
176,
|
| 8 |
+
99,
|
| 9 |
+
823,
|
| 10 |
+
146
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Simiao Zuo†∗, Xiaodong $\\mathbf { L i u } ^ { \\diamond }$ , Jian Jiao\u0005, Young Jin ${ \\bf K i m } ^ { \\diamond }$ , Hany Hassan\u0005, Ruofei Zhang\u0005, Tuo Zhao† and Jianfeng Gao\u0005 ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
184,
|
| 19 |
+
170,
|
| 20 |
+
812,
|
| 21 |
+
199
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "†Georgia Institute of Technology \u0005Microsoft \n{simiaozuo,tourzhao}@gatech.edu, \n{xiaodl,jian.jiao,youki,hanyh,bzhang,jfgao}@microsoft.com ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
184,
|
| 30 |
+
200,
|
| 31 |
+
740,
|
| 32 |
+
242
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "ABSTRACT ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
454,
|
| 42 |
+
279,
|
| 43 |
+
544,
|
| 44 |
+
294
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "Sparsely activated models (SAMs), such as Mixture-of-Experts (MoE), can easily scale to have outrageously large amounts of parameters without significant increase in computational cost. However, SAMs are reported to be parameter inefficient such that larger models do not always lead to better performance. While most on-going research focuses on improving SAMs models by exploring methods of routing inputs to experts, our analysis reveals that such research might not lead to the solution we expect, i.e., the commonly-used routing methods based on gating mechanisms do not work better than randomly routing inputs to experts. In this paper, we propose a new expert-based model, THOR (Transformer witH StOchastic ExpeRts). Unlike classic expert-based models, such as the Switch Transformer (Fedus et al., 2021), experts in THOR are randomly activated for each input during training and inference. THOR models are trained using a consistency regularized loss, where experts learn not only from training data but also from other experts as teachers, such that all the experts make consistent predictions. We validate the effectiveness of THOR on machine translation tasks. Results show that THOR models are more parameter efficient in that they significantly outperform the Transformer and MoE models across various settings. For example, in multilingual translation, THOR outperforms the Switch Transformer by 2 BLEU scores, and obtains the same BLEU score as that of a state-of-the-art MoE model (Kim et al., 2021) that is 18 times larger. Our code is publicly available at: https://github.com/microsoft/ Stochastic-Mixture-of-Experts. ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
233,
|
| 53 |
+
310,
|
| 54 |
+
764,
|
| 55 |
+
614
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 INTRODUCTION ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
176,
|
| 65 |
+
637,
|
| 66 |
+
336,
|
| 67 |
+
652
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Large neural network models have shown to be effective in many natural language processing tasks such as machine translation (Lewis et al., 2020; Conneau & Lample, 2019), natural language understanding (Devlin et al., 2019; Liu et al., 2019; He et al., 2020), and natural language generation (Radford et al., 2019; Brown et al., 2020). These models are usually densely activated. That is, a model uses all its parameters to process all inputs. One drawback of these models is the prohibitive training cost. Moreover, the extreme size drastically reduces inference speed, further limiting the models’ practicality. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
664,
|
| 77 |
+
825,
|
| 78 |
+
761
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "To address these issues, sparsely activated models (SAMs, Shazeer et al. 2017) have been proposed. A SAM adaptively selects a subset of its parameters for different inputs during model training and inference. This makes it possible to train SAMs that are an order of magnitude larger than densely activated models without significant increase in computational cost. For example, the sparsely activated GShard (Lepikhin et al., 2020) consists of over 600 billion parameters and the Switch Transformer (Fedus et al., 2021) 1.5 trillion parameters, while GPT-3 (Brown et al., 2020), which is arguably the largest densely activated model, consists of only 175 billion parameters. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
768,
|
| 88 |
+
823,
|
| 89 |
+
866
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "The building block of SAMs is the expert layer, which contains an attention mechanism and multiple feed-forward neural networks (FFNs) in parallel. Each FFN is referred to as an expert. During training, an input is routed to a fixed number of experts, such that the number of floating point operations (FLOPs) of one forward pass remains constant, regardless of the total number of experts. Thus, training SAMs is much more cost-efficient than training densely activated models. For example, training of Switch-large (Fedus et al., 2021) and that of T5-large (Raffel et al., 2019) require the same forward FLOPs, despite that the former is 35 times larger (26.3 vs. 0.74 billion parameters). ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
176,
|
| 98 |
+
872,
|
| 99 |
+
823,
|
| 100 |
+
901
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 0
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "",
|
| 107 |
+
"bbox": [
|
| 108 |
+
174,
|
| 109 |
+
103,
|
| 110 |
+
823,
|
| 111 |
+
174
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 1
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "However, SAMs have been reported to be parameter inefficient. For example, although the Switchlarge model is 35 times larger than T5-large, its performance on the GLUE benchmark (Wang et al., 2019a) is only slightly better (88.5 vs. 87.8). There are also cases where the performance of SAMs is even worse than smaller densely activated models. For example, the performance of Switchlarge is worse than T5-large on the ARC Reasoning Challenge (66.0 vs. 68.8) (Clark et al., 2018). In another example, although GShard (Lepikhin et al., 2020) shows substantial gains over densely activated models, a diminishing return with larger number of parameters has been observed. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
174,
|
| 120 |
+
180,
|
| 121 |
+
825,
|
| 122 |
+
279
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 1
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "Most on-going research has focused on improving SAMs by developing effective routing methods. Since only a subset of model parameters (i.e., experts) are updated for each input during training, we need to decide which experts to be activated given an input. Existing works (Shazeer et al., 2017; Lepikhin et al., 2020; Fedus et al., 2021; Yang et al., 2021) use a gating network for input routing. However, the gating mechanism suffers from the notorious load imbalance issue: the gate’s weight could collapse such that nearly all the inputs are routed to the same expert. Therefore, many methods are proposed to mitigate this issue, such as noisy gating (Shazeer et al., 2017), expert capacity (Lepikhin et al., 2020), load balancing loss (Lepikhin et al., 2020; Fedus et al., 2021), and $k$ Top-1 gating (Yang et al., 2021). However, these routing methods have not been proved effective to make SAMs more parameter efficient. To understand why SAMs are not parameter efficient, we analyze the performance of several classic MoE models. Our analysis reveals that a SAM does not always outperform a densely activated model of a similar size, confirming the results reported in Yang et al. (2021). Moreover, we also observe that the widely-used routing method based on the gating mechanism does not work better than randomly routing inputs to experts, ",
|
| 129 |
+
"bbox": [
|
| 130 |
+
174,
|
| 131 |
+
285,
|
| 132 |
+
825,
|
| 133 |
+
478
|
| 134 |
+
],
|
| 135 |
+
"page_idx": 1
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"type": "text",
|
| 139 |
+
"text": "Inspired by our findings, we propose a new SAM, THOR (Transformer witH StOchastic ExpeRts). Unlike classic SAMs, such as the Switch Transformer, experts in THOR are randomly activated (with no need of any gating mechanism) for each input during training and inference. THOR models are trained by minimizing both the cross-entropy loss and a consistency regularization term, such that experts can learn not only from training data but also from other experts as teachers so that all the experts make consistent predictions. ",
|
| 140 |
+
"bbox": [
|
| 141 |
+
174,
|
| 142 |
+
486,
|
| 143 |
+
825,
|
| 144 |
+
569
|
| 145 |
+
],
|
| 146 |
+
"page_idx": 1
|
| 147 |
+
},
|
| 148 |
+
{
|
| 149 |
+
"type": "text",
|
| 150 |
+
"text": "To validate the effectiveness of THOR, we have conducted extensive experiments on machine translation using three settings: low-resource, rich-resource, and multilingual. Results show that THOR models outperform state-of-the-art MoE models by an average of 2 BLEU score on twelve low-resource translation tasks. In the rich-resource setting, THOR achieves new state-of-the-art results on the two widely-used translation benchmarks, WMT’16 En-De and WMT’14 En-Fr. On multilingual translation tasks, the THOR model with 300 million parameters achieves 2 BLEU score improvement over a state-of-the-art MoE model of the same size. Moreover, our model achieves state-of-the-art results on these tasks — the same BLEU score that is achieved by the Z-code MoE model (Kim et al., 2021) with 5.5 billion parameters (18 times larger). ",
|
| 151 |
+
"bbox": [
|
| 152 |
+
174,
|
| 153 |
+
577,
|
| 154 |
+
825,
|
| 155 |
+
702
|
| 156 |
+
],
|
| 157 |
+
"page_idx": 1
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"type": "text",
|
| 161 |
+
"text": "2 BACKGROUND ",
|
| 162 |
+
"text_level": 1,
|
| 163 |
+
"bbox": [
|
| 164 |
+
176,
|
| 165 |
+
710,
|
| 166 |
+
326,
|
| 167 |
+
726
|
| 168 |
+
],
|
| 169 |
+
"page_idx": 1
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"type": "text",
|
| 173 |
+
"text": "Transformer. The Transformer (Vaswani et al., 2017) model has demonstrated its superior performance in many sequence-to-sequence natural language processing tasks, such as neural machine translation. The model contains an encoder and a decoder. The encoder consists of multiple encoder layers, each having an identical structure. An encoder layer employs a self-attention mechanism and a feed-forward neural network (FFN). The decoder is similarly constructed, except for an additional cross-attention mechanism in each decoder layer. ",
|
| 174 |
+
"bbox": [
|
| 175 |
+
174,
|
| 176 |
+
732,
|
| 177 |
+
823,
|
| 178 |
+
815
|
| 179 |
+
],
|
| 180 |
+
"page_idx": 1
|
| 181 |
+
},
|
| 182 |
+
{
|
| 183 |
+
"type": "text",
|
| 184 |
+
"text": "Sparsely Activated Models. The building block of SAMs is the expert layer, which is similar to the Transformer layer. Each of these expert layers contain an attention mechanism and multiple FFNs in parallel, where each FFN is referred to as an expert. Let $\\{ E _ { i } \\} _ { i = 1 } ^ { N }$ denote the experts, and $N$ denotes the total number of experts. A gating mechanism decides to which expert(s) an input should be routed. At each expert layer, given an input vector $x \\in \\mathbb { R } ^ { d }$ , where $d$ is the embedding dimension, the gate value of routing $x$ to expert $E _ { i }$ is ",
|
| 185 |
+
"bbox": [
|
| 186 |
+
174,
|
| 187 |
+
823,
|
| 188 |
+
825,
|
| 189 |
+
906
|
| 190 |
+
],
|
| 191 |
+
"page_idx": 1
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"type": "equation",
|
| 195 |
+
"img_path": "images/8758b34586d9da50a9eca7a351d782463d06c5a7e3e5de881f0068d37f52b1d8.jpg",
|
| 196 |
+
"text": "$$\np _ { i } ( { \\ ' } x ) = [ \\mathrm { S o f t m a x } \\left( W _ { g } x \\right) ] _ { i } ,\n$$",
|
| 197 |
+
"text_format": "latex",
|
| 198 |
+
"bbox": [
|
| 199 |
+
403,
|
| 200 |
+
904,
|
| 201 |
+
593,
|
| 202 |
+
921
|
| 203 |
+
],
|
| 204 |
+
"page_idx": 1
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"type": "text",
|
| 208 |
+
"text": "where $W _ { g } \\in \\mathbb { R } ^ { N \\times d }$ is the trainable weight matrix of the gating mechanism. Given the gate values $\\{ p _ { i } ( x ) \\} _ { i = 1 } ^ { N }$ , we select the top- $K$ experts to form an activated set of experts $\\mathcal { T } \\subset \\{ 1 \\cdots N \\}$ , where $| \\mathcal { T } | = K$ . Then the output $x _ { \\mathrm { o u t } }$ of the expert layer is ",
|
| 209 |
+
"bbox": [
|
| 210 |
+
174,
|
| 211 |
+
102,
|
| 212 |
+
825,
|
| 213 |
+
147
|
| 214 |
+
],
|
| 215 |
+
"page_idx": 2
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"type": "equation",
|
| 219 |
+
"img_path": "images/717205929dc627d0a27bb12c830adff42e328309772148f9bf86a3e1bb299d9c.jpg",
|
| 220 |
+
"text": "$$\nx _ { \\mathrm { o u t } } = \\sum _ { i \\in \\mathcal { T } } p _ { i } ( x ) E _ { i } ( x ) .\n$$",
|
| 221 |
+
"text_format": "latex",
|
| 222 |
+
"bbox": [
|
| 223 |
+
419,
|
| 224 |
+
147,
|
| 225 |
+
576,
|
| 226 |
+
181
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 2
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "text",
|
| 232 |
+
"text": "Notice that in Eq. 2, input $x$ only activates $K$ instead of $N$ experts, where $K \\ll N$ , e.g., $K = 2$ and $N = 2 0 4 8$ in GShard (Lepikhin et al., 2020). This implies that the number of FLOPs required for one forward pass does not increase with the number of experts $N$ . Therefore, SAMs can scale to an enormous size without any significant increase in training time and inference time. ",
|
| 233 |
+
"bbox": [
|
| 234 |
+
174,
|
| 235 |
+
186,
|
| 236 |
+
825,
|
| 237 |
+
243
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 2
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "text",
|
| 243 |
+
"text": "The gate weight matrix $W _ { g }$ (Eq. 1) is trained together with the rest of the model parameters. Because there is no constraint on the learned weights, it is possible that $W _ { g }$ collapses such that one row dominates, i.e., all the inputs are routed to one expert. This problem is referred to as load imbalance. Existing works adopt various ad-hoc heuristics to mitigate this issue, e.g., adding Gaussian noise to Eq. 1 (noisy gating, Shazeer et al. 2017), limiting the maximum number of inputs that can be routed to an expert (expert capacity, Lepikhin et al. 2020), imposing a load balancing loss (Lepikhin et al., 2020; Fedus et al., 2021), and using linear assignment (Lewis et al., 2021). There are other works that remove the gating mechanism such that load imbalance is no longer an issue, e.g., by incorporating hash functions (Roller et al., 2021). Besides the load imbalance issue, there are also heated discussions on how to construct $\\tau$ in Eq. 2. For example, Shazeer et al. (2017); Lepikhin et al. (2020); Yang et al. (2021) conjecture that routing inputs to $K > 1$ experts is necessary, while Fedus et al. (2021) argue that using $K = 1$ is sufficient and more computationally efficient. ",
|
| 244 |
+
"bbox": [
|
| 245 |
+
173,
|
| 246 |
+
250,
|
| 247 |
+
825,
|
| 248 |
+
416
|
| 249 |
+
],
|
| 250 |
+
"page_idx": 2
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"type": "text",
|
| 254 |
+
"text": "3 ANALYSIS OF SPARSELY ACTIVATED MODELS ",
|
| 255 |
+
"text_level": 1,
|
| 256 |
+
"bbox": [
|
| 257 |
+
174,
|
| 258 |
+
429,
|
| 259 |
+
589,
|
| 260 |
+
445
|
| 261 |
+
],
|
| 262 |
+
"page_idx": 2
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"type": "text",
|
| 266 |
+
"text": "We investigate behavior of the gating mechanism of several classic MoE models. We conduct experiments on a multilingual translation task, $\\{ \\mathrm { D e } , \\mathrm { V i } \\} \\to \\mathrm { E n }$ . More details are presented in Appendix A. ",
|
| 267 |
+
"bbox": [
|
| 268 |
+
174,
|
| 269 |
+
455,
|
| 270 |
+
821,
|
| 271 |
+
484
|
| 272 |
+
],
|
| 273 |
+
"page_idx": 2
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"type": "text",
|
| 277 |
+
"text": "We consider two MoE models proposed in Shen et al. (2019), referred to as MoE(dec) and MoE(tok), respectively, and three variants of the Switch Transformer proposed in Fedus et al. (2021). The number of experts is set to two for all the MoE models. We compare them with the Transformer (Vaswani et al., 2017) model of the same model size. ",
|
| 278 |
+
"bbox": [
|
| 279 |
+
174,
|
| 280 |
+
491,
|
| 281 |
+
825,
|
| 282 |
+
547
|
| 283 |
+
],
|
| 284 |
+
"page_idx": 2
|
| 285 |
+
},
|
| 286 |
+
{
|
| 287 |
+
"type": "text",
|
| 288 |
+
"text": "Figure 1 shows the validation losses and BLEU scores of three models: Transformer, MoE(dec), and MoE(tok). We see that the two MoE models perform very similarly, and neither outperforms the Transformer by a significant margin. ",
|
| 289 |
+
"bbox": [
|
| 290 |
+
176,
|
| 291 |
+
554,
|
| 292 |
+
821,
|
| 293 |
+
597
|
| 294 |
+
],
|
| 295 |
+
"page_idx": 2
|
| 296 |
+
},
|
| 297 |
+
{
|
| 298 |
+
"type": "text",
|
| 299 |
+
"text": "To interpret the results of Figure 1, we examine the load of each expert and the confidence scores of routing inputs to different experts. An expert’s load is defined as the proportion of inputs that are assigned to it. For an input that is routed to an expert, its routing confidence score (output of the gating mechanism) determines the level of preference, e.g., if the routing confidence score is 0.5, then the gate has no preference for either expert. For each expert, we compute the average routing confidence score over all the inputs assigned to it. ",
|
| 300 |
+
"bbox": [
|
| 301 |
+
174,
|
| 302 |
+
603,
|
| 303 |
+
825,
|
| 304 |
+
688
|
| 305 |
+
],
|
| 306 |
+
"page_idx": 2
|
| 307 |
+
},
|
| 308 |
+
{
|
| 309 |
+
"type": "text",
|
| 310 |
+
"text": "Figure 2 shows that after the early stage of training (i.e., the first 200 iterations), the gate weight collapses and nearly all the inputs are routed to expert 2. Also, the average routing confidence score of expert 2 is close to 1.0, which means that the gate strongly prefers expert 2 to expert 1. In this case, only one of the experts is sufficiently trained. Figure 3 depicts a different scenario, where the inputs are randomly dispatched to the experts. Notice that after approximately 4000 iterations, the two experts are equally loaded, and the probabilities of assigning any input to expert 1 and expert 2 are almost identical, indicating that the gating mechanism has no preference for either expert. ",
|
| 311 |
+
"bbox": [
|
| 312 |
+
173,
|
| 313 |
+
694,
|
| 314 |
+
825,
|
| 315 |
+
792
|
| 316 |
+
],
|
| 317 |
+
"page_idx": 2
|
| 318 |
+
},
|
| 319 |
+
{
|
| 320 |
+
"type": "text",
|
| 321 |
+
"text": "We have identified two behaviors of the gating mechanism: load imbalance and random routing. The former is also reported in recent papers (Shazeer et al., 2017; Lepikhin et al., 2020; Fedus et al., 2021). We further investigate the Switch Transformer (Fedus et al., 2021), which is a state-of-theart MoE variant that incorporates various methods to resolve the load imbalance issue. In addition, because behavior of the gating mechanism in the Switch Transformer mimics random routing (see Appendix A), we examine the effect of discarding the gate and randomly assigning inputs to experts. Figure 4 demonstrates the validation losses and BLEU scores of the Transformer and three variants of the Switch Transformer, where inputs are routed according to tokens (referred to as Switch(t)), sentences (Switch(s)), or are routed randomly (Switch(r)). Similar to the results in Figure 1, we see that the four models perform similarly. This shows that even after we alleviate load imbalance, model performance is not improved (i.e., the Switch Transformers do not outperform the vanilla Transformer), and the performance of the Switch Transformer does not vary much among different routing methods, including random routing. ",
|
| 322 |
+
"bbox": [
|
| 323 |
+
173,
|
| 324 |
+
797,
|
| 325 |
+
825,
|
| 326 |
+
924
|
| 327 |
+
],
|
| 328 |
+
"page_idx": 2
|
| 329 |
+
},
|
| 330 |
+
{
|
| 331 |
+
"type": "image",
|
| 332 |
+
"img_path": "images/5ce41b7e7940751d1d5948ca7effc9044a9840dc209eeb61b33fc74f84855ead.jpg",
|
| 333 |
+
"image_caption": [
|
| 334 |
+
"Figure 1: Validation results of MoE(dec) and MoE(tok). "
|
| 335 |
+
],
|
| 336 |
+
"image_footnote": [],
|
| 337 |
+
"bbox": [
|
| 338 |
+
174,
|
| 339 |
+
102,
|
| 340 |
+
387,
|
| 341 |
+
224
|
| 342 |
+
],
|
| 343 |
+
"page_idx": 3
|
| 344 |
+
},
|
| 345 |
+
{
|
| 346 |
+
"type": "image",
|
| 347 |
+
"img_path": "images/39785c77be1bcb254fe8546d90f85dab0c6153a1ee81200626e965b23855830a.jpg",
|
| 348 |
+
"image_caption": [
|
| 349 |
+
"Figure 2: Gating mechanism of MoE(dec). Left: average routing confidence; Right: load of experts. "
|
| 350 |
+
],
|
| 351 |
+
"image_footnote": [],
|
| 352 |
+
"bbox": [
|
| 353 |
+
421,
|
| 354 |
+
104,
|
| 355 |
+
820,
|
| 356 |
+
223
|
| 357 |
+
],
|
| 358 |
+
"page_idx": 3
|
| 359 |
+
},
|
| 360 |
+
{
|
| 361 |
+
"type": "image",
|
| 362 |
+
"img_path": "images/d029cd714530db1e2310348770a59c90fd3f914d04124646044e957f138f9bc9.jpg",
|
| 363 |
+
"image_caption": [
|
| 364 |
+
"Figure 3: Gating mechanism of MoE(tok). Left: average routing confidence; Right: load of experts. "
|
| 365 |
+
],
|
| 366 |
+
"image_footnote": [],
|
| 367 |
+
"bbox": [
|
| 368 |
+
174,
|
| 369 |
+
270,
|
| 370 |
+
562,
|
| 371 |
+
383
|
| 372 |
+
],
|
| 373 |
+
"page_idx": 3
|
| 374 |
+
},
|
| 375 |
+
{
|
| 376 |
+
"type": "image",
|
| 377 |
+
"img_path": "images/358fbe1c970d7cb2751c2794cedd6d816f30ef4ca44b2335ec9c0de3b542c89b.jpg",
|
| 378 |
+
"image_caption": [
|
| 379 |
+
"Figure 4: Performance of three variants of the Switch Transformer. "
|
| 380 |
+
],
|
| 381 |
+
"image_footnote": [],
|
| 382 |
+
"bbox": [
|
| 383 |
+
576,
|
| 384 |
+
272,
|
| 385 |
+
821,
|
| 386 |
+
385
|
| 387 |
+
],
|
| 388 |
+
"page_idx": 3
|
| 389 |
+
},
|
| 390 |
+
{
|
| 391 |
+
"type": "text",
|
| 392 |
+
"text": "",
|
| 393 |
+
"bbox": [
|
| 394 |
+
174,
|
| 395 |
+
433,
|
| 396 |
+
823,
|
| 397 |
+
489
|
| 398 |
+
],
|
| 399 |
+
"page_idx": 3
|
| 400 |
+
},
|
| 401 |
+
{
|
| 402 |
+
"type": "text",
|
| 403 |
+
"text": "We remark that in this paper, we focus on natural language processing tasks, in particular neural machine translation. There are other works in different research fields (e.g., computer vision) that draw different conclusions than ours (Riquelme et al., 2021). We attribute this to the intrinsic differences between image classification and language generation, e.g., each input in the former belongs to a clearly-defined category, while no such knowledge exists in the latter. ",
|
| 404 |
+
"bbox": [
|
| 405 |
+
174,
|
| 406 |
+
497,
|
| 407 |
+
823,
|
| 408 |
+
565
|
| 409 |
+
],
|
| 410 |
+
"page_idx": 3
|
| 411 |
+
},
|
| 412 |
+
{
|
| 413 |
+
"type": "text",
|
| 414 |
+
"text": "In summary, the experiments reveal ",
|
| 415 |
+
"bbox": [
|
| 416 |
+
174,
|
| 417 |
+
573,
|
| 418 |
+
408,
|
| 419 |
+
587
|
| 420 |
+
],
|
| 421 |
+
"page_idx": 3
|
| 422 |
+
},
|
| 423 |
+
{
|
| 424 |
+
"type": "text",
|
| 425 |
+
"text": "• A sparsely activated model does not always outperform a densely activated model of the same model size. \n• The widely-used routing method based on the gating mechanism does not work better than randomly routing inputs to experts. ",
|
| 426 |
+
"bbox": [
|
| 427 |
+
217,
|
| 428 |
+
599,
|
| 429 |
+
825,
|
| 430 |
+
660
|
| 431 |
+
],
|
| 432 |
+
"page_idx": 3
|
| 433 |
+
},
|
| 434 |
+
{
|
| 435 |
+
"type": "text",
|
| 436 |
+
"text": "4 THOR: TRANSFORMER WITH STOCHASTIC EXPERTS ",
|
| 437 |
+
"text_level": 1,
|
| 438 |
+
"bbox": [
|
| 439 |
+
176,
|
| 440 |
+
672,
|
| 441 |
+
647,
|
| 442 |
+
689
|
| 443 |
+
],
|
| 444 |
+
"page_idx": 3
|
| 445 |
+
},
|
| 446 |
+
{
|
| 447 |
+
"type": "text",
|
| 448 |
+
"text": "The ineffectiveness of the gating mechanism, as shown in our experiments, motivates us to propose a new expert-based model, THOR (Transformer witH StOchastic ExpeRts). In THOR, a pair of experts are randomly selected and activated in each layer during a training iteration, and then all the inputs in a batch are processed using the same pair of experts. Our method drastically simplifies model design, and has two additional advantages. First, it eliminates the load imbalance issue because randomly selecting a pair of experts in each iteration allows each expert to have a fair chance to be sufficiently trained. The ad-hoc heuristics, such as the load balancing loss, as discussed in Section 2, are no longer needed. Second, unlike the gating mechanism, THOR does not introduce any additional model parameters. ",
|
| 449 |
+
"bbox": [
|
| 450 |
+
173,
|
| 451 |
+
700,
|
| 452 |
+
825,
|
| 453 |
+
825
|
| 454 |
+
],
|
| 455 |
+
"page_idx": 3
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"type": "text",
|
| 459 |
+
"text": "One problem of THOR is that without a gating mechanism, experts need to be randomly selected during inference, and we may obtain inconsistent inference results due to different random seeds. For example, on a Czech-to-English translation dataset, our experiments show that randomness can result in a 0.5 BLEU score difference. ",
|
| 460 |
+
"bbox": [
|
| 461 |
+
174,
|
| 462 |
+
833,
|
| 463 |
+
825,
|
| 464 |
+
888
|
| 465 |
+
],
|
| 466 |
+
"page_idx": 3
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
"type": "text",
|
| 470 |
+
"text": "To address this issue, we introduce a consistency regularizer in the training objective of THOR. Concretely, let $N$ denotes the number of experts, $L$ the number of layers, and $\\mathsf { \\bar { E } } _ { i } ^ { l }$ an activated expert (which is a FFN) in layer $l$ , where $1 \\leq i \\leq N$ and $1 \\le l \\le L$ . We use $p = f ( \\boldsymbol { x } ; \\{ E _ { i } ^ { l } \\} _ { l = 1 } ^ { L } )$ to indicate the prediction probability of input $x$ using the model $f$ where experts $\\{ E _ { i } ^ { l } \\} _ { l = 1 } ^ { L }$ are activated. Figure 5 illustrates one training iteration. Notice that instead of activating one expert for each layer in an iteration, we select to activate a pair of experts in THOR. As a result, we obtain two prediction probabilities produced by the two selections, respectively: $p _ { 1 } \\ = \\ f ( x ; \\{ E _ { i } ^ { l } \\} _ { l = 1 } ^ { L } ) )$ and $p _ { 2 } = f ( \\boldsymbol { x } ; \\{ E _ { j } ^ { l } \\} _ { l = 1 } ^ { L } ) )$ . Then, the training objective of THOR with respect to training samples $( x , y )$ in the dataset $\\bar { \\mathcal { D } }$ is ",
|
| 471 |
+
"bbox": [
|
| 472 |
+
174,
|
| 473 |
+
895,
|
| 474 |
+
823,
|
| 475 |
+
924
|
| 476 |
+
],
|
| 477 |
+
"page_idx": 3
|
| 478 |
+
},
|
| 479 |
+
{
|
| 480 |
+
"type": "image",
|
| 481 |
+
"img_path": "images/5f99f14745ec87bad63f82138672aae15ed44384b3611039e64e0a1275be3733.jpg",
|
| 482 |
+
"image_caption": [
|
| 483 |
+
"Figure 5: Illustration of a training iteration with stochastic experts. For conciseness, we show a model with only one Transformer layer. "
|
| 484 |
+
],
|
| 485 |
+
"image_footnote": [],
|
| 486 |
+
"bbox": [
|
| 487 |
+
236,
|
| 488 |
+
101,
|
| 489 |
+
761,
|
| 490 |
+
376
|
| 491 |
+
],
|
| 492 |
+
"page_idx": 4
|
| 493 |
+
},
|
| 494 |
+
{
|
| 495 |
+
"type": "text",
|
| 496 |
+
"text": "",
|
| 497 |
+
"bbox": [
|
| 498 |
+
171,
|
| 499 |
+
431,
|
| 500 |
+
826,
|
| 501 |
+
534
|
| 502 |
+
],
|
| 503 |
+
"page_idx": 4
|
| 504 |
+
},
|
| 505 |
+
{
|
| 506 |
+
"type": "equation",
|
| 507 |
+
"img_path": "images/49ec41c27198ac4dff8dfbca00eab0b0100502ac68550921d11b8f4fa8030d73.jpg",
|
| 508 |
+
"text": "$$\n\\begin{array} { r l } & { \\operatorname* { m i n } _ { ( x , y ) \\in \\mathcal { D } } \\ell ( x , y ) = \\mathrm { C E } ( p _ { 1 } ; y ) + \\mathrm { C E } ( p _ { 2 } ; y ) + \\alpha \\mathrm { C R } ( p _ { 1 } ; p _ { 2 } ) , } \\\\ & { \\quad \\mathrm { ~ w h e r e ~ C R } ( p _ { 1 } ; p _ { 2 } ) = \\displaystyle \\frac { 1 } { 2 } \\left( \\mathrm { K L } ( p _ { 1 } \\| p _ { 2 } ) + \\mathrm { K L } ( p _ { 2 } \\| p _ { 1 } ) \\right) . } \\end{array}\n$$",
|
| 509 |
+
"text_format": "latex",
|
| 510 |
+
"bbox": [
|
| 511 |
+
289,
|
| 512 |
+
534,
|
| 513 |
+
705,
|
| 514 |
+
602
|
| 515 |
+
],
|
| 516 |
+
"page_idx": 4
|
| 517 |
+
},
|
| 518 |
+
{
|
| 519 |
+
"type": "text",
|
| 520 |
+
"text": "Here, CE is the cross-entropy loss, the consistency regularizer CR is defined as the average of the two Kullback–Leibler (KL) divergence terms, and $\\alpha$ is a hyper-parameter that controls the strength of the regularizer. In mini-batch SGD training, we randomly sample a pair of experts to activate at each layer for each batch. During inference, we can also randomly select an expert to activate at each layer for each input, similar to that in training. We can also use different expert-selection methods, such as expert-ensemble, as to be discussed in Section 5 (Table 5). ",
|
| 521 |
+
"bbox": [
|
| 522 |
+
173,
|
| 523 |
+
603,
|
| 524 |
+
825,
|
| 525 |
+
688
|
| 526 |
+
],
|
| 527 |
+
"page_idx": 4
|
| 528 |
+
},
|
| 529 |
+
{
|
| 530 |
+
"type": "text",
|
| 531 |
+
"text": "The THOR training objective of Eq. 3 forces all the experts to minimize training errors while making the same predictions as much as possible. Thus, in each training step, each expert optimizes its parameters by learning from both the training data (via minimizing the cross-entropy loss) and its paired expert as a teacher (via minimizing the KL divergence). Although these experts are learned to make consistent predictions, they converge to different (local) optima given the randomness introduced in training, e.g., initialization, mini-batch SGD, random routing, etc. Thus, every expert learns from a set of diverse teachers during the course of training, which helps to improve model’s performance. In addition, by penalizing experts that yield inconsistent predictions from the others, the consistency regularizer also helps reducing the variance of model prediction. ",
|
| 532 |
+
"bbox": [
|
| 533 |
+
173,
|
| 534 |
+
694,
|
| 535 |
+
825,
|
| 536 |
+
820
|
| 537 |
+
],
|
| 538 |
+
"page_idx": 4
|
| 539 |
+
},
|
| 540 |
+
{
|
| 541 |
+
"type": "text",
|
| 542 |
+
"text": "THOR is conceptually similar to dropout (Srivastava et al., 2014) since both methods route an input to some randomly selected sub-net components (i.e., experts in THOR and neurons in dropout). However, THOR differs from dropout in several important aspects, making it a better choice for efficient training and serving of large-scale neural models. First, THOR can be applied to both training and inference, while dropout is only used for training. Second, THOR is shown to be more robust in large-scale model training than dropout. For example, our models are less likely to overfit with the increase in the number of experts (see Figure 9). Third, THOR leads to a sparse model that is more structured than that of dropout, such that a large-scale THOR model can be much more easily trained using GPU clusters, e.g., by putting different experts on different GPUs in parallel. ",
|
| 543 |
+
"bbox": [
|
| 544 |
+
173,
|
| 545 |
+
825,
|
| 546 |
+
825,
|
| 547 |
+
924
|
| 548 |
+
],
|
| 549 |
+
"page_idx": 4
|
| 550 |
+
},
|
| 551 |
+
{
|
| 552 |
+
"type": "text",
|
| 553 |
+
"text": "",
|
| 554 |
+
"bbox": [
|
| 555 |
+
171,
|
| 556 |
+
103,
|
| 557 |
+
823,
|
| 558 |
+
132
|
| 559 |
+
],
|
| 560 |
+
"page_idx": 5
|
| 561 |
+
},
|
| 562 |
+
{
|
| 563 |
+
"type": "text",
|
| 564 |
+
"text": "5 EXPERIMENTS ",
|
| 565 |
+
"text_level": 1,
|
| 566 |
+
"bbox": [
|
| 567 |
+
176,
|
| 568 |
+
143,
|
| 569 |
+
328,
|
| 570 |
+
160
|
| 571 |
+
],
|
| 572 |
+
"page_idx": 5
|
| 573 |
+
},
|
| 574 |
+
{
|
| 575 |
+
"type": "text",
|
| 576 |
+
"text": "We evaluate THOR on neural machine translation. We adopt three settings: low-resource translation, rich-resource translation, and multilingual translation. For low-resource and rich-resource translation, we train all the models using Fairseq1 (Ott et al., 2019). For multilingual translation, we use DeepSpeed $M o E ^ { 2 }$ (Kim et al., 2021) to implement the MoE models. All the experiments are conducted on NVIDIA V100 GPUs. Additional experiments, including model scale-up and comparison of inference speed, are deferred to Appendix D. ",
|
| 577 |
+
"bbox": [
|
| 578 |
+
174,
|
| 579 |
+
171,
|
| 580 |
+
825,
|
| 581 |
+
256
|
| 582 |
+
],
|
| 583 |
+
"page_idx": 5
|
| 584 |
+
},
|
| 585 |
+
{
|
| 586 |
+
"type": "text",
|
| 587 |
+
"text": "5.1 BASELINE",
|
| 588 |
+
"text_level": 1,
|
| 589 |
+
"bbox": [
|
| 590 |
+
174,
|
| 591 |
+
265,
|
| 592 |
+
287,
|
| 593 |
+
280
|
| 594 |
+
],
|
| 595 |
+
"page_idx": 5
|
| 596 |
+
},
|
| 597 |
+
{
|
| 598 |
+
"type": "text",
|
| 599 |
+
"text": "We use two baselines in the experiments. ",
|
| 600 |
+
"bbox": [
|
| 601 |
+
176,
|
| 602 |
+
290,
|
| 603 |
+
442,
|
| 604 |
+
304
|
| 605 |
+
],
|
| 606 |
+
"page_idx": 5
|
| 607 |
+
},
|
| 608 |
+
{
|
| 609 |
+
"type": "text",
|
| 610 |
+
"text": "• Transformer (Vaswani et al., 2017) achieves superior performance in many sequence-tosequence learning tasks, such as neural machine translation. • Switch Transformer (Fedus et al., 2021) is a state-of-the-art MoE model, which employs a gating mechanism to route inputs and uses a load balancing loss to reduce load imbalance. ",
|
| 611 |
+
"bbox": [
|
| 612 |
+
212,
|
| 613 |
+
316,
|
| 614 |
+
823,
|
| 615 |
+
378
|
| 616 |
+
],
|
| 617 |
+
"page_idx": 5
|
| 618 |
+
},
|
| 619 |
+
{
|
| 620 |
+
"type": "text",
|
| 621 |
+
"text": "To verify the effectiveness of the imposed consistency regularizer in Eq. 3, we also compare THOR with Transformer models trained using two popular regularization methods. We remark that these two methods share similar computational costs with THOR, i.e., they also require two forward passes in each training iteration. ",
|
| 622 |
+
"bbox": [
|
| 623 |
+
176,
|
| 624 |
+
392,
|
| 625 |
+
825,
|
| 626 |
+
448
|
| 627 |
+
],
|
| 628 |
+
"page_idx": 5
|
| 629 |
+
},
|
| 630 |
+
{
|
| 631 |
+
"type": "text",
|
| 632 |
+
"text": "• SMART (Jiang et al., 2020) utilizes a smoothness inducing adversarial regularizer to penalize the worst case difference between predictions of a clean input and a perturbed input. • R3F (Aghajanyan et al., 2020) uses a regularizer to reduce representational collapse. The method has shown to be effective in various natural language processing tasks. ",
|
| 633 |
+
"bbox": [
|
| 634 |
+
218,
|
| 635 |
+
460,
|
| 636 |
+
825,
|
| 637 |
+
522
|
| 638 |
+
],
|
| 639 |
+
"page_idx": 5
|
| 640 |
+
},
|
| 641 |
+
{
|
| 642 |
+
"type": "text",
|
| 643 |
+
"text": "All the methods are trained for the same number of FLOPs in the experiments for fair comparison. ",
|
| 644 |
+
"bbox": [
|
| 645 |
+
171,
|
| 646 |
+
535,
|
| 647 |
+
816,
|
| 648 |
+
550
|
| 649 |
+
],
|
| 650 |
+
"page_idx": 5
|
| 651 |
+
},
|
| 652 |
+
{
|
| 653 |
+
"type": "text",
|
| 654 |
+
"text": "5.2 LOW-RESOURCE TRANSLATION ",
|
| 655 |
+
"text_level": 1,
|
| 656 |
+
"bbox": [
|
| 657 |
+
176,
|
| 658 |
+
560,
|
| 659 |
+
436,
|
| 660 |
+
574
|
| 661 |
+
],
|
| 662 |
+
"page_idx": 5
|
| 663 |
+
},
|
| 664 |
+
{
|
| 665 |
+
"type": "text",
|
| 666 |
+
"text": "We use six language pairs: English to Vietnamese, English to German, and English to French from IWSLT; English to Romanian, English to Latvian, and English to Czech from Europarl3. Dataset statistics are summarized in Table 6 (Appendix B). ",
|
| 667 |
+
"bbox": [
|
| 668 |
+
176,
|
| 669 |
+
584,
|
| 670 |
+
825,
|
| 671 |
+
627
|
| 672 |
+
],
|
| 673 |
+
"page_idx": 5
|
| 674 |
+
},
|
| 675 |
+
{
|
| 676 |
+
"type": "table",
|
| 677 |
+
"img_path": "images/fe9c25c004e8215b777f21b4e4f0ccbe8881331029dcad664191c3b21e12de9a.jpg",
|
| 678 |
+
"table_caption": [
|
| 679 |
+
"Table 1: Experimental results on low resource datasets. The best result on each dataset is in bold. "
|
| 680 |
+
],
|
| 681 |
+
"table_footnote": [],
|
| 682 |
+
"table_body": "<table><tr><td></td><td>En-Vi</td><td>Vi-En</td><td>En-De</td><td>De-En</td><td>En-Fr</td><td>Fr-En</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>31.3</td><td>29.4</td><td>28.1</td><td>34.8</td><td>39.2</td><td>38.1</td></tr><tr><td>SMART (Jiang et al., 2020)</td><td>32.5</td><td>30.5</td><td>29.3</td><td>35.8</td><td>40.0</td><td>38.8</td></tr><tr><td>R3F (Aghajanyan et al., 2020)</td><td>32.2</td><td>30.7</td><td>29.2</td><td>35.7</td><td>39.7</td><td>38.9</td></tr><tr><td>Switch (Fedus et al., 2021)</td><td>31.7</td><td>29.5</td><td>28.4</td><td>34.6</td><td>39.1</td><td>38.2</td></tr><tr><td>THOR</td><td>34.0</td><td>33.0</td><td>31.1</td><td>37.8</td><td>40.7</td><td>40.0</td></tr><tr><td></td><td>En-Ro</td><td>Ro-En</td><td>En-Lv</td><td>Lv-En</td><td>En-Cs</td><td>Cs-En</td></tr><tr><td>Transformer (Vaswani et al., 2017)</td><td>23.5</td><td>25.0</td><td>13.6</td><td>15.8</td><td>16.1</td><td>20.4</td></tr><tr><td>SMART (Jiang et al., 2020)</td><td>24.6</td><td>25.7</td><td>14.2</td><td>16.3</td><td>16.7</td><td>21.4</td></tr><tr><td>R3F (Aghajanyan et al., 2020)</td><td>23.8</td><td>25.8</td><td>14.4</td><td>16.3</td><td>16.8</td><td>21.6</td></tr><tr><td>Switch (Fedus et al., 2021)</td><td>23.8</td><td>24.4</td><td>13.8</td><td>16.1</td><td>16.1</td><td>20.6</td></tr><tr><td>THOR</td><td>25.2</td><td>27.1</td><td>15.2</td><td>17.4</td><td>17.6</td><td>22.4</td></tr></table>",
|
| 683 |
+
"bbox": [
|
| 684 |
+
184,
|
| 685 |
+
659,
|
| 686 |
+
808,
|
| 687 |
+
869
|
| 688 |
+
],
|
| 689 |
+
"page_idx": 5
|
| 690 |
+
},
|
| 691 |
+
{
|
| 692 |
+
"type": "text",
|
| 693 |
+
"text": "To evaluate THOR with different model sizes, we use the Transformer-base (Vaswani et al., 2017) architecture on Europarl datasets, and a smaller model on IWSLT datasets. Compared with Transformer-base, the smaller model decreases the hidden dimension from 2048 to 1024, and decreases the number of heads from 8 to 4 with the dimension of each head doubled. We use two experts for the expert-based models. We remark that even though THOR increases the number of parameters, its inference speed (in terms of FLOPs) is the same as Transformer-base because only one expert is activated for each input. Interested readers refer to Appendix C for more details. ",
|
| 694 |
+
"bbox": [
|
| 695 |
+
174,
|
| 696 |
+
103,
|
| 697 |
+
825,
|
| 698 |
+
202
|
| 699 |
+
],
|
| 700 |
+
"page_idx": 6
|
| 701 |
+
},
|
| 702 |
+
{
|
| 703 |
+
"type": "text",
|
| 704 |
+
"text": "The experimental results in Table 1 show that performance of the Switch Transformer is on par with the vanilla Transformer, e.g., its average BLEU score on the 12 datasets is 26.3, the same as the Transformer. The results confirm that SAMs do not outperform densely activated models with similar model sizes. In contrast, THOR achieves more than 1.0 BLEU score improvement over the Switch Transformer in all the 12 tasks. THOR also significantly outperforms the models trained using the two competing regularization methods, SMART and R3F. ",
|
| 705 |
+
"bbox": [
|
| 706 |
+
174,
|
| 707 |
+
208,
|
| 708 |
+
825,
|
| 709 |
+
291
|
| 710 |
+
],
|
| 711 |
+
"page_idx": 6
|
| 712 |
+
},
|
| 713 |
+
{
|
| 714 |
+
"type": "text",
|
| 715 |
+
"text": "5.3 RICH-RESOURCE TRANSLATION ",
|
| 716 |
+
"text_level": 1,
|
| 717 |
+
"bbox": [
|
| 718 |
+
176,
|
| 719 |
+
303,
|
| 720 |
+
437,
|
| 721 |
+
316
|
| 722 |
+
],
|
| 723 |
+
"page_idx": 6
|
| 724 |
+
},
|
| 725 |
+
{
|
| 726 |
+
"type": "text",
|
| 727 |
+
"text": "We use two widely adopted rich-resource translation benchmarks: English to German translation from WMT’16 and English to French translation from WMT’14. The former dataset consists of 4.5 million training sentence pairs, and the latter 36 million pairs. We follow the pre-processing steps in Ott et al. (2018). ",
|
| 728 |
+
"bbox": [
|
| 729 |
+
174,
|
| 730 |
+
327,
|
| 731 |
+
493,
|
| 732 |
+
424
|
| 733 |
+
],
|
| 734 |
+
"page_idx": 6
|
| 735 |
+
},
|
| 736 |
+
{
|
| 737 |
+
"type": "text",
|
| 738 |
+
"text": "To evaluate THOR , We use the Transformer-big architecture (Vaswani et al., 2017) and we set the number of experts for both THOR and the Switch Transformer to 4. Interested readers refer to Appendix C for more details. ",
|
| 739 |
+
"bbox": [
|
| 740 |
+
173,
|
| 741 |
+
433,
|
| 742 |
+
493,
|
| 743 |
+
502
|
| 744 |
+
],
|
| 745 |
+
"page_idx": 6
|
| 746 |
+
},
|
| 747 |
+
{
|
| 748 |
+
"type": "text",
|
| 749 |
+
"text": "Table 2 reports the BLEU scores and the sacreBLEU scores (Post, 2018) of different models. We see that THOR achieves new state-ofthe-art results in the setting where neither data augmentation nor pre-trained language model is used. Specifically, THOR lifts the previous state-of-the-art (Liu et al., 2020b;c) by 0.3 BLEU score on the En-De translation task and 0.1 BLEU score on the En-Fr translation task. THOR also significantly outperforms the models trained using the other two regularization methods, SMART (Jiang et al., 2020) and R3F (Aghajanyan et al., 2020). Similar to what is observed in low-resource translation, the Switch Transformer (Fedus et al., 2021) does not outperform the vanilla Transformer (Ott et al., 2018). ",
|
| 750 |
+
"bbox": [
|
| 751 |
+
174,
|
| 752 |
+
511,
|
| 753 |
+
493,
|
| 754 |
+
732
|
| 755 |
+
],
|
| 756 |
+
"page_idx": 6
|
| 757 |
+
},
|
| 758 |
+
{
|
| 759 |
+
"type": "table",
|
| 760 |
+
"img_path": "images/75a01f2e692418c53c14509bd29d5d92e3254bac52b1ef254186634605d2312e.jpg",
|
| 761 |
+
"table_caption": [
|
| 762 |
+
"Table 2: BLEU and sacreBLEU scores on WMT’14 En-Fr and WMT’16 En-De. Results of Jiang et al. (2020), Aghajanyan et al. (2020), and Fedus et al. (2021) are from our implementation. "
|
| 763 |
+
],
|
| 764 |
+
"table_footnote": [],
|
| 765 |
+
"table_body": "<table><tr><td>BLEU</td><td>En-De</td><td>En-Fr</td></tr><tr><td>Vas wani et al. (2017)</td><td>28.4</td><td>41.8</td></tr><tr><td>Ott et al. (2018)</td><td>29.3</td><td>43.2</td></tr><tr><td>Wang et al. (2019b)</td><td>29.6</td><td>一</td></tr><tr><td>Wu et al. (2019a)</td><td>29.7</td><td>43.2</td></tr><tr><td>So et al. (2019)</td><td>29.8</td><td>41.3</td></tr><tr><td>Jiang et al. (2020)</td><td>29.8</td><td>43.4</td></tr><tr><td>Wu et al. (2019b)</td><td>29.9</td><td>43.3</td></tr><tr><td>Aghajanyan et al. (2020)</td><td>29.4</td><td>43.3</td></tr><tr><td>Liu et al. (2020c)</td><td>30.1</td><td>43.8</td></tr><tr><td>Fedus et al. (2021)</td><td>29.3</td><td>43.0</td></tr><tr><td>THOR</td><td>30.4</td><td>43.8</td></tr><tr><td>sacreBLEU</td><td>En-De</td><td>En-Fr</td></tr><tr><td>Ott et al. (2018)</td><td>28.6</td><td>41.4</td></tr><tr><td> Jiang et al. (2020)</td><td>29.1</td><td>41.5</td></tr><tr><td>So et al. (2019)</td><td>29.2</td><td></td></tr><tr><td>Aghajanyan et al. (2020)</td><td>29.0</td><td>41.5</td></tr><tr><td>Liu et al. (2020c)</td><td>29.5</td><td>41.8</td></tr><tr><td>Fedus et al. (2021)</td><td>28.6</td><td>41.1</td></tr><tr><td>THOR</td><td>29.6</td><td>41.9</td></tr></table>",
|
| 766 |
+
"bbox": [
|
| 767 |
+
521,
|
| 768 |
+
406,
|
| 769 |
+
828,
|
| 770 |
+
728
|
| 771 |
+
],
|
| 772 |
+
"page_idx": 6
|
| 773 |
+
},
|
| 774 |
+
{
|
| 775 |
+
"type": "text",
|
| 776 |
+
"text": "5.4 MULTILINGUAL TRANSLATION ",
|
| 777 |
+
"text_level": 1,
|
| 778 |
+
"bbox": [
|
| 779 |
+
176,
|
| 780 |
+
743,
|
| 781 |
+
429,
|
| 782 |
+
757
|
| 783 |
+
],
|
| 784 |
+
"page_idx": 6
|
| 785 |
+
},
|
| 786 |
+
{
|
| 787 |
+
"type": "text",
|
| 788 |
+
"text": "We have collected 10 language pairs from WMT datasets, and built a $6 4 k$ -entry dictionary for all the languages. The detailed statistics are summarized in Table 7 (Appendix B). Please refer to Kim et al. (2021) for more details. We do not use multi-task learning or additional monolingual data in the experiments. ",
|
| 789 |
+
"bbox": [
|
| 790 |
+
174,
|
| 791 |
+
767,
|
| 792 |
+
825,
|
| 793 |
+
823
|
| 794 |
+
],
|
| 795 |
+
"page_idx": 6
|
| 796 |
+
},
|
| 797 |
+
{
|
| 798 |
+
"type": "text",
|
| 799 |
+
"text": "We use the following model architecture: the embedding dimension is set to 768 and the hidden dimension for the FFN is set to 3072; we use 12 encoder layers and 6 decoder layers, where each layer has 12 attention heads, and the dimension of each head is 64. We set the number of experts to 4 for both THOR and the Switch Transformer. ",
|
| 800 |
+
"bbox": [
|
| 801 |
+
174,
|
| 802 |
+
830,
|
| 803 |
+
823,
|
| 804 |
+
886
|
| 805 |
+
],
|
| 806 |
+
"page_idx": 6
|
| 807 |
+
},
|
| 808 |
+
{
|
| 809 |
+
"type": "text",
|
| 810 |
+
"text": "Table 3 reports the average BLEU score of translating English to other languages, translating other languages to English, and the overall score of the 20 tasks. We see that compared with the Switch ",
|
| 811 |
+
"bbox": [
|
| 812 |
+
171,
|
| 813 |
+
893,
|
| 814 |
+
823,
|
| 815 |
+
921
|
| 816 |
+
],
|
| 817 |
+
"page_idx": 6
|
| 818 |
+
},
|
| 819 |
+
{
|
| 820 |
+
"type": "text",
|
| 821 |
+
"text": "Transformer of the same size (i.e., 300 million parameters), our model achieves a 2-point improvement in the overall BLEU score. In addition, our model is far more parameter efficient than the Switch Transformer. The THOR model with 300 million parameters achieves the same BLEU score (24.4) that is achieved by the Switch Transformer with 5.5 billion parameters, which is more than 18 times larger. ",
|
| 822 |
+
"bbox": [
|
| 823 |
+
174,
|
| 824 |
+
103,
|
| 825 |
+
825,
|
| 826 |
+
174
|
| 827 |
+
],
|
| 828 |
+
"page_idx": 7
|
| 829 |
+
},
|
| 830 |
+
{
|
| 831 |
+
"type": "table",
|
| 832 |
+
"img_path": "images/b4853093324a2f1d7f7eb3ef49b9728933b6a0fb0daec41ad741fdb756c3037c.jpg",
|
| 833 |
+
"table_caption": [
|
| 834 |
+
"Table 3: Multilingual translation results. Here $\\mathbf { \\vec { E } } ^ { \\prime } \\mathbf { \\vec { \\Sigma } }$ means the number of experts. "
|
| 835 |
+
],
|
| 836 |
+
"table_footnote": [],
|
| 837 |
+
"table_body": "<table><tr><td></td><td>En-→Others</td><td>Others-En</td><td>Average</td></tr><tr><td>Switch (32E,5.5B)</td><td>一</td><td>一</td><td>24.4</td></tr><tr><td>Switch (4E,300M)</td><td>20.3</td><td>24.6</td><td>22.4</td></tr><tr><td>THOR (4E,300M)</td><td>21.4</td><td>27.4</td><td>24.4</td></tr></table>",
|
| 838 |
+
"bbox": [
|
| 839 |
+
287,
|
| 840 |
+
205,
|
| 841 |
+
707,
|
| 842 |
+
284
|
| 843 |
+
],
|
| 844 |
+
"page_idx": 7
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"type": "text",
|
| 848 |
+
"text": "Figure 6 shows BLEU scores in all the 20 translation tasks. Notice that THOR outperforms the baseline on 17 out of the 20 tasks. The improvement is in general more significant on the tasks with smaller datasets. For example, our model achieves BLEU score improvement of 4.7 and 6.7 on Gu-En $( 8 5 k )$ and Hi-En $( 2 6 4 k )$ , respectively. On the tasks with larger datasets, the improvement obtained by our model is less substantial, but still significant, e.g., $+ 0 . 9$ BLEU score on Cs-En $( 1 0 M )$ and $+ 1 . 1$ Fi-En $( 4 . 8 M )$ . For the only three tasks where our model underperforms the baseline, the gaps are small, e.g., $- 0 . 4 , - 0 . 2$ , and $- 0 . 4$ BLEU scores on En-Cs, En-De, and En-Fr, respectively. ",
|
| 849 |
+
"bbox": [
|
| 850 |
+
173,
|
| 851 |
+
297,
|
| 852 |
+
825,
|
| 853 |
+
397
|
| 854 |
+
],
|
| 855 |
+
"page_idx": 7
|
| 856 |
+
},
|
| 857 |
+
{
|
| 858 |
+
"type": "image",
|
| 859 |
+
"img_path": "images/47ee78916feaa5dcffafc87c05c5c0979387b34e09f5e6f6145ecacb292f0bce.jpg",
|
| 860 |
+
"image_caption": [
|
| 861 |
+
"Figure 6: Details of multilingual translation results. "
|
| 862 |
+
],
|
| 863 |
+
"image_footnote": [],
|
| 864 |
+
"bbox": [
|
| 865 |
+
218,
|
| 866 |
+
410,
|
| 867 |
+
776,
|
| 868 |
+
665
|
| 869 |
+
],
|
| 870 |
+
"page_idx": 7
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"type": "text",
|
| 874 |
+
"text": "5.5 ABLATION EXPERIMENTS ",
|
| 875 |
+
"text_level": 1,
|
| 876 |
+
"bbox": [
|
| 877 |
+
174,
|
| 878 |
+
702,
|
| 879 |
+
393,
|
| 880 |
+
717
|
| 881 |
+
],
|
| 882 |
+
"page_idx": 7
|
| 883 |
+
},
|
| 884 |
+
{
|
| 885 |
+
"type": "text",
|
| 886 |
+
"text": "Training Objective. We examine the relative contributions of the three loss terms used in the THOR training objective of Eq. 3: $\\mathrm { C E _ { 1 } }$ , $\\mathrm { C E _ { 2 } }$ and CR. The result in Table 4 shows that the consistency regularizer CR is crucial to the model performance, and that dropping one of the two CE terms leads to only very small BLEU score loss since the two cross-entropy terms play the same role in training. ",
|
| 887 |
+
"bbox": [
|
| 888 |
+
173,
|
| 889 |
+
726,
|
| 890 |
+
825,
|
| 891 |
+
796
|
| 892 |
+
],
|
| 893 |
+
"page_idx": 7
|
| 894 |
+
},
|
| 895 |
+
{
|
| 896 |
+
"type": "text",
|
| 897 |
+
"text": "Inference Methods. We compare three inference methods: (1) Dispatch(s) uses sentencelevel random routing, where all tokens in one sentence are routed to the same expert; (2) Dispatch(t) uses token-level random routing, where tokens within a sentence are routed to different experts; (3) Ensemble, where each sentence is routed to all the $N$ experts, and the $N$ hidden representations in each layer are averaged. Note that the number of FLOPs is larger for Ensemble because we need to run forward pass for each input through $N$ experts. Table 5 shows that Dispatch(s) and Dispatch(t) perform similarly, and Ensemble yields the best BLEU score with a cost of longer inference time. ",
|
| 898 |
+
"bbox": [
|
| 899 |
+
173,
|
| 900 |
+
811,
|
| 901 |
+
825,
|
| 902 |
+
924
|
| 903 |
+
],
|
| 904 |
+
"page_idx": 7
|
| 905 |
+
},
|
| 906 |
+
{
|
| 907 |
+
"type": "table",
|
| 908 |
+
"img_path": "images/843448907b429288423ba992c7a547a2b51831852f79356295946cd89033f76d.jpg",
|
| 909 |
+
"table_caption": [
|
| 910 |
+
"Table 4: Effect of the three loss terms in training object of Eq. 3, tested on Cs-En translation. "
|
| 911 |
+
],
|
| 912 |
+
"table_footnote": [],
|
| 913 |
+
"table_body": "<table><tr><td>Loss terms</td><td>BLEU</td></tr><tr><td>CE1+CE2+CR</td><td>22.4</td></tr><tr><td>CE+CR</td><td>22.2</td></tr><tr><td>CEi+CE2 CE1</td><td>20.8 20.6</td></tr></table>",
|
| 914 |
+
"bbox": [
|
| 915 |
+
230,
|
| 916 |
+
146,
|
| 917 |
+
439,
|
| 918 |
+
231
|
| 919 |
+
],
|
| 920 |
+
"page_idx": 8
|
| 921 |
+
},
|
| 922 |
+
{
|
| 923 |
+
"type": "table",
|
| 924 |
+
"img_path": "images/8720ea8d9ed95235f00beae83b00826d91fecae2afb4b1c4a6c2ebb43a04971f.jpg",
|
| 925 |
+
"table_caption": [
|
| 926 |
+
"Table 5: Performance and costs of three inference methods, tested on CsEn translation. "
|
| 927 |
+
],
|
| 928 |
+
"table_footnote": [],
|
| 929 |
+
"table_body": "<table><tr><td></td><td>BLEU</td><td>time</td></tr><tr><td>Dispatch(s)</td><td>22.4</td><td>×1</td></tr><tr><td>Dispatch(t)</td><td>22.4</td><td>×1</td></tr><tr><td>Ensemble</td><td>22.6</td><td>×N</td></tr></table>",
|
| 930 |
+
"bbox": [
|
| 931 |
+
511,
|
| 932 |
+
160,
|
| 933 |
+
753,
|
| 934 |
+
231
|
| 935 |
+
],
|
| 936 |
+
"page_idx": 8
|
| 937 |
+
},
|
| 938 |
+
{
|
| 939 |
+
"type": "image",
|
| 940 |
+
"img_path": "images/8990a56beacdabb787e3e6e0ec1d9e52d5a981de9e8903795cf2a566cf99eaed.jpg",
|
| 941 |
+
"image_caption": [
|
| 942 |
+
"Figure 7: Effect of the consistency regularization strength $\\alpha$ on Cs-En translation. "
|
| 943 |
+
],
|
| 944 |
+
"image_footnote": [],
|
| 945 |
+
"bbox": [
|
| 946 |
+
174,
|
| 947 |
+
246,
|
| 948 |
+
369,
|
| 949 |
+
344
|
| 950 |
+
],
|
| 951 |
+
"page_idx": 8
|
| 952 |
+
},
|
| 953 |
+
{
|
| 954 |
+
"type": "image",
|
| 955 |
+
"img_path": "images/e2403090c25d36c39603a69b0394ad699907c7d7a9994afab36f940bd7f53288.jpg",
|
| 956 |
+
"image_caption": [
|
| 957 |
+
"Figure 8: Violin plot of performance consistency on CsEn translation. "
|
| 958 |
+
],
|
| 959 |
+
"image_footnote": [],
|
| 960 |
+
"bbox": [
|
| 961 |
+
400,
|
| 962 |
+
247,
|
| 963 |
+
588,
|
| 964 |
+
344
|
| 965 |
+
],
|
| 966 |
+
"page_idx": 8
|
| 967 |
+
},
|
| 968 |
+
{
|
| 969 |
+
"type": "image",
|
| 970 |
+
"img_path": "images/93cde2bf94f3496d3e139de10ba2fd43edec0fdfe2d40e0edd8045bf91d25c91.jpg",
|
| 971 |
+
"image_caption": [
|
| 972 |
+
"Figure 9: BLEU vs. model size on De-En translation. "
|
| 973 |
+
],
|
| 974 |
+
"image_footnote": [],
|
| 975 |
+
"bbox": [
|
| 976 |
+
620,
|
| 977 |
+
247,
|
| 978 |
+
818,
|
| 979 |
+
358
|
| 980 |
+
],
|
| 981 |
+
"page_idx": 8
|
| 982 |
+
},
|
| 983 |
+
{
|
| 984 |
+
"type": "text",
|
| 985 |
+
"text": "Regularization strength. To investigate the effect of the regularization strength $\\alpha$ , we run experiments on the Cs-En translation dataset in the low-resource setting. Figure 7 shows that model performance is not very sensitive to $\\alpha$ as long as the value is large enough, say $\\alpha > 2 . 0$ . ",
|
| 986 |
+
"bbox": [
|
| 987 |
+
174,
|
| 988 |
+
409,
|
| 989 |
+
823,
|
| 990 |
+
450
|
| 991 |
+
],
|
| 992 |
+
"page_idx": 8
|
| 993 |
+
},
|
| 994 |
+
{
|
| 995 |
+
"type": "text",
|
| 996 |
+
"text": "Consistency of Model Prediction. We study the variance of model prediction due to the use of randomly activated experts during inference. We compare THOR and the Switch Transformer, where we remove the trained gate during inference. For each model, we compute the variance of model prediction based on 20 runs. As shown in Figure 8, THOR makes more consistent predictions than Switch Transformer due to the use of the consistency regularizer for model training. The variance of THOR is below 0.002, whereas the variance of Switch Transformer is 0.008, four times larger. We remark that by removing the trained router from the Switch Transformer, model performance only marginally decreases (from 20.6 to 20.4). This further indicates that a trained router may not be better than a random router. ",
|
| 997 |
+
"bbox": [
|
| 998 |
+
174,
|
| 999 |
+
465,
|
| 1000 |
+
825,
|
| 1001 |
+
590
|
| 1002 |
+
],
|
| 1003 |
+
"page_idx": 8
|
| 1004 |
+
},
|
| 1005 |
+
{
|
| 1006 |
+
"type": "text",
|
| 1007 |
+
"text": "Overfitting. We compare the THOR model and the Transformer model regarding how likely they overfit the training data when the model size increases. We run experiments on the De-En data in the low-resource setting, where the dropout rate of the FFNs in the Transformer is selected such that the number of parameters trained in one iteration is the same as the THOR model. As shown in Figure 9, THOR does not show any sign of overfitting — we observe a consistent improvement in BLEU score as we increase the number of experts from 2 to 8. In contrast, the Transformer model’s performance deteriorates as we increase the hidden dimension of its FFN from $2 k$ to $8 k$ . We remark that we also observe the overfitting phenomenon on larger datasets, e.g., the Transformer overfits on the Cs-En dataset when we set the hidden dimension of its FFN to $1 6 k$ . ",
|
| 1008 |
+
"bbox": [
|
| 1009 |
+
174,
|
| 1010 |
+
606,
|
| 1011 |
+
825,
|
| 1012 |
+
731
|
| 1013 |
+
],
|
| 1014 |
+
"page_idx": 8
|
| 1015 |
+
},
|
| 1016 |
+
{
|
| 1017 |
+
"type": "text",
|
| 1018 |
+
"text": "6 CONCLUSION ",
|
| 1019 |
+
"text_level": 1,
|
| 1020 |
+
"bbox": [
|
| 1021 |
+
174,
|
| 1022 |
+
743,
|
| 1023 |
+
318,
|
| 1024 |
+
760
|
| 1025 |
+
],
|
| 1026 |
+
"page_idx": 8
|
| 1027 |
+
},
|
| 1028 |
+
{
|
| 1029 |
+
"type": "text",
|
| 1030 |
+
"text": "We present a new expert-based sparsely activated model, THOR. Unlike existing SAMs, such as the Switch Transformer, experts in THOR are randomly activated for each input during training and inference. THOR models are trained using a consistency regularized loss, where every expert learns not only from training data but also from other experts as teachers so that all the experts make consistent predictions. As a result, not only can large-scale THOR models be trained and served as efficiently as classic MoE models, THOR models also demonstrate a better generalization capability in that they are more parameter-efficient, less likely to overfit, make more consistent predictions, and achieve better results consistently across different settings. We validate the effectiveness of THOR via a comprehensive empirical study on machine translation. In all the three settings (i.e., low-resource, rich-resource, and multilingual translation), THOR models significantly outperform the vanilla Transformer, and Switch Transformer, a state-of-the-art MoE model. ",
|
| 1031 |
+
"bbox": [
|
| 1032 |
+
173,
|
| 1033 |
+
770,
|
| 1034 |
+
825,
|
| 1035 |
+
924
|
| 1036 |
+
],
|
| 1037 |
+
"page_idx": 8
|
| 1038 |
+
},
|
| 1039 |
+
{
|
| 1040 |
+
"type": "text",
|
| 1041 |
+
"text": "ACKNOWLEDGMENTS ",
|
| 1042 |
+
"text_level": 1,
|
| 1043 |
+
"bbox": [
|
| 1044 |
+
176,
|
| 1045 |
+
103,
|
| 1046 |
+
356,
|
| 1047 |
+
118
|
| 1048 |
+
],
|
| 1049 |
+
"page_idx": 9
|
| 1050 |
+
},
|
| 1051 |
+
{
|
| 1052 |
+
"type": "text",
|
| 1053 |
+
"text": "We thank Rukmini Lyer, Kevin Duh, Hao Cheng, Chunyuan Li, Johannes Gehrke, colleagues from Microsoft Bing Ads team and Microsoft Research for their valuable discussions and comments. ",
|
| 1054 |
+
"bbox": [
|
| 1055 |
+
173,
|
| 1056 |
+
128,
|
| 1057 |
+
825,
|
| 1058 |
+
157
|
| 1059 |
+
],
|
| 1060 |
+
"page_idx": 9
|
| 1061 |
+
},
|
| 1062 |
+
{
|
| 1063 |
+
"type": "text",
|
| 1064 |
+
"text": "REFERENCES ",
|
| 1065 |
+
"text_level": 1,
|
| 1066 |
+
"bbox": [
|
| 1067 |
+
176,
|
| 1068 |
+
170,
|
| 1069 |
+
287,
|
| 1070 |
+
185
|
| 1071 |
+
],
|
| 1072 |
+
"page_idx": 9
|
| 1073 |
+
},
|
| 1074 |
+
{
|
| 1075 |
+
"type": "text",
|
| 1076 |
+
"text": "Armen Aghajanyan, Akshat Shrivastava, Anchit Gupta, Naman Goyal, Luke Zettlemoyer, and Sonal Gupta. Better fine-tuning by reducing representational collapse. ArXiv preprint, abs/2008.03156, 2020. URL https://arxiv.org/abs/2008.03156. ",
|
| 1077 |
+
"bbox": [
|
| 1078 |
+
174,
|
| 1079 |
+
196,
|
| 1080 |
+
825,
|
| 1081 |
+
238
|
| 1082 |
+
],
|
| 1083 |
+
"page_idx": 9
|
| 1084 |
+
},
|
| 1085 |
+
{
|
| 1086 |
+
"type": "text",
|
| 1087 |
+
"text": "Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Hugo Larochelle, Marc’Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin (eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/ 1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html. ",
|
| 1088 |
+
"bbox": [
|
| 1089 |
+
173,
|
| 1090 |
+
251,
|
| 1091 |
+
825,
|
| 1092 |
+
404
|
| 1093 |
+
],
|
| 1094 |
+
"page_idx": 9
|
| 1095 |
+
},
|
| 1096 |
+
{
|
| 1097 |
+
"type": "text",
|
| 1098 |
+
"text": "Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv preprint, abs/1803.05457, 2018. URL https://arxiv.org/abs/1803.05457. ",
|
| 1099 |
+
"bbox": [
|
| 1100 |
+
174,
|
| 1101 |
+
416,
|
| 1102 |
+
823,
|
| 1103 |
+
458
|
| 1104 |
+
],
|
| 1105 |
+
"page_idx": 9
|
| 1106 |
+
},
|
| 1107 |
+
{
|
| 1108 |
+
"type": "text",
|
| 1109 |
+
"text": "Alexis Conneau and Guillaume Lample. Cross-lingual language model pretraining. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d’Alche-Buc, Emily B. Fox, and Roman ´ Garnett (eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 7057–7067, 2019. URL https://proceedings.neurips.cc/paper/ 2019/hash/c04c19c2c2474dbf5f7ac4372c5b9af1-Abstract.html. ",
|
| 1110 |
+
"bbox": [
|
| 1111 |
+
174,
|
| 1112 |
+
470,
|
| 1113 |
+
825,
|
| 1114 |
+
554
|
| 1115 |
+
],
|
| 1116 |
+
"page_idx": 9
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"type": "text",
|
| 1120 |
+
"text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://aclanthology.org/N19-1423. ",
|
| 1121 |
+
"bbox": [
|
| 1122 |
+
173,
|
| 1123 |
+
566,
|
| 1124 |
+
825,
|
| 1125 |
+
651
|
| 1126 |
+
],
|
| 1127 |
+
"page_idx": 9
|
| 1128 |
+
},
|
| 1129 |
+
{
|
| 1130 |
+
"type": "text",
|
| 1131 |
+
"text": "William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. ArXiv preprint, abs/2101.03961, 2021. URL https: //arxiv.org/abs/2101.03961. ",
|
| 1132 |
+
"bbox": [
|
| 1133 |
+
174,
|
| 1134 |
+
662,
|
| 1135 |
+
825,
|
| 1136 |
+
705
|
| 1137 |
+
],
|
| 1138 |
+
"page_idx": 9
|
| 1139 |
+
},
|
| 1140 |
+
{
|
| 1141 |
+
"type": "text",
|
| 1142 |
+
"text": "Pengcheng He, Xiaodong Liu, Jianfeng Gao, and Weizhu Chen. Deberta: Decoding-enhanced bert with disentangled attention. ArXiv preprint, abs/2006.03654, 2020. URL https://arxiv. org/abs/2006.03654. ",
|
| 1143 |
+
"bbox": [
|
| 1144 |
+
171,
|
| 1145 |
+
717,
|
| 1146 |
+
823,
|
| 1147 |
+
758
|
| 1148 |
+
],
|
| 1149 |
+
"page_idx": 9
|
| 1150 |
+
},
|
| 1151 |
+
{
|
| 1152 |
+
"type": "text",
|
| 1153 |
+
"text": "Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Tuo Zhao. SMART: Robust and efficient fine-tuning for pre-trained natural language models through principled regularized optimization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 2177–2190, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.197. URL https://aclanthology.org/2020. acl-main.197. ",
|
| 1154 |
+
"bbox": [
|
| 1155 |
+
173,
|
| 1156 |
+
771,
|
| 1157 |
+
825,
|
| 1158 |
+
854
|
| 1159 |
+
],
|
| 1160 |
+
"page_idx": 9
|
| 1161 |
+
},
|
| 1162 |
+
{
|
| 1163 |
+
"type": "text",
|
| 1164 |
+
"text": "Young Jin Kim, Ammar Ahmad Awan, Alexandre Muzio, Andres Felipe Cruz Salinas, Liyang Lu, Amr Hendy, Samyam Rajbhandari, Yuxiong He, and Hany Hassan Awadalla. Scalable and efficient moe training for multitask multilingual models. ArXiv preprint, abs/2109.10465, 2021. URL https://arxiv.org/abs/2109.10465. ",
|
| 1165 |
+
"bbox": [
|
| 1166 |
+
176,
|
| 1167 |
+
868,
|
| 1168 |
+
823,
|
| 1169 |
+
922
|
| 1170 |
+
],
|
| 1171 |
+
"page_idx": 9
|
| 1172 |
+
},
|
| 1173 |
+
{
|
| 1174 |
+
"type": "text",
|
| 1175 |
+
"text": "Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http: //arxiv.org/abs/1412.6980. ",
|
| 1176 |
+
"bbox": [
|
| 1177 |
+
174,
|
| 1178 |
+
103,
|
| 1179 |
+
825,
|
| 1180 |
+
160
|
| 1181 |
+
],
|
| 1182 |
+
"page_idx": 10
|
| 1183 |
+
},
|
| 1184 |
+
{
|
| 1185 |
+
"type": "text",
|
| 1186 |
+
"text": "Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. ArXiv preprint, abs/2006.16668, 2020. URL https: //arxiv.org/abs/2006.16668. ",
|
| 1187 |
+
"bbox": [
|
| 1188 |
+
174,
|
| 1189 |
+
167,
|
| 1190 |
+
825,
|
| 1191 |
+
223
|
| 1192 |
+
],
|
| 1193 |
+
"page_idx": 10
|
| 1194 |
+
},
|
| 1195 |
+
{
|
| 1196 |
+
"type": "text",
|
| 1197 |
+
"text": "Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, Online, 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://aclanthology.org/2020.acl-main.703. ",
|
| 1198 |
+
"bbox": [
|
| 1199 |
+
173,
|
| 1200 |
+
231,
|
| 1201 |
+
825,
|
| 1202 |
+
314
|
| 1203 |
+
],
|
| 1204 |
+
"page_idx": 10
|
| 1205 |
+
},
|
| 1206 |
+
{
|
| 1207 |
+
"type": "text",
|
| 1208 |
+
"text": "Mike Lewis, Shruti Bhosale, Tim Dettmers, Naman Goyal, and Luke Zettlemoyer. Base layers: Simplifying training of large, sparse models. ArXiv preprint, abs/2103.16716, 2021. URL https://arxiv.org/abs/2103.16716. ",
|
| 1209 |
+
"bbox": [
|
| 1210 |
+
176,
|
| 1211 |
+
321,
|
| 1212 |
+
821,
|
| 1213 |
+
364
|
| 1214 |
+
],
|
| 1215 |
+
"page_idx": 10
|
| 1216 |
+
},
|
| 1217 |
+
{
|
| 1218 |
+
"type": "text",
|
| 1219 |
+
"text": "Liyuan Liu, Haoming Jiang, Pengcheng He, Weizhu Chen, Xiaodong Liu, Jianfeng Gao, and Jiawei Han. On the variance of the adaptive learning rate and beyond. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020a. URL https://openreview.net/forum?id $\\equiv$ rkgz2aEKDr. ",
|
| 1220 |
+
"bbox": [
|
| 1221 |
+
173,
|
| 1222 |
+
372,
|
| 1223 |
+
825,
|
| 1224 |
+
428
|
| 1225 |
+
],
|
| 1226 |
+
"page_idx": 10
|
| 1227 |
+
},
|
| 1228 |
+
{
|
| 1229 |
+
"type": "text",
|
| 1230 |
+
"text": "Liyuan Liu, Xiaodong Liu, Jianfeng Gao, Weizhu Chen, and Jiawei Han. Understanding the difficulty of training transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5747–5763, Online, 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.463. URL https:// aclanthology.org/2020.emnlp-main.463. ",
|
| 1231 |
+
"bbox": [
|
| 1232 |
+
173,
|
| 1233 |
+
435,
|
| 1234 |
+
825,
|
| 1235 |
+
506
|
| 1236 |
+
],
|
| 1237 |
+
"page_idx": 10
|
| 1238 |
+
},
|
| 1239 |
+
{
|
| 1240 |
+
"type": "text",
|
| 1241 |
+
"text": "Xiaodong Liu, Kevin Duh, Liyuan Liu, and Jianfeng Gao. Very deep transformers for neural machine translation. ArXiv preprint, abs/2008.07772, 2020c. URL https://arxiv.org/abs/ 2008.07772. ",
|
| 1242 |
+
"bbox": [
|
| 1243 |
+
173,
|
| 1244 |
+
512,
|
| 1245 |
+
823,
|
| 1246 |
+
555
|
| 1247 |
+
],
|
| 1248 |
+
"page_idx": 10
|
| 1249 |
+
},
|
| 1250 |
+
{
|
| 1251 |
+
"type": "text",
|
| 1252 |
+
"text": "Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. ArXiv preprint, abs/1907.11692, 2019. URL https://arxiv.org/abs/1907. 11692. ",
|
| 1253 |
+
"bbox": [
|
| 1254 |
+
174,
|
| 1255 |
+
563,
|
| 1256 |
+
825,
|
| 1257 |
+
618
|
| 1258 |
+
],
|
| 1259 |
+
"page_idx": 10
|
| 1260 |
+
},
|
| 1261 |
+
{
|
| 1262 |
+
"type": "text",
|
| 1263 |
+
"text": "Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 1–9, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6301. URL https://aclanthology.org/W18-6301. ",
|
| 1264 |
+
"bbox": [
|
| 1265 |
+
173,
|
| 1266 |
+
626,
|
| 1267 |
+
825,
|
| 1268 |
+
683
|
| 1269 |
+
],
|
| 1270 |
+
"page_idx": 10
|
| 1271 |
+
},
|
| 1272 |
+
{
|
| 1273 |
+
"type": "text",
|
| 1274 |
+
"text": "Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations), pp. 48–53, Minneapolis, Minnesota, 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-4009. URL https://aclanthology.org/N19-4009. ",
|
| 1275 |
+
"bbox": [
|
| 1276 |
+
173,
|
| 1277 |
+
690,
|
| 1278 |
+
825,
|
| 1279 |
+
761
|
| 1280 |
+
],
|
| 1281 |
+
"page_idx": 10
|
| 1282 |
+
},
|
| 1283 |
+
{
|
| 1284 |
+
"type": "text",
|
| 1285 |
+
"text": "Matt Post. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 186–191, Brussels, Belgium, 2018. Association for Computational Linguistics. doi: 10.18653/v1/W18-6319. URL https://aclanthology. org/W18-6319. ",
|
| 1286 |
+
"bbox": [
|
| 1287 |
+
173,
|
| 1288 |
+
767,
|
| 1289 |
+
825,
|
| 1290 |
+
824
|
| 1291 |
+
],
|
| 1292 |
+
"page_idx": 10
|
| 1293 |
+
},
|
| 1294 |
+
{
|
| 1295 |
+
"type": "text",
|
| 1296 |
+
"text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. ",
|
| 1297 |
+
"bbox": [
|
| 1298 |
+
171,
|
| 1299 |
+
832,
|
| 1300 |
+
823,
|
| 1301 |
+
861
|
| 1302 |
+
],
|
| 1303 |
+
"page_idx": 10
|
| 1304 |
+
},
|
| 1305 |
+
{
|
| 1306 |
+
"type": "text",
|
| 1307 |
+
"text": "Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-totext transformer. ArXiv preprint, abs/1910.10683, 2019. URL https://arxiv.org/abs/ 1910.10683. ",
|
| 1308 |
+
"bbox": [
|
| 1309 |
+
174,
|
| 1310 |
+
867,
|
| 1311 |
+
825,
|
| 1312 |
+
922
|
| 1313 |
+
],
|
| 1314 |
+
"page_idx": 10
|
| 1315 |
+
},
|
| 1316 |
+
{
|
| 1317 |
+
"type": "text",
|
| 1318 |
+
"text": "Carlos Riquelme, Joan Puigcerver, Basil Mustafa, Maxim Neumann, Rodolphe Jenatton, Andre Su- ´ sano Pinto, Daniel Keysers, and Neil Houlsby. Scaling vision with sparse mixture of experts. arXiv preprint arXiv:2106.05974, 2021. URL https://arxiv.org/abs/2106.05974. ",
|
| 1319 |
+
"bbox": [
|
| 1320 |
+
176,
|
| 1321 |
+
103,
|
| 1322 |
+
821,
|
| 1323 |
+
146
|
| 1324 |
+
],
|
| 1325 |
+
"page_idx": 11
|
| 1326 |
+
},
|
| 1327 |
+
{
|
| 1328 |
+
"type": "text",
|
| 1329 |
+
"text": "Stephen Roller, Sainbayar Sukhbaatar, Arthur Szlam, and Jason Weston. Hash layers for large sparse models. ArXiv preprint, abs/2106.04426, 2021. URL https://arxiv.org/abs/ 2106.04426. ",
|
| 1330 |
+
"bbox": [
|
| 1331 |
+
174,
|
| 1332 |
+
155,
|
| 1333 |
+
823,
|
| 1334 |
+
196
|
| 1335 |
+
],
|
| 1336 |
+
"page_idx": 11
|
| 1337 |
+
},
|
| 1338 |
+
{
|
| 1339 |
+
"type": "text",
|
| 1340 |
+
"text": "Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://aclanthology. org/P16-1162. ",
|
| 1341 |
+
"bbox": [
|
| 1342 |
+
174,
|
| 1343 |
+
207,
|
| 1344 |
+
825,
|
| 1345 |
+
276
|
| 1346 |
+
],
|
| 1347 |
+
"page_idx": 11
|
| 1348 |
+
},
|
| 1349 |
+
{
|
| 1350 |
+
"type": "text",
|
| 1351 |
+
"text": "Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixtureof-experts layer. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ B1ckMDqlg. ",
|
| 1352 |
+
"bbox": [
|
| 1353 |
+
173,
|
| 1354 |
+
285,
|
| 1355 |
+
825,
|
| 1356 |
+
356
|
| 1357 |
+
],
|
| 1358 |
+
"page_idx": 11
|
| 1359 |
+
},
|
| 1360 |
+
{
|
| 1361 |
+
"type": "text",
|
| 1362 |
+
"text": "Tianxiao Shen, Myle Ott, Michael Auli, and Marc’Aurelio Ranzato. Mixture models for diverse machine translation: Tricks of the trade. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9- 15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 5719–5728. PMLR, 2019. URL http://proceedings.mlr.press/v97/ shen19c.html. ",
|
| 1363 |
+
"bbox": [
|
| 1364 |
+
173,
|
| 1365 |
+
364,
|
| 1366 |
+
825,
|
| 1367 |
+
448
|
| 1368 |
+
],
|
| 1369 |
+
"page_idx": 11
|
| 1370 |
+
},
|
| 1371 |
+
{
|
| 1372 |
+
"type": "text",
|
| 1373 |
+
"text": "David R. So, Quoc V. Le, and Chen Liang. The evolved transformer. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pp. 5877–5886. PMLR, 2019. URL http://proceedings. mlr.press/v97/so19a.html. ",
|
| 1374 |
+
"bbox": [
|
| 1375 |
+
174,
|
| 1376 |
+
458,
|
| 1377 |
+
825,
|
| 1378 |
+
527
|
| 1379 |
+
],
|
| 1380 |
+
"page_idx": 11
|
| 1381 |
+
},
|
| 1382 |
+
{
|
| 1383 |
+
"type": "text",
|
| 1384 |
+
"text": "Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014. ",
|
| 1385 |
+
"bbox": [
|
| 1386 |
+
174,
|
| 1387 |
+
536,
|
| 1388 |
+
825,
|
| 1389 |
+
580
|
| 1390 |
+
],
|
| 1391 |
+
"page_idx": 11
|
| 1392 |
+
},
|
| 1393 |
+
{
|
| 1394 |
+
"type": "text",
|
| 1395 |
+
"text": "Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 2818–2826. IEEE Computer Society, 2016. doi: 10.1109/CVPR.2016.308. URL https: //doi.org/10.1109/CVPR.2016.308. ",
|
| 1396 |
+
"bbox": [
|
| 1397 |
+
173,
|
| 1398 |
+
588,
|
| 1399 |
+
825,
|
| 1400 |
+
659
|
| 1401 |
+
],
|
| 1402 |
+
"page_idx": 11
|
| 1403 |
+
},
|
| 1404 |
+
{
|
| 1405 |
+
"type": "text",
|
| 1406 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pp. 5998–6008, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/ 3f5ee243547dee91fbd053c1c4a845aa-Abstract.html. ",
|
| 1407 |
+
"bbox": [
|
| 1408 |
+
176,
|
| 1409 |
+
667,
|
| 1410 |
+
825,
|
| 1411 |
+
766
|
| 1412 |
+
],
|
| 1413 |
+
"page_idx": 11
|
| 1414 |
+
},
|
| 1415 |
+
{
|
| 1416 |
+
"type": "text",
|
| 1417 |
+
"text": "Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019a. URL https://openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ rJ4km2R5t7. ",
|
| 1418 |
+
"bbox": [
|
| 1419 |
+
174,
|
| 1420 |
+
773,
|
| 1421 |
+
825,
|
| 1422 |
+
844
|
| 1423 |
+
],
|
| 1424 |
+
"page_idx": 11
|
| 1425 |
+
},
|
| 1426 |
+
{
|
| 1427 |
+
"type": "text",
|
| 1428 |
+
"text": "Qiang Wang, Bei Li, Tong Xiao, Jingbo Zhu, Changliang Li, Derek F. Wong, and Lidia S. Chao. Learning deep transformer models for machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1810–1822, Florence, Italy, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1176. URL https://aclanthology.org/P19-1176. ",
|
| 1429 |
+
"bbox": [
|
| 1430 |
+
174,
|
| 1431 |
+
854,
|
| 1432 |
+
825,
|
| 1433 |
+
924
|
| 1434 |
+
],
|
| 1435 |
+
"page_idx": 11
|
| 1436 |
+
},
|
| 1437 |
+
{
|
| 1438 |
+
"type": "text",
|
| 1439 |
+
"text": "Felix Wu, Angela Fan, Alexei Baevski, Yann N. Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019a. URL https://openreview.net/forum?id $\\underline { { \\underline { { \\mathbf { \\Pi } } } } } =$ SkVhlh09tX. ",
|
| 1440 |
+
"bbox": [
|
| 1441 |
+
174,
|
| 1442 |
+
103,
|
| 1443 |
+
825,
|
| 1444 |
+
159
|
| 1445 |
+
],
|
| 1446 |
+
"page_idx": 12
|
| 1447 |
+
},
|
| 1448 |
+
{
|
| 1449 |
+
"type": "text",
|
| 1450 |
+
"text": "Lijun Wu, Yiren Wang, Yingce Xia, Fei Tian, Fei Gao, Tao Qin, Jianhuang Lai, and Tie-Yan Liu. Depth growing for neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 5558–5563, Florence, Italy, 2019b. Association for Computational Linguistics. doi: 10.18653/v1/P19-1558. URL https:// aclanthology.org/P19-1558. ",
|
| 1451 |
+
"bbox": [
|
| 1452 |
+
174,
|
| 1453 |
+
169,
|
| 1454 |
+
825,
|
| 1455 |
+
239
|
| 1456 |
+
],
|
| 1457 |
+
"page_idx": 12
|
| 1458 |
+
},
|
| 1459 |
+
{
|
| 1460 |
+
"type": "text",
|
| 1461 |
+
"text": "An Yang, Junyang Lin, Rui Men, Chang Zhou, Le Jiang, Xianyan Jia, Ang Wang, Jie Zhang, Jiamang Wang, Yong Li, et al. Exploring sparse expert models and beyond. ArXiv preprint, abs/2105.15082, 2021. URL https://arxiv.org/abs/2105.15082. ",
|
| 1462 |
+
"bbox": [
|
| 1463 |
+
174,
|
| 1464 |
+
248,
|
| 1465 |
+
825,
|
| 1466 |
+
290
|
| 1467 |
+
],
|
| 1468 |
+
"page_idx": 12
|
| 1469 |
+
},
|
| 1470 |
+
{
|
| 1471 |
+
"type": "text",
|
| 1472 |
+
"text": "A ANALYSIS OF SPARSELY ACTIVATED MODELS ",
|
| 1473 |
+
"text_level": 1,
|
| 1474 |
+
"bbox": [
|
| 1475 |
+
174,
|
| 1476 |
+
102,
|
| 1477 |
+
593,
|
| 1478 |
+
118
|
| 1479 |
+
],
|
| 1480 |
+
"page_idx": 13
|
| 1481 |
+
},
|
| 1482 |
+
{
|
| 1483 |
+
"type": "text",
|
| 1484 |
+
"text": "A.1 TRAINING DETAILS ",
|
| 1485 |
+
"text_level": 1,
|
| 1486 |
+
"bbox": [
|
| 1487 |
+
176,
|
| 1488 |
+
130,
|
| 1489 |
+
354,
|
| 1490 |
+
143
|
| 1491 |
+
],
|
| 1492 |
+
"page_idx": 13
|
| 1493 |
+
},
|
| 1494 |
+
{
|
| 1495 |
+
"type": "text",
|
| 1496 |
+
"text": "We consider two Mixture-of-Experts (MoE) models proposed in Shen et al. (2019), which are denoted “MoE(dec)” and “MoE(tok)”. In the first variant, each expert is a separate Transformer decoder. In the second variant, each expert is a different token, i.e., if we route the input to expert one, then we replace the $\\left. b o s \\right.$ (begin-of-sentence) token in the input sentence with a $\\langle e x p e r t _ { 1 } \\rangle$ token. Note that embeddings of these expert tokens are trained together with the rest of the model parameters. These models are equipped with an expectation-maximization optimization framework. Such a framework facilitates computing the probability of assigning an input to a specific expert according to the gating mechanism. Please refer to Shen et al. (2019) for details about these models. ",
|
| 1497 |
+
"bbox": [
|
| 1498 |
+
173,
|
| 1499 |
+
154,
|
| 1500 |
+
825,
|
| 1501 |
+
265
|
| 1502 |
+
],
|
| 1503 |
+
"page_idx": 13
|
| 1504 |
+
},
|
| 1505 |
+
{
|
| 1506 |
+
"type": "text",
|
| 1507 |
+
"text": "We use a multilingual translation setting, where we adopt two datasets: De-En from IWSLT’14 and Vi-En from IWSLT’15. For each dataset, we use byte pair encoding (BPE, Sennrich et al. 2016) with 10, 000 merge operations for pre-processing. Then we concatenate the two pre-processed datasets. We learn a separate dictionary for En and $\\mathrm { \\bar { \\{ D e + V i \\} } }$ , which resulted in approximately $9 k$ and $1 2 k$ vocabularies, respectively. ",
|
| 1508 |
+
"bbox": [
|
| 1509 |
+
174,
|
| 1510 |
+
272,
|
| 1511 |
+
825,
|
| 1512 |
+
342
|
| 1513 |
+
],
|
| 1514 |
+
"page_idx": 13
|
| 1515 |
+
},
|
| 1516 |
+
{
|
| 1517 |
+
"type": "text",
|
| 1518 |
+
"text": "For training, we use Adam (Kingma & Ba, 2015) as the optimizer and we set the learning rate to 0.001. We set the batch size to be equivalent to $6 4 k$ tokens, e.g., we use $8 k$ tokens per GPU with 8 GPUs. Other training details follow the Fairseq4 implementation. For inference, we use a beam size of 5 and a length penalty of 1.0. ",
|
| 1519 |
+
"bbox": [
|
| 1520 |
+
173,
|
| 1521 |
+
349,
|
| 1522 |
+
825,
|
| 1523 |
+
405
|
| 1524 |
+
],
|
| 1525 |
+
"page_idx": 13
|
| 1526 |
+
},
|
| 1527 |
+
{
|
| 1528 |
+
"type": "text",
|
| 1529 |
+
"text": "A.2 ADDITIONAL RESULTS ",
|
| 1530 |
+
"text_level": 1,
|
| 1531 |
+
"bbox": [
|
| 1532 |
+
176,
|
| 1533 |
+
416,
|
| 1534 |
+
377,
|
| 1535 |
+
430
|
| 1536 |
+
],
|
| 1537 |
+
"page_idx": 13
|
| 1538 |
+
},
|
| 1539 |
+
{
|
| 1540 |
+
"type": "text",
|
| 1541 |
+
"text": "We also plot the average routing confidence score and the load of experts for Switch(s) and Switch(t), similar to Figure 2 and Figure 3. We first investigate the Switch Transformer without the load balancing loss. ",
|
| 1542 |
+
"bbox": [
|
| 1543 |
+
176,
|
| 1544 |
+
440,
|
| 1545 |
+
823,
|
| 1546 |
+
482
|
| 1547 |
+
],
|
| 1548 |
+
"page_idx": 13
|
| 1549 |
+
},
|
| 1550 |
+
{
|
| 1551 |
+
"type": "image",
|
| 1552 |
+
"img_path": "images/d462b1a4d5cd5c58db6a9d214b382c9d0ae52d0a0987cfd697266ca1f67ca9c8.jpg",
|
| 1553 |
+
"image_caption": [
|
| 1554 |
+
"Figure 10: Switch(s) w/o load balancing. Left: average routing confidence; Right: load of experts. "
|
| 1555 |
+
],
|
| 1556 |
+
"image_footnote": [],
|
| 1557 |
+
"bbox": [
|
| 1558 |
+
225,
|
| 1559 |
+
500,
|
| 1560 |
+
774,
|
| 1561 |
+
652
|
| 1562 |
+
],
|
| 1563 |
+
"page_idx": 13
|
| 1564 |
+
},
|
| 1565 |
+
{
|
| 1566 |
+
"type": "image",
|
| 1567 |
+
"img_path": "images/5a664890db89c956bf616ff5c17b0c99910b05bb446c20fa44793e43be9f02bd.jpg",
|
| 1568 |
+
"image_caption": [
|
| 1569 |
+
"Figure 11: Switch(t) w/o load balancing. Left: average routing confidence; Right: load of experts. "
|
| 1570 |
+
],
|
| 1571 |
+
"image_footnote": [],
|
| 1572 |
+
"bbox": [
|
| 1573 |
+
225,
|
| 1574 |
+
709,
|
| 1575 |
+
774,
|
| 1576 |
+
862
|
| 1577 |
+
],
|
| 1578 |
+
"page_idx": 13
|
| 1579 |
+
},
|
| 1580 |
+
{
|
| 1581 |
+
"type": "text",
|
| 1582 |
+
"text": "Figure 10 shows the results for Switch(s) without the load balancing loss, where we route inputs to experts on the sentence-level. We see that after about $1 0 k$ training iterations, the average routing confidence score of expert 1 and expert 2 becomes similar, and both of these scores are around 0.60. Moreover, the load of the experts are not balanced, i.e., there is a $1 0 \\%$ difference in the loads $( 5 5 \\%$ vs. $4 5 \\%$ ). We conclude that behavior of the gating mechanism of Switch(s) is similar to Figure 3, i.e., the gate is essentially randomly routing inputs to experts without any preference. ",
|
| 1583 |
+
"bbox": [
|
| 1584 |
+
173,
|
| 1585 |
+
103,
|
| 1586 |
+
825,
|
| 1587 |
+
188
|
| 1588 |
+
],
|
| 1589 |
+
"page_idx": 14
|
| 1590 |
+
},
|
| 1591 |
+
{
|
| 1592 |
+
"type": "text",
|
| 1593 |
+
"text": "Figure 11 shows the results for Switch(t) without the load balancing loss, where we route inputs to experts on the token-level, i.e., different tokens within the same sentence may be routed to different experts. Similar to the Switch(s) case, the average routing confidence score of both of the two experts converges to around 0.55. This indicates that the gate do not prefer any expert given an input. Moreover, the load of the experts are not balanced, the same as in Figure 10. Based on these observations, we conclude that behavior of the gating mechanism of Switch(t) is also random routing. ",
|
| 1594 |
+
"bbox": [
|
| 1595 |
+
173,
|
| 1596 |
+
194,
|
| 1597 |
+
825,
|
| 1598 |
+
292
|
| 1599 |
+
],
|
| 1600 |
+
"page_idx": 14
|
| 1601 |
+
},
|
| 1602 |
+
{
|
| 1603 |
+
"type": "image",
|
| 1604 |
+
"img_path": "images/f840b4d4df3d22c328cb45ef078db0250d2dd8fe0442c871c1711f0af128e706.jpg",
|
| 1605 |
+
"image_caption": [
|
| 1606 |
+
"Figure 12: Switch(s) w/ load balancing. Left: average routing confidence; Right: load of experts. "
|
| 1607 |
+
],
|
| 1608 |
+
"image_footnote": [],
|
| 1609 |
+
"bbox": [
|
| 1610 |
+
225,
|
| 1611 |
+
310,
|
| 1612 |
+
774,
|
| 1613 |
+
460
|
| 1614 |
+
],
|
| 1615 |
+
"page_idx": 14
|
| 1616 |
+
},
|
| 1617 |
+
{
|
| 1618 |
+
"type": "image",
|
| 1619 |
+
"img_path": "images/02fa6de88b358444fcdd0c7b8d8e31045155f55efc6396c05e3b7b00ceb4a21b.jpg",
|
| 1620 |
+
"image_caption": [
|
| 1621 |
+
"Figure 13: Switch(t) w/ load balancing. Left: average routing confidence; Right: load of experts. "
|
| 1622 |
+
],
|
| 1623 |
+
"image_footnote": [],
|
| 1624 |
+
"bbox": [
|
| 1625 |
+
225,
|
| 1626 |
+
516,
|
| 1627 |
+
772,
|
| 1628 |
+
666
|
| 1629 |
+
],
|
| 1630 |
+
"page_idx": 14
|
| 1631 |
+
},
|
| 1632 |
+
{
|
| 1633 |
+
"type": "text",
|
| 1634 |
+
"text": "Figure 12 and Figure 13 show behavior of the gating mechanism of Switch(s) and Switch(t) equipped with the load balancing loss, respectively. We see that the load balancing loss indeed balances the load for both Switch(s) and Switch(t), e.g., there is a less than $0 . 4 \\%$ imbalance for Switch(s) and less than $0 . 2 \\%$ imbalance for Switch(t). In comparison, the imbalance is around $1 0 \\%$ for the two Switch Transformer variants without the load balancing loss. Also, similar to the case without the load balancing loss, the average routing confidence score converges to around 0.60 for Switch(s) and around 0.55 for Switch(t). Based on the observations, we conclude that behavior of the gating mechanism is still random routing when Switch(s) and Switch(t) are equipped with the load balancing loss. ",
|
| 1635 |
+
"bbox": [
|
| 1636 |
+
173,
|
| 1637 |
+
713,
|
| 1638 |
+
825,
|
| 1639 |
+
825
|
| 1640 |
+
],
|
| 1641 |
+
"page_idx": 14
|
| 1642 |
+
},
|
| 1643 |
+
{
|
| 1644 |
+
"type": "text",
|
| 1645 |
+
"text": "B DATASETS ",
|
| 1646 |
+
"text_level": 1,
|
| 1647 |
+
"bbox": [
|
| 1648 |
+
174,
|
| 1649 |
+
838,
|
| 1650 |
+
295,
|
| 1651 |
+
853
|
| 1652 |
+
],
|
| 1653 |
+
"page_idx": 14
|
| 1654 |
+
},
|
| 1655 |
+
{
|
| 1656 |
+
"type": "text",
|
| 1657 |
+
"text": "Statistics of low-resource datasets are shown in Table 6. The English-Vietnamese, English-German, and English-French datasets are from5 IWSLT’14, ’15, and ’16, respectively. The training data of ",
|
| 1658 |
+
"bbox": [
|
| 1659 |
+
179,
|
| 1660 |
+
864,
|
| 1661 |
+
823,
|
| 1662 |
+
893
|
| 1663 |
+
],
|
| 1664 |
+
"page_idx": 14
|
| 1665 |
+
},
|
| 1666 |
+
{
|
| 1667 |
+
"type": "text",
|
| 1668 |
+
"text": "English-Romanian, English-Latvian, and English-Czech are from Europarl6, and the validation and testing data are from WMT’17. ",
|
| 1669 |
+
"bbox": [
|
| 1670 |
+
173,
|
| 1671 |
+
103,
|
| 1672 |
+
825,
|
| 1673 |
+
132
|
| 1674 |
+
],
|
| 1675 |
+
"page_idx": 15
|
| 1676 |
+
},
|
| 1677 |
+
{
|
| 1678 |
+
"type": "text",
|
| 1679 |
+
"text": "Statistics and data sources used in the multilingual translation task are shown in Table 7. ",
|
| 1680 |
+
"bbox": [
|
| 1681 |
+
176,
|
| 1682 |
+
138,
|
| 1683 |
+
754,
|
| 1684 |
+
155
|
| 1685 |
+
],
|
| 1686 |
+
"page_idx": 15
|
| 1687 |
+
},
|
| 1688 |
+
{
|
| 1689 |
+
"type": "table",
|
| 1690 |
+
"img_path": "images/ccf2bc839302f718c4db90ad7944a1f72a6240d611f17f10eea6af3f1bd1a2d0.jpg",
|
| 1691 |
+
"table_caption": [
|
| 1692 |
+
"Table 6: Statistics of low resource translation datasets. "
|
| 1693 |
+
],
|
| 1694 |
+
"table_footnote": [],
|
| 1695 |
+
"table_body": "<table><tr><td></td><td>En-Vi</td><td>En-De</td><td>En-Fr</td><td>En-Ro</td><td>En-Lv</td><td>En-Cs</td></tr><tr><td>Train</td><td>117,055</td><td>160,239</td><td>218,256</td><td>390,746</td><td>591,631</td><td>619,029</td></tr><tr><td>Validation</td><td>5,098</td><td>7,283</td><td>8,453</td><td>1,900</td><td>1,949</td><td>2,902</td></tr><tr><td>Test</td><td>1,268</td><td>6,750</td><td>1,133</td><td>1,999</td><td>2.,001</td><td>3,005</td></tr></table>",
|
| 1696 |
+
"bbox": [
|
| 1697 |
+
232,
|
| 1698 |
+
193,
|
| 1699 |
+
759,
|
| 1700 |
+
263
|
| 1701 |
+
],
|
| 1702 |
+
"page_idx": 15
|
| 1703 |
+
},
|
| 1704 |
+
{
|
| 1705 |
+
"type": "table",
|
| 1706 |
+
"img_path": "images/cecc0cda2325ce210e3b2d8fce2d7869869ffd661f6bbdb23158a7eaccbe96ba.jpg",
|
| 1707 |
+
"table_caption": [
|
| 1708 |
+
"Table 7: Statistics of multilingual translation datasets. The other language in the translation tasks is English (En) for all the datasets. "
|
| 1709 |
+
],
|
| 1710 |
+
"table_footnote": [],
|
| 1711 |
+
"table_body": "<table><tr><td>Language</td><td>Czech (Cs)</td><td>German (De)</td><td>Estonian (Et)</td><td>Finnish (Fi)</td><td>French (Fr)</td></tr><tr><td>Data source # Samples</td><td>WMT'19</td><td>WMT'19</td><td>WMT'18</td><td>WMT'19</td><td>WMT'15</td></tr><tr><td></td><td>10,273,696</td><td>4,613,192</td><td>695,227</td><td>4,838,576</td><td>9,999,995</td></tr><tr><td>Language</td><td>Gujarati (Gu)</td><td>Hindi (Hi)</td><td>Latvian (Lv)</td><td>Romanian (Ro)</td><td>Turkish (Tr)</td></tr><tr><td>Data source</td><td>WMT'19</td><td>WMT'14</td><td>WMT'17</td><td>WMT'16</td><td>WMT'18</td></tr><tr><td># Samples</td><td>85,688</td><td>264,199</td><td>1,444,235</td><td>540,562</td><td>182,269</td></tr></table>",
|
| 1712 |
+
"bbox": [
|
| 1713 |
+
176,
|
| 1714 |
+
332,
|
| 1715 |
+
818,
|
| 1716 |
+
448
|
| 1717 |
+
],
|
| 1718 |
+
"page_idx": 15
|
| 1719 |
+
},
|
| 1720 |
+
{
|
| 1721 |
+
"type": "text",
|
| 1722 |
+
"text": "C TRAINING DETAILS ",
|
| 1723 |
+
"text_level": 1,
|
| 1724 |
+
"bbox": [
|
| 1725 |
+
174,
|
| 1726 |
+
474,
|
| 1727 |
+
372,
|
| 1728 |
+
492
|
| 1729 |
+
],
|
| 1730 |
+
"page_idx": 15
|
| 1731 |
+
},
|
| 1732 |
+
{
|
| 1733 |
+
"type": "text",
|
| 1734 |
+
"text": "C.1 LOW RESOURCE TRANSLATION ",
|
| 1735 |
+
"text_level": 1,
|
| 1736 |
+
"bbox": [
|
| 1737 |
+
176,
|
| 1738 |
+
503,
|
| 1739 |
+
436,
|
| 1740 |
+
517
|
| 1741 |
+
],
|
| 1742 |
+
"page_idx": 15
|
| 1743 |
+
},
|
| 1744 |
+
{
|
| 1745 |
+
"type": "text",
|
| 1746 |
+
"text": "We build a joined dictionary for the source and target languages for each dataset. To facilitate this, we use byte pair encoding (BPE) with 10, 000 and 40, 000 split operations for the IWSLT and the WMT datasets, respectively. Other pre-processing steps follow the Fairseq implementation. ",
|
| 1747 |
+
"bbox": [
|
| 1748 |
+
174,
|
| 1749 |
+
529,
|
| 1750 |
+
823,
|
| 1751 |
+
570
|
| 1752 |
+
],
|
| 1753 |
+
"page_idx": 15
|
| 1754 |
+
},
|
| 1755 |
+
{
|
| 1756 |
+
"type": "text",
|
| 1757 |
+
"text": "For training, the regularization strength is chosen to be $\\alpha \\ : = \\ : 5 . 0$ . We set the batch size to be equivalent to $3 2 k$ tokens, i.e., if we have four GPUs, then we set the number of tokens on each GPU to be $4 k$ and accumulate gradients for two steps. We use Adam as the optimizer with $\\beta _ { 1 } = 0 . 9$ , $\\beta _ { 2 } = 0 . 9 8$ , and we set the learning rate to be 0.0015. We train the model for $4 0 k$ steps, and we test the model that yield the highest validation BLEU. For validation and testing, we use a beam size 5 and a length penalty 1.0. Other training and inference details follow the Fairseq implementation. ",
|
| 1758 |
+
"bbox": [
|
| 1759 |
+
174,
|
| 1760 |
+
577,
|
| 1761 |
+
825,
|
| 1762 |
+
661
|
| 1763 |
+
],
|
| 1764 |
+
"page_idx": 15
|
| 1765 |
+
},
|
| 1766 |
+
{
|
| 1767 |
+
"type": "text",
|
| 1768 |
+
"text": "C.2 RICH RESOURCE TRANSLATION ",
|
| 1769 |
+
"text_level": 1,
|
| 1770 |
+
"bbox": [
|
| 1771 |
+
176,
|
| 1772 |
+
671,
|
| 1773 |
+
436,
|
| 1774 |
+
685
|
| 1775 |
+
],
|
| 1776 |
+
"page_idx": 15
|
| 1777 |
+
},
|
| 1778 |
+
{
|
| 1779 |
+
"type": "text",
|
| 1780 |
+
"text": "Strength of the consistency regularizer is set as $\\alpha = 2 . 0$ . We use Adam (Kingma & Ba, 2015) as the optimizer with $\\beta _ { 1 } = 0 . 9$ , $\\beta _ { 2 } = 0 . 9 8$ , and the learning rate is chosen as 0.001. For inference, we use a beam size 4 and a length penalty 0.6 for En-De; we use a beam size 10 and a length penalty 1.0 for En-Fr. Other post-processing steps follow Ott et al. (2018). We report both the BLEU score and the sacreBLEU score (Post, 2018), where the latter is a safer token-agnostic version of BLEU. ",
|
| 1781 |
+
"bbox": [
|
| 1782 |
+
174,
|
| 1783 |
+
694,
|
| 1784 |
+
825,
|
| 1785 |
+
765
|
| 1786 |
+
],
|
| 1787 |
+
"page_idx": 15
|
| 1788 |
+
},
|
| 1789 |
+
{
|
| 1790 |
+
"type": "text",
|
| 1791 |
+
"text": "C.3 MULTILINGUAL TRANSLATION ",
|
| 1792 |
+
"text_level": 1,
|
| 1793 |
+
"bbox": [
|
| 1794 |
+
176,
|
| 1795 |
+
775,
|
| 1796 |
+
431,
|
| 1797 |
+
790
|
| 1798 |
+
],
|
| 1799 |
+
"page_idx": 15
|
| 1800 |
+
},
|
| 1801 |
+
{
|
| 1802 |
+
"type": "text",
|
| 1803 |
+
"text": "For training, we set the batch size to be equivalent to 1.6 million tokens, e.g., 4096 tokens per GPU with 24 GPUs, and we accumulate gradients for 16 steps. We use RAdam (Liu et al., 2020a) as the optimizer with parameters $\\beta _ { 1 } = 0 . 9$ and $\\beta _ { 2 } = 0 . 9 8$ . The learning rate is set to be 0.05. Also, we set the dropout ratio to be 0.1, and we use label smoothed cross entropy (Szegedy et al., 2016) with a smoothing factor 0.1. The regularization strength is set to be $\\alpha = 4 . 0$ . For inference, we use a beam size 5 and a length penalty 1.0. ",
|
| 1804 |
+
"bbox": [
|
| 1805 |
+
174,
|
| 1806 |
+
799,
|
| 1807 |
+
825,
|
| 1808 |
+
883
|
| 1809 |
+
],
|
| 1810 |
+
"page_idx": 15
|
| 1811 |
+
},
|
| 1812 |
+
{
|
| 1813 |
+
"type": "text",
|
| 1814 |
+
"text": "D ADDITIONAL EXPERIMENTS ",
|
| 1815 |
+
"text_level": 1,
|
| 1816 |
+
"bbox": [
|
| 1817 |
+
176,
|
| 1818 |
+
102,
|
| 1819 |
+
444,
|
| 1820 |
+
118
|
| 1821 |
+
],
|
| 1822 |
+
"page_idx": 16
|
| 1823 |
+
},
|
| 1824 |
+
{
|
| 1825 |
+
"type": "text",
|
| 1826 |
+
"text": "We further test behavior of THOR and the Switch Transformer when we increase the number of experts. To avoid overfitting, we use a small model (Transformer-IWSLT) on the WMT’16 En-De translation dataset. In this experiment, the Transformer model has $4 8 M$ parameters, models with 2, 16, and 64 experts have $5 5 M$ , $1 4 3 M$ , and $4 5 6 M$ parameters, respectively. ",
|
| 1827 |
+
"bbox": [
|
| 1828 |
+
174,
|
| 1829 |
+
128,
|
| 1830 |
+
825,
|
| 1831 |
+
185
|
| 1832 |
+
],
|
| 1833 |
+
"page_idx": 16
|
| 1834 |
+
},
|
| 1835 |
+
{
|
| 1836 |
+
"type": "image",
|
| 1837 |
+
"img_path": "images/4c6f0253e0a54e210026d1d995a3c1084151a9bd79aa0d05902a6efb196e7a53.jpg",
|
| 1838 |
+
"image_caption": [
|
| 1839 |
+
"Figure 14: Effects of the number of experts on WMT’16 En-De translation. Left: training perplexity (lower the better) with respect to wall-time (measured in GPU hours); Right: validation BLEU (higher the better) after training for 180 GPU hours with respect to the number of experts, where the size of Transformer does not change. "
|
| 1840 |
+
],
|
| 1841 |
+
"image_footnote": [],
|
| 1842 |
+
"bbox": [
|
| 1843 |
+
225,
|
| 1844 |
+
200,
|
| 1845 |
+
774,
|
| 1846 |
+
353
|
| 1847 |
+
],
|
| 1848 |
+
"page_idx": 16
|
| 1849 |
+
},
|
| 1850 |
+
{
|
| 1851 |
+
"type": "text",
|
| 1852 |
+
"text": "Figure 14 demonstrates the results. In Figure 14 (left), notice that the Switch Transformer trains faster than the vanilla Transformer, and this scaling property is more significant when we increase the number of experts. ",
|
| 1853 |
+
"bbox": [
|
| 1854 |
+
173,
|
| 1855 |
+
438,
|
| 1856 |
+
825,
|
| 1857 |
+
481
|
| 1858 |
+
],
|
| 1859 |
+
"page_idx": 16
|
| 1860 |
+
},
|
| 1861 |
+
{
|
| 1862 |
+
"type": "text",
|
| 1863 |
+
"text": "From Figure 14 (right), we see that with 2 experts, the Switch Transformer behaves slightly worse the vanilla Transformer in terms of validation BLEU. However, when we increase the number of experts, performance of the Switch Transformer continues to improve and outperforms the vanilla Transformer with the same number of FLOPs. This indicates that in order for a sparsely activated model to outperform a densely activated one, we need to scale the former to contain much more parameters than the latter. Our observations are consistent with existing literature (Lepikhin et al., 2020; Fedus et al., 2021). For example, in Fedus et al. 2021, the sparsely activated Switch-base outperforms the densely activated T5-base using the same number of FLOPs. However, the former is more than 30 times larger (7.5 billion vs. 0.22 billion parameters). ",
|
| 1864 |
+
"bbox": [
|
| 1865 |
+
173,
|
| 1866 |
+
487,
|
| 1867 |
+
825,
|
| 1868 |
+
613
|
| 1869 |
+
],
|
| 1870 |
+
"page_idx": 16
|
| 1871 |
+
},
|
| 1872 |
+
{
|
| 1873 |
+
"type": "text",
|
| 1874 |
+
"text": "Our method is more parameter efficient than the conventional methods. From Figure 14 (right), we see that THOR significantly outperforms the vanilla Transformer and the Switch Transformer even with only 2 experts. Moreover, when we increase the number of experts, performance of THOR also improves. ",
|
| 1875 |
+
"bbox": [
|
| 1876 |
+
174,
|
| 1877 |
+
619,
|
| 1878 |
+
825,
|
| 1879 |
+
675
|
| 1880 |
+
],
|
| 1881 |
+
"page_idx": 16
|
| 1882 |
+
},
|
| 1883 |
+
{
|
| 1884 |
+
"type": "text",
|
| 1885 |
+
"text": "We also compare inference speed of Transformer, Switch Transformer, and THOR in Table 8. Note that for THOR , we use the Dispatch(s) method in Table 5. Note that the inference speed of Switch Transformer and THOR is slower than the vanilla Transformer because of the computation and communication overhead induced by input routing. Such an overhead is more noticeable when the number of experts is large. We remark that in Fedus et al. 2021, the speed of Switch-base is about half of T5-base (780 vs. 1600 samples per second). ",
|
| 1886 |
+
"bbox": [
|
| 1887 |
+
174,
|
| 1888 |
+
681,
|
| 1889 |
+
825,
|
| 1890 |
+
766
|
| 1891 |
+
],
|
| 1892 |
+
"page_idx": 16
|
| 1893 |
+
},
|
| 1894 |
+
{
|
| 1895 |
+
"type": "table",
|
| 1896 |
+
"img_path": "images/39b7d6e5e111547fa57cddd43e708be111275bd69df7d8c8db1a590ee5ba288a.jpg",
|
| 1897 |
+
"table_caption": [
|
| 1898 |
+
"Table 8: Inference speed (tokens/second). "
|
| 1899 |
+
],
|
| 1900 |
+
"table_footnote": [],
|
| 1901 |
+
"table_body": "<table><tr><td></td><td>Transformer</td><td colspan=\"3\">Switch</td><td colspan=\"3\">THOR</td></tr><tr><td># experts</td><td></td><td>2</td><td>16</td><td>64</td><td>2</td><td>16</td><td>64</td></tr><tr><td>Speed</td><td>15.2k</td><td>15.0k</td><td>10.4k</td><td>7.4k</td><td>15.1k</td><td>10.6k</td><td>7.5k</td></tr></table>",
|
| 1902 |
+
"bbox": [
|
| 1903 |
+
240,
|
| 1904 |
+
796,
|
| 1905 |
+
754,
|
| 1906 |
+
854
|
| 1907 |
+
],
|
| 1908 |
+
"page_idx": 16
|
| 1909 |
+
}
|
| 1910 |
+
]
|
parse/dev/B72HXs80q4/B72HXs80q4_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/B72HXs80q4/B72HXs80q4_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/JTmO2V9Xpz/JTmO2V9Xpz_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/PvOo1sHKzf/PvOo1sHKzf_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9.md
ADDED
|
@@ -0,0 +1,472 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STYLEALIGN: ANALYSIS AND APPLICATIONS OF ALIGNED STYLEGAN MODELS
|
| 2 |
+
|
| 3 |
+
Zongze Wu The Hebrew University
|
| 4 |
+
|
| 5 |
+
Yotam Nitzan Tel-Aviv University
|
| 6 |
+
|
| 7 |
+
Eli Shechtman Adobe Research
|
| 8 |
+
|
| 9 |
+
Dani Lischinski The Hebrew University
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
In this paper, we perform an in-depth study of the properties and applications of aligned generative models. We refer to two models as aligned if they share the same architecture, and one of them (the child) is obtained from the other (the parent) via fine-tuning to another domain, a common practice in transfer learning. Several works already utilize some basic properties of aligned StyleGAN models to perform image-to-image translation. Here, we perform the first detailed exploration of model alignment, also focusing on StyleGAN. First, we empirically analyze aligned models and provide answers to important questions regarding their nature. In particular, we find that the child model’s latent spaces are semantically aligned with those of the parent, inheriting incredibly rich semantics, even for distant data domains such as human faces and churches. Second, equipped with this better understanding, we leverage aligned models to solve a diverse set of tasks. In addition to image translation, we demonstrate fully automatic cross-domain image morphing. We further show that zero-shot vision tasks may be performed in the child domain, while relying exclusively on supervision in the parent domain. We demonstrate qualitatively and quantitatively that our approach yields state-of-the-art results, while requiring only simple fine-tuning and inversion.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Transfer Learning (TL) refers to the process in which a parent model, pretrained for some source domain/task, is used to improve the performance of a child model on a different target domain and/or task (Pan & Yang, 2009). The assumption underlying TL is that some knowledge learnt by the parent model is transferable to the new domain or task (Pan & Yang, 2009; Torrey & Shavlik, 2010; Yosinski et al., 2014). The most common TL approach is fine-tuning, where the parent’s parameters are used to initialize those of the child. Next, the child’s parameters, or sometimes just a subset of them, are trained on the target domain/task. Once TL is completed, the child posseses some of the parent’s knowledge, despite the fact that the model parameters may have changed.
|
| 18 |
+
|
| 19 |
+
Existing TL literature typically examines the performance of the child model, e.g., in terms of classification accuracy (He et al., 2019), or FID score (Karras et al., 2020a), without paying much attention to the relationship between parent and child models, induced by the transfer process. Typically, the child model is simply applied to the task it was trained on, while the parent model is no longer used, having fulfilled its purpose. In this work, we provide a complementary perspective, which focuses on analyzing and leveraging the shared knowledge between the two models. Specifically, we consider the case where the TL is performed by fine-tuning the same architecture. We refer to models obtained in this manner as aligned models.
|
| 20 |
+
|
| 21 |
+
Several recent works (Pinkney & Adler, 2020; bryandlee, 2020; Kwong et al., 2021; Song et al., 2021; Gal et al., 2021) use aligned models in a novel manner. In all cases, an unconditional GAN, specifically StyleGAN2 (Karras et al., 2020b) is fine-tuned from domain $A$ to domain $B$ . However, instead of applying the child model as an unconditional generator, it is used in conjunction with the parent model to form an image translation pipeline. First, an image from domain $A$ is embedded into the latent space of the parent StyleGAN2 model. The resulting latent code is then fed either into the child model (bryandlee, 2020; Song et al., 2021; Gal et al., 2021), or into a hybrid model created by layer swapping, i.e., by combining layers from the parent and the child (Pinkney & Adler, 2020; Kwong et al., 2021).
|
| 22 |
+
|
| 23 |
+
These methods have achieved great results in image-to-image translation between several domains. Most notably, translating real human face images to a variety of styles such as cartoons and oil paintings (Pinkney & Adler, 2020; Kwong et al., 2021; Song et al., 2021), but also translating humans to dogs and cats to wildlife (bryandlee, 2020; Gal et al., 2021). However, they focus on a specific application (image-to-image translation) and do not explore or leverage aligned models further. As a result, many questions arise but remain unanswered. For example, which parts of the network change in the TL process, and which knowledge is inherited by the child from its parent? To which degree do the answers to these questions depend on the similarity between the parent and child domains? And, is knowledge not used by the child model completely lost or could it be recovered? Finally, what further applications, besides image-to-image translation, can be solved using aligned models?
|
| 24 |
+
|
| 25 |
+
In this work, we delve deeper into model alignment. In light of previous works, we specifically focus on the state-of-the-art unconditional GAN architecture, StyleGAN2 (Karras et al., 2020b). The process of obtaining aligned models is incredibly simple: we start with a parent StyleGAN2 model trained on domain $A$ and fine-tune it fully for domain $B$ , yielding an aligned child model.
|
| 26 |
+
|
| 27 |
+
We divide the investigation of model alignment into two parts. First, in Section 3, we perform the first empirical analysis of the phenomenon, answering the questions posed above, as well as others. This analysis provides some surprising and novel insights that shed light on aligned StyleGAN2 models. For example, we discover that when fine tuning to a similar target domain, the parts of the model that change the most are the feature convolution weights in the synthesis network. In contrast, the changes in the mapping network and affine layers are negligible (see Figure 1). This crucially implies that the learned latent spaces $\mathcal { W }$ and $s$ are barely affected by the fine-tuning. This explains our next discovery – that semantically meaningful directions in the latent space of the parent model, retain the same (or similar) semantics in the child model (see Figure 2). As the data domains become more distant, the mapping network and affine layers become more affected, which results in a weaker degree of semantic alignment. However, even in extreme cases, such as human faces and churches, some semantic alignment occurs. Another surprising discovery is that the semantic latent controls that seemingly disappear after transfer to the child model, are in fact merely hidden, rather than forgotten, and reappear if the child is retrained back to the parent’s domain.
|
| 28 |
+
|
| 29 |
+
Second, in Section 4, we use aligned models to solve several popular Computer Vision and Computer Graphics tasks. We start with the aforementioned image-to-image translation task (Section 4.1), examine a number of alternatives, and show that aligned models obtain state-of-the-art results for a variety of scenarios. This is especially impactful, as using aligned models for image translation is incredibly simple compared to dedicated methods for the same task, each devising its custom architecture and losses. Next, we explore additional tasks, for which aligned models have not been used before. In Section 4.2 we describe a simple method for fully automatic image morphing between fairly dissimilar domains, such as human to dog faces, which previously necessitated sophisticated methods (Aberman et al., 2018; Fish et al., 2020). Examples of smooth morphs are included in the accompanying video. In Section 4.3, we use aligned models to solve zero-shot classification and regression tasks in domain $B$ , where the supervision is available strictly in domain $A$ . Conceptually, our method reduces a task in a zero-shot or few-shot setting to the same task in a different data domain where supervision is plentiful.
|
| 30 |
+
|
| 31 |
+
In summary, while several previous works took advantage of aligned models implicitly, ours is the first work to conduct a thorough empirical study of this phenomenon. Our study reveals various interesting properties that we then use to further leverage aligned models for a variety of applications, almost effortlessly achieving state-of-the-art performance.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORK
|
| 34 |
+
|
| 35 |
+
Latent Space of GANs: With the rapid evolution of GANs (Goodfellow et al., 2014) in recent years, understanding and controlling their latent representation has attracted considerable attention. Specifically, it has been shown that the intermediate latent space of StyleGAN (Karras et al., 2019; 2020b;a) possesses appealing properties, such as being semantically rich, disentangled and smooth. Many recent works have proposed methods to interpret the semantics encoded in that space and its extensions and apply them to image editing (Jahanian et al., 2019; Shen et al., 2020a; Hark ¨ onen ¨ et al., 2020; Tewari et al., 2020; Abdal et al., 2020; Wu et al., 2020; Patashnik et al., 2021).
|
| 36 |
+
|
| 37 |
+
In order to benefit from these properties in real images, it is necessary to obtain the latent code from which a pretrained GAN can reconstruct the original input image. This task, commonly referred to as GAN Inversion, has been tackled by numerous recent works, either by using: (i) optimization (Abdal et al., 2019; Karras et al., 2020b); or (ii) an encoder (Guan et al., 2020; Pidhorskyi et al., 2020; Richardson et al., 2021; Tov et al., 2021); or (iii) a hybrid approach using both (Zhu et al., 2016; Baylies, 2019; Zhu et al., 2020a). See Xia et al. (2021) for a more thorough review.
|
| 38 |
+
|
| 39 |
+
Image-to-Image translation: The seminal pix2pix work by Isola et al. (2017), first introduced the use of conditional GANs to solve various supervised image-to-image translation tasks. Since then, their work has been extended to allow image synthesis in various different settings: high-resolution (Wang et al., 2018a), semantic image (Park et al., 2019; Zhu et al., 2020b; Liu et al., 2019b), multidomain (Choi et al., 2018), multimodal (Zhu et al., 2017b), and using a pre-trained generator (Nitzan et al., 2020; Richardson et al., 2021; Luo et al., 2020). Another scenario that has received significant attention is unsupervised image-to-image translation (Liu et al., 2017; Zhu et al., 2017a; Kim et al., 2017; Choi et al., 2020; Lee et al., 2020b), where no paired data samples are given.
|
| 40 |
+
|
| 41 |
+
Regardless of the setting, all of the aforementioned works train an neural network, designed explicitly for the translation task. Recently, several works (Pinkney & Adler, 2020; bryandlee, 2020; Kwong et al., 2021; Song et al., 2021; Gal et al., 2021) have taken a different approach towards image-to-image translation. They observe that significant correspondence between generated images in different domains exists when an unconditional generator, such as StyleGAN2 (Karras et al., 2020b), is fine-tuned between the two domains. Accordingly, these works take a two-step approach towards image-to-image translation. First, they invert a given image into the latent space of StyleGAN in domain $A$ and then forward the output latent code through a StyleGAN model for domain $B$ . The latter model is obtained either by directly fine-tuning from the former model (bryandlee, 2020; Song et al., 2021; Gal et al., 2021) or by layer swapping (Pinkney & Adler, 2020; Kwong et al., 2021), i.e., forming a model whose layers are partially those of the fine-tuned model and partially those of the model for domain $A$ .
|
| 42 |
+
|
| 43 |
+
In this work, we delve deeper into this phenomenon, which we refer to as model alignment, and go beyond the image-to-image translation task. For example, we demonstrate that the alignment property goes beyond high-level properties, such as pose, and that multiple fine-grained latent semantics are also aligned. We leverage this property for tasks such as morphing and zero-shot classification.
|
| 44 |
+
|
| 45 |
+
Fine-tuning and Catastrophic Forgetting: Fine-tuning was proven advantageous across fields, settings and tasks and therefore became a standard practice in the deep learning literature. Prominent advantages of fine-tuning are enabling few-shot tasks such as classification (Chen et al., 2019) and unconditional generation (Wang et al., 2018b; Mo et al., 2020; Wang et al., 2020; Li et al., 2020; Ojha et al., 2021), improved performance in a wide variety of tasks (Devlin et al., 2018; Radford et al., 2018; He et al., 2020) and faster training convergence (Wang et al., 2018b; He et al., 2019).
|
| 46 |
+
|
| 47 |
+
While fine-tuning can be an effective technique for solving a new task, it has been well known for over 30 years (McCloskey & Cohen, 1989) that in the process the model “forgets” how to solve the original task, a phenomenon referred to as Catastrophic Forgetting (CF). For example, once a GAN for a certain domain $A$ , is fine-tuned to another domain $B$ , the resulting model can only generate images in domain $B$ (Seff et al., 2017; Zhai et al., 2019). In settings such as continual learning and multi-task learning, CF is undesirable. In recent years, there has been progress in mitigating it using dedicated methods (Kirkpatrick et al., 2017; Kemker et al., 2018). CF has been also studied in the context of GANs (Liang et al., 2018; Li et al., 2020; Thanh-Tung & Tran, 2020).
|
| 48 |
+
|
| 49 |
+
Aforementioned previous works devised methods to obtain a better child model using fine-tuning. From a fine-tuning perspective, this means the model would perform better on the new task. From a CF perspective, this means the model’s performance on the previous task should not be impaired. We differ from these works significantly, as we make no deliberate effort to affect what happens during training of the child model. Instead, we investigate the relationship between the parent and child models after na¨ıve fine-tuning, and then use it to solve a variety of applications.
|
| 50 |
+
|
| 51 |
+
# 3 ANALYSIS OF ALIGNED STYLEGAN MODELS
|
| 52 |
+
|
| 53 |
+
As explained earlier, several previous works observed that a significant correspondence exists between images in different domains, generated from the same latent code by a parent StyleGAN2 model and a child model obtained from it via fine tuning. Our goal is to further understand the relation between the parent and the child models. Below, we explore several aspects.
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Figure 1: Effect of resetting the weights of different components in child models (Mega, Dog) to their initial values, which come from the parent model (FFHQ). Resetting the feature convolution weights causes the most drastic changes. Also see Figure 8.
|
| 57 |
+
|
| 58 |
+
Which parts of the network change during transfer? Recall that the StyleGAN2 model is composed of a mapping function ( $\mathcal { Z }$ to $\mathcal { W }$ ), affine transformations $\mathcal { W }$ to $s$ ), feature convolution layers, and tRGB convolution layers that transform feature maps to RGB images. We transfer a parent StyleGAN2 model pretrained on FFHQ to the Mega cartoon dataset (Pinkney & Adler, 2020) and to AFHQ dog faces dataset (Choi et al., 2020), using ADA (Karras et al., 2020a). After the transfer, we reset the weights of each of the above components in the child models (Mega, Dog) to their initial values in the parent model. The results of this experiment are shown in Figure 1. We observe that the greatest effect on the generated results is caused by resetting the feature convolution layers, which changes the content and structure. Resetting the weights of other components, results in milder changes in both children. This implies that feature convolution layers change the most during transfer. The results also suggest that for the dog model, the affine and tRGB layers have changed significantly more than for the cartoon model. We attribute this difference to the distance between the data domains, and additional experiments in the appendix (Figure 8) support this hypothesis.
|
| 59 |
+
|
| 60 |
+
While resetting the mapping network has a stronger effect on the dog model, note that the changes are fairly subtle in both datasets, implying that the mapping network changes very little. Effectively, this means that the same $z \in { \mathcal { Z } }$ is mapped to similar codes in the $\mathcal { W }$ spaces of the parent and the child; in other words, the two $\mathcal { W }$ spaces are point-wise aligned. This is a crucial observation as it explains the success of previous works (Pinkney & Adler, 2020; bryandlee, 2020; Kwong et al., 2021) in performing image translation based on aligned models. Simply put, the two latent spaces may be viewed as a single shared latent space. Thus, inversion serves as an encoder from the source domain to this latent space, and the generator is a decoder to the target domain. Viewed in this light, alignment-based image translation resembles several previous image translation approaches (Liu et al., 2017; Huang et al., 2018; Liu et al., 2019a), which are based on shared latent spaces.
|
| 61 |
+
|
| 62 |
+
Semantic alignment for similar domains. In addition to point-wise alignment, we find that the $\mathcal { W }$ and $s$ latent spaces of the child model are also semantically aligned with those of the parent model. By semantic alignment, we refer to the property that latent space controls that affect various semantic attributes of images generated by the parent, have the same (or analogous) effect in the child model. This phenomenon is demonstrated below, both qualitatively and quantitatively.
|
| 63 |
+
|
| 64 |
+
We demonstrate alignment on closely related domains, by first fine-tuning a parent pretrained on FFHQ (Karras et al., 2019) to the Mega cartoon face dataset (Pinkney & Adler, 2020) and the Metface portrait dataset (Karras et al., 2020a). Next, we apply a variety of latent semantic controls learnt by the parent to the child models. The controls are either individual channels in StyleSpace $s$ , identified by Wu et al. (2020), or directions in $\mathcal { W }$ space, from InterFaceGAN (Shen et al., 2020b). We manipulate images using these controls “as is” in the parent and child models. The initial latent code is obtained by inverting a real image with an e4e encoder (Tov et al., 2021). As may be seen in Figures 2 and 9, regardless of the edited property, or the latent space used, the semantic controls affect the parent and the child models in exactly the same manner. Also see Figures 10 and 11.
|
| 65 |
+
|
| 66 |
+
To perform a quantitative evaluation we measure the alignment by calculating the overlap between semantic controls found independently in the parent and child models. Since latent directions in $\mathcal { W }$ are affinely related to channels in $s$ , we only examine overlap between style channels. Concretely, we follow Wu et al. (2020) to discover localized channels in both models, and report the number of localized channels for each semantic region in Table 1(a). As can be seen, there is consistently large amount of overlapping channels in the same semantic region. We verify that this overlap is not coincidental: performing the same experiment for two unaligned FFHQ models (trained from different random initializations) shows that they have much fewer overlapping channels (see Table 4).
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Semantic controls discovered for a parent FFHQ model retain their function in the children models (Mega and Metface). This holds for individual channels in $s$ (bangs, smile, gaze), as well as for directions in $\mathcal { W }$ (pose, age, gender).
|
| 70 |
+
Table 1: Number of localized StyleSpace channels for various semantic regions. Each column corresponds to a semantic region in parent model, and each row to a semantic region in child model. The number of localized channels that are shared between parent and child are in the center (an empty space denotes 0). (a) After transferring from natural face to portrait, a number of localized channels retain their functions in the same areas (large values on the diagonal), rather than changing their function to other areas (all zeros except diagonal). (b) Even when transferring between more distant domains (human to dog face), we can see that multiple channels retain their function in the same areas (nose, ear), or shift to semantically corresponding areas (from human clothes to a dog’s torso, from human hair to dog’s ears). Note that the dog face segmentation have no mouth region.
|
| 71 |
+
|
| 72 |
+
<table><tr><td></td><td>19</td><td>eyebrow eye ear nose mouth neck cloth hair 5 41 21</td><td>32</td><td></td><td></td><td></td></tr><tr><td>torso 25 eye 3</td><td></td><td></td><td></td><td></td><td>46</td><td>3462 4</td></tr><tr><td>ear 142</td><td></td><td>2</td><td></td><td></td><td></td><td>13</td></tr><tr><td>nose 81</td><td></td><td>4</td><td>10</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>(b) FFHQ2Dog</td><td></td><td></td><td></td><td></td></tr></table>
|
| 73 |
+
|
| 74 |
+
To the best of our knowledge, we are the first to quantitatively measure the fine-grained semantic alignment phenomenon. Our experiments indicate that aligned models for related domains are indeed strongly semantically aligned. This phenomenon enables many applications based on transferring knowledge and supervision between aligned models. E.g., zero-shot editing as demonstrated in Figure 2 and zero-shot classification/regression as discussed in Section 4.3.
|
| 75 |
+
|
| 76 |
+
Semantic alignment for more distant domains. To examine the degree of semantic alignment across a wider domain gap, we consider StyleGAN2 models transferred from FFHQ to AFHQ dog faces (Choi et al., 2020). Figure 3 demonstrates that, even in this case, there are still multiple single-channel controls that retain their semantic meaning (e.g., big eyes, black hair, short hair). Furthermore, there are also multi-channel editing directions in latent space that exhibit the same behavior, such as curly hair or small face (from StyleCLIP (Patashnik et al., 2021)), as well as pose (from InterFaceGAN (Shen et al., 2020b)). This appears to be the case for visual attributes that are common to both domains, while controls for attributes that are not present in the target domain (such as glasses, lipstick, or beard) seem to have no effect on the child model. However, as we discuss later, the relevant knowledge is not lost; rather, it is only hidden.
|
| 77 |
+
|
| 78 |
+
The retained controls reflect some interesting analogies between the domains: for example, controls for hair color and curliness in humans, control fur color and curliness in dogs, while hair length translates to length of dog ears. Interestingly, psychologists have also observed a correlation between the hair length in women and the ear shape of their preferred dog breeds (Coren, 1999), which is consistent with the folk belief that people look like their dogs. The gradual emergence of some of these analogies is clearly revealed when examining the samples generated by the model as it evolves during the transfer process. Figure 4 shows images obtained for the same latent vector $z \in { \mathcal { Z } }$ (in each row), as the training progresses. In the top row, we can see how human hair gradually evolves into dog ears, and the human nose and mouth gradually evolve into the dog’s nose and muzzle, while the pose remains mostly unchanged. A similarly smooth transition may be observed when transferring from AFHQ dogs to cats, as shown in the bottom row.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 3: Semantic alignment between single-channel and multi-channel controls for more distant domains (humans and dogs). See also Figure 12 and supp. videos.
|
| 82 |
+
Figure 4: A smooth transition in images generated from the same $z \in { \mathcal { Z } }$ during finetuning. The epoch number appears above each column. The most significant visual changes occur in early epochs (0–16). Also see Figure 13 and supplementary videos.
|
| 83 |
+
|
| 84 |
+
Using the same quantitative evaluation method as before, we further quantify the alignment between a parent FFHQ model and a child AFHQ dogs model. Results are displayed in Table 1(b). As can be seen, a smaller number of channels preserve their semantics when transferred to AFHQ dog as compared to MetFace. Nevertheless, we still observe semantic alignment, albeit weaker, as human ears and hair overlap with dog ears, human cloth control the dog torso, etc.
|
| 85 |
+
|
| 86 |
+
We next experiment with even farther domains, with barely any similarity between parent and child, such as human faces and churches, which were also examined by Ojha et al. (2021). Despite lack of commonality, the latent direction that controls face pose in the parent still controls the church pose in the child model (see Figure 14). We further examine a double transfer, with FFHQ as parent, AFHQ dog as child and LSUN bedroom as grandchild. The pose direction in FFHQ still controls the pose in the grandchild bedroom model, as shown in Figure 14.
|
| 87 |
+
|
| 88 |
+
Are latent semantics forgotten or hidden? As shown in Table 1(b), when transferring between distant domains, only a small portion of the localized controls retain a similar semantic function. An interesting question that arises is: are the remaining controls completely “forgotten” during the transfer learning, or do they simply become inactive? To examine this, we retrain the child AFHQ dog model back to the FFHQ domain, thereby obtaining a grandchild model, and report the alignment between the original parent and the grandchild models (both for FFHQ) in Table 3. It may be seen that the effect of many of the localized controls are restored. For example, out of the 41 channels that control the ears in FFHQ, only 2 retain a similar function in AFHQ dogs, but 20 regain their function in the grandchild model. This implies that these channels were merely hidden, but not forgotten, during the first transfer learning stage. It should be emphasized that there is barely any such alignment between two unrelated models, even when they are trained on the same dataset, as shown in Table 4. Thus, the significant alignment between parent and grandchild (in Table 3) cannot be attributed to re-learning when fine tuning from the child to the grandchild.
|
| 89 |
+
|
| 90 |
+
Locality bias in semantics transfer. We explore this aspect and conclude that only some of the semantic alignment can be attributed to locality bias (see the discussion in appendix Section A.3).
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 5: Comparison of I2I translation (cat2dog and dog2wild in the AFHQ dataset) with two stateof-the-art methods. Our method generates realistic target domain images that capture the pose from the source image. In contrast, both CUT and F-LSeSim fail to generate realistic images since they follow the shape of the source domain image too closely. A quantitative comparison in the table below indicates our method is superior by a wide margin, in both FID and KID.
|
| 94 |
+
|
| 95 |
+
# 4 APPLICATIONS
|
| 96 |
+
|
| 97 |
+
We next apply aligned models to solve three kinds of tasks: image-to-image translation (Sec. 4.1), cross-domain image morphing (Sec. 4.2) and zero-shot classification and regression (Section 4.3). Efficient training of generators for different resolutions is described in the appendix (Sec. A.4).
|
| 98 |
+
|
| 99 |
+
# 4.1 CROSS-DOMAIN IMAGE TRANSLATION
|
| 100 |
+
|
| 101 |
+
As demonstrated earlier, aligned models generate images with similar high-level semantic attributes, given the same latent code. This makes it trivial to translate images between the domains of the parent and the child models, even when these domains are more distant than realistic faces and cartoons or paintings of human faces. For example, it is easy to translate between faces of different species, which typically involves significant changes in both structure and appearance. Furthermore, there’s no need for task-specific training or losses; all that is needed is a pair of aligned models and an inversion method to embed real images into the latent space of the source domain StyleGAN.
|
| 102 |
+
|
| 103 |
+
In Section A.5 we perform a systematic study of which inversion methods (encoder or latent optimization), and which latent spaces $( \mathscr { W } / \mathscr { W } { + } / \mathscr { Z } / \mathscr { Z } { + } )$ ), are most effective for image translation. Some previous works (Pinkney & Adler, 2020; Kwong et al., 2021) that considered only similar domains have used the $\mathcal { W } / \mathcal { W } 4$ spaces. We find that $\mathcal { Z }$ space yields same level of results for similar domains, but superior results for distant domains, qualitatively and quantitatively. This could be directly explained with a previous observation. For both settings the $\mathcal { Z }$ space is trivially shared, as it is a non-learned space. However, only for similar domains are the $\mathcal { W } / \mathcal { W } 4$ spaces aligned and shared.
|
| 104 |
+
|
| 105 |
+
In Figure 5 we compare our I2I results to two state-of-the-art methods, CUT (Park et al., 2020) and F-LSeSim (Zheng et al., 2021). It may be seen that our method produces realistic and natural looking results, while these two previous methods exhibit severe artifacts, and attempt to follow the shape in the source image too closely, yielding unrealistic results. The table in Figure 5 provides quantitative support for our qualitative observations, yielding significantly lower FID and KID scores for both cat2dog and dog2wild translations. Figure 21 demonstrates our method’s ability to perform image translation between dissimilar domains.
|
| 106 |
+
|
| 107 |
+
In addition to the I2I scenario examined above, aligned models are also able to perform referencebased image translation, where the resulting image combines the content of a source image with the style from a second (reference) image (Huang et al., 2018; Choi et al., 2020). StyleGAN inherently supports content and style disentanglement through style mixing. Specifically, we combine the early latent code (below $3 2 \times 3 2$ resolution) from a source image, with the late latent code (above or equal to $3 2 \times 3 2$ resolution) from a target domain reference image, and feed it to the target model to generate the result, as demonstrated in Figure 22. Figure 23 and Table 6 show that here, as well as for I2I, inversion via $\mathcal { Z } _ { o p t }$ works better than other inversions/spaces for multi-modal image translation. Figure 6 demonstrates that our results are better than those of current state-of-the-art methods, StarGAN-v2 (Choi et al., 2020) and OverLORD (Gabbay & Hoshen, 2021).
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 6: Comparison of reference-based image translation with StarGAN2 and OverLORD. Our method generates realistic target domain images that combine pose and structure from the source image with texture and color from the reference. StarGAN2 follows the source shape too closely, resulting in non-realistic animals (1st example in dog2cat, all examples in wild2dog). OverLORD’s results preserve the appearance of the reference well, but sometimes fail to capture the pose and structure (e.g., ear shape) from the source image (2nd and 3rd examples in wild2dog). A quantitative comparison in the table below indicates superior performance of our method in both FID and KID.
|
| 113 |
+
|
| 114 |
+
# 4.2 CROSS-DOMAIN IMAGE MORPHING
|
| 115 |
+
|
| 116 |
+
Image morphing is a popular visual effect of smoothly transitioning between a pair of input images (Wolberg, 1998), which typically requires either manual or automatic correspondences, in order to define a warp field. Cross-domain morphing, where the two images are from different domains, $A$ and $B$ , is particularly challenging (Aberman et al., 2018; Fish et al., 2020). However, using a pair of aligned StyleGAN models for the two domains, it is possible to perform cross-domain image morphing automatically without the need for correspondences, or any other input! The two input images are first embedded into the $\mathcal { W } +$ space of the corresponding generators, using e4e encoders (Tov et al., 2021). Next, a smooth transition is obtained by linearly interpolating between the resulting latent codes, while also interpolating between the model weights. Wang et al. (2019) previously proposed interpolating model weights in order to obtain a smooth transition between the “effects” of two different networks. We note that they do not discuss morphing real images, which is a slightly different setting, and requires also interpolating latent codes as we propose here.
|
| 117 |
+
|
| 118 |
+
Layer swapping, proposed by Pinkney & Adler (2020), is an alternative approach to morph between domains. We discuss the differences between the two approaches in Section A.7. Concisely, our proposed method ensures a continuous smooth transition, while layer swapping performs the transition as a series of discrete steps, rather than continuously.
|
| 119 |
+
|
| 120 |
+
We demonstrate automatic morphing between dog and cat faces in Figures 24 and 25, and dog and human faces in Figures 26 and 27. Interpolating the model weights (along each column) yields a smooth transition between domains (different species, but the same pose and fur color), while interpolating the $\mathcal { W } \mathcal { + }$ latent codes (along each row) smoothly transitions inside each domain (same species, varying pose and fur color). In fact, any trajectory in this 2D interpolation space yields a smooth morph sequence between two input images. We simultaneously interpolate along both dimensions to create the sequences shown in the supplementary video.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 7: Zero-shot dog attribute classification using aligned models (FFHQ and AFHQ dogs). In the top row a human “black hair” classifier becomes a “black fur” classifier, a “curly hair” classifier is able to classify “curly fur”, and a “long hair” classifier becomes a “down-pointing ears” classifier. The neutral columns correspond to images whose prediction scores are close to the cutoff value.
|
| 124 |
+
|
| 125 |
+
# 4.3 KNOWLEDGE TRANSFER FROM PARENT TO CHILD DOMAIN
|
| 126 |
+
|
| 127 |
+
Vision tasks on human faces have been researched for years. Consequently, numerous datasets with detailed annotations exist. For example, images in the CelebA dataset (Liu et al., 2015) are labeled with 40 attributes such as “Young”, “Curly hair”, “Smiling”, etc. Such annotations are not available for almost any other domain, such as animal faces, severely limiting the range of tasks that can be solved. As discussed earlier, this issue is a prominent motivation for transfer learning. However, common transfer learning approaches are not applicable in the “zero-shot” setting, where there is abundant labeled data in the source domain, but strictly unlabeled data in the target domain.
|
| 128 |
+
|
| 129 |
+
We next show that this problem can be solved effectively for directly comparable attributes across domains by leveraging aligned models. Consider the case of head pose (specifically, yaw): a clear and comparable attribute for both humans and dogs, however for humans there is abundant labeled data and for dogs there is none. As demonstrated earlier, the latent pose semantics are aligned in the two models, and the parent’s yaw editing direction continues to edit yaw in the child. As shown earlier, this holds for additional attributes. Thus, despite a major gap between the two domains in image space, the gap in the latent space is considerably smaller, enabling transfer of knowledge between these domains. While na¨ıvely applying a model trained on the source images to the target images would fail, this approach works well when applied on the latent representation. To demonstrate this approach, we solve several zero-shot classification and regression tasks using models trained in the latent space of the parent StyleGAN model.
|
| 130 |
+
|
| 131 |
+
For regression tasks, we use LARGE (Nitzan et al., 2021), which demonstrated that the distance in $\mathcal { W } +$ space to the decision hyperplane associated with a semantic property, gauges the degree of that attribute in image space. See appendix (Section A.6) for more details. Zero-shot yaw regression results are depicted in Figures 28 and 29. As evident, the estimated yaw not only captures the correct tendency, but also produces a value that qualitatively seems reasonably close to actual yaw degree.
|
| 132 |
+
|
| 133 |
+
For classification tasks we take a similar approach. We simply replace the linear regression model with a logistic regression model and use a cutoff value of 0.5. As shown in Figure 7, our method can turn classifiers for human faces to classifiers for dog faces. These results also demonstrate that the attributes are not required to be exactly identical (pose to pose) but could be comparable in a more broad sense (long hair in humans to down-pointing ears in dogs).
|
| 134 |
+
|
| 135 |
+
# 5 CONCLUSION
|
| 136 |
+
|
| 137 |
+
In this work, we performed the first extensive investigation of the properties of aligned generative models. We initially answered several open questions, crucial for their understanding. The findings demonstrated impressive and surprising properties, such as semantic alignment across distant domains and knowledge being “hidden” instead of being forgotten. We then leveraged our new insights to apply aligned models for a multitude of tasks. Interestingly, we obtain state-of-the-art results for those tasks with a single, simple fine-tuning based method. We hope that our work can inspire others to consider aligned models as a simple paradigm for solving a wide range of tasks.
|
| 138 |
+
|
| 139 |
+
# 6 ETHICS STATEMENT
|
| 140 |
+
|
| 141 |
+
This work performs an extensive study of the properties of aligned generative models and applies such models for several computer vision tasks. In general, generative models and learning-based algorithms raise several concerns. Notably, generative models may be used to produce deceiving or offending content, e.g. deepfakes (Wikipedia, 2021), and data-driven algorithms may perpetuate biases exiting in their training sets. However, these concerns are general to the entire fields and are not amplified by this work.
|
| 142 |
+
|
| 143 |
+
# 7 REPRODUCIBILITY
|
| 144 |
+
|
| 145 |
+
Throughout the paper we provide detailed information facilitating reproduction of our results. For example, in each experiment we specify the choices of latent space, specific layer and inversion method (e.g., Sections 4.1, 4.2 and A.5). Similarly, when applying latent editing directions we specify with which method were they identified and in what space (e.g., Section 3, A.3). Additionally, we provide in the appendix (Section A.8) the information required to reproduce the child models. We expect these to be sufficient for independent replication of our main findings. Separately, source code and pretrained models have been made available in the project’s repository.
|
| 146 |
+
|
| 147 |
+
# 8 ACKNOWLEDGMENTS
|
| 148 |
+
|
| 149 |
+
We thank Daniel Cohen-Or for helpful discussions and encouragement and the anonymous reviewers for their comments. This work was supported in part by a gift from Adobe, by the Israel Science Foundation (grant no. 2492/20), and the Joint NSFC-ISF Research Grant Program (3611/21).
|
| 150 |
+
|
| 151 |
+
# REFERENCES
|
| 152 |
+
|
| 153 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the StyleGAN latent space? In Proceedings of the IEEE international conference on computer vision, pp. 4432–4441, 2019.
|
| 154 |
+
|
| 155 |
+
Rameen Abdal, Peihao Zhu, Niloy Mitra, and Peter Wonka. StyleFlow: attribute-conditioned exploration of StyleGAN-generated images using conditional continuous normalizing flows. arXiv preprint arXiv:2008.02401, 2020.
|
| 156 |
+
|
| 157 |
+
Kfir Aberman, Jing Liao, Mingyi Shi, Dani Lischinski, Baoquan Chen, and Daniel Cohen-Or. Neural best-buddies: Sparse cross-domain correspondence. ACM Transactions on Graphics (TOG), 37 (4):69, 2018.
|
| 158 |
+
|
| 159 |
+
David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network Dissection: quantifying interpretability of deep visual representations. In Proc. CVPR, pp. 6541–6549, 2017.
|
| 160 |
+
|
| 161 |
+
Peter Baylies. stylegan-encoder. https://github.com/pbaylies/stylegan-encoder, 2019. Accessed: January 2021.
|
| 162 |
+
|
| 163 |
+
bryandlee. FreezeG. https://github.com/bryandlee/FreezeG, 2020. Accessed: May 2021.
|
| 164 |
+
|
| 165 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. arXiv preprint arXiv:1904.04232, 2019.
|
| 166 |
+
|
| 167 |
+
Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. StarGAN: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8789–8797, 2018.
|
| 168 |
+
|
| 169 |
+
Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. StarGAN v2: Diverse image synthesis for multiple domains. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8188���8197, 2020.
|
| 170 |
+
|
| 171 |
+
Stanley Coren. Do people look like their dogs? Anthrozoos¨ , 12(2):111–114, 1999.
|
| 172 |
+
|
| 173 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 174 |
+
|
| 175 |
+
N. Fish, R. Zhang, L. Perry, D. Cohen-Or, E. Shechtman, and C. Barnes. Image morphing with perceptual constraints and STN alignment. Computer Graphics Forum, 39(6):303–313, 2020.
|
| 176 |
+
|
| 177 |
+
Aviv Gabbay and Yedid Hoshen. Scaling-up disentanglement for image translation. arXiv preprint arXiv:2103.14017, 2021.
|
| 178 |
+
|
| 179 |
+
Rinon Gal, Or Patashnik, Haggai Maron, Gal Chechik, and Daniel Cohen-Or. StyleGAN-NADA: CLIP-guided domain adaptation of image generators. arXiv preprint arXiv:2108.00946, 2021.
|
| 180 |
+
|
| 181 |
+
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.
|
| 182 |
+
|
| 183 |
+
Shanyan Guan, Ying Tai, Bingbing Ni, Feida Zhu, Feiyue Huang, and Xiaokang Yang. Collaborative learning for faster StyleGAN embedding. arXiv preprint arXiv:2007.01758, 2020.
|
| 184 |
+
|
| 185 |
+
Erik Hark ¨ onen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. GANSpace: Discovering ¨ interpretable GAN controls. arXiv preprint arXiv:2004.02546, 2020.
|
| 186 |
+
|
| 187 |
+
Kaiming He, Ross Girshick, and Piotr Dollar. Rethinking imagenet pre-training. In ´ Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4918–4927, 2019.
|
| 188 |
+
|
| 189 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729–9738, 2020.
|
| 190 |
+
|
| 191 |
+
Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-toimage translation. In ECCV, 2018.
|
| 192 |
+
|
| 193 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1125–1134, 2017.
|
| 194 |
+
|
| 195 |
+
Ali Jahanian, Lucy Chai, and Phillip Isola. On the “steerability” of generative adversarial networks. arXiv preprint arXiv:1907.07171, 2019.
|
| 196 |
+
|
| 197 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proc. CVPR, pp. 4401–4410, 2019.
|
| 198 |
+
|
| 199 |
+
Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020a.
|
| 200 |
+
|
| 201 |
+
Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In Proc. CVPR, pp. 8110–8119, 2020b.
|
| 202 |
+
|
| 203 |
+
Ronald Kemker, Marc McClure, Angelina Abitino, Tyler Hayes, and Christopher Kanan. Measuring catastrophic forgetting in neural networks. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence, pp. 3390–3398, 2018.
|
| 204 |
+
|
| 205 |
+
Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In International Conference on Machine Learning, pp. 1857–1865. PMLR, 2017.
|
| 206 |
+
|
| 207 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017.
|
| 208 |
+
|
| 209 |
+
Sam Kwong, Jialu Huang, and Jing Liao. Unsupervised image-to-image translation via pre-trained StyleGAN2 network. IEEE Transactions on Multimedia, 2021.
|
| 210 |
+
|
| 211 |
+
Cheng-Han Lee, Ziwei Liu, Lingyun Wu, and Ping Luo. Maskgan: Towards diverse and interactive facial image manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5549–5558, 2020a.
|
| 212 |
+
|
| 213 |
+
Hsin-Ying Lee, Hung-Yu Tseng, Qi Mao, Jia-Bin Huang, Yu-Ding Lu, Maneesh Kumar Singh, and Ming-Hsuan Yang. DRIT $^ { + + }$ : Diverse image-to-image translation via disentangled representations. International Journal of Computer Vision, pp. 1–16, 2020b.
|
| 214 |
+
|
| 215 |
+
Yijun Li, Richard Zhang, Jingwan Lu, and Eli Shechtman. Few-shot image generation with elastic weight consolidation. arXiv preprint arXiv:2012.02780, 2020.
|
| 216 |
+
|
| 217 |
+
Kevin J Liang, Chunyuan Li, Guoyin Wang, and Lawrence Carin. Generative adversarial network training is a continual learning problem. arXiv preprint arXiv:1811.11083, 2018.
|
| 218 |
+
|
| 219 |
+
Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. In Advances in neural information processing systems, pp. 700–708, 2017.
|
| 220 |
+
|
| 221 |
+
Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. Few-shot unsupervised image-to-image translation. In IEEE International Conference on Computer Vision (ICCV), 2019a.
|
| 222 |
+
|
| 223 |
+
Xihui Liu, Guojun Yin, Jing Shao, Xiaogang Wang, et al. Learning to predict layout-to-image conditional convolutions for semantic image synthesis. In Advances in Neural Information Processing Systems, pp. 570–580, 2019b.
|
| 224 |
+
|
| 225 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild, 2015.
|
| 226 |
+
|
| 227 |
+
Xuan Luo, Xuaner Zhang, Paul Yoo, Ricardo Martin-Brualla, Jason Lawrence, and Steven M. Seitz. Time-travel rephotography. arXiv preprint arXiv:2012.12261, 2020.
|
| 228 |
+
|
| 229 |
+
Michael McCloskey and Neal J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Gordon H. Bower (ed.), Psychology of Learning and Motivation, volume 24, pp. 109–165. Academic Press, 1989.
|
| 230 |
+
|
| 231 |
+
Sangwoo Mo, Minsu Cho, and Jinwoo Shin. Freeze the discriminator: a simple baseline for finetuning GANs. arXiv preprint arXiv:2002.10964, 2020.
|
| 232 |
+
|
| 233 |
+
Yotam Nitzan, Amit Bermano, Yangyan Li, and Daniel Cohen-Or. Face identity disentanglement via latent space mapping. ACM Trans. Graph., 39(6), November 2020. ISSN 0730-0301. doi: 10.1145/3414685.3417826. URL https://doi.org/10.1145/3414685.3417826.
|
| 234 |
+
|
| 235 |
+
Yotam Nitzan, Rinon Gal, Ofir Brenner, and Daniel Cohen-Or. LARGE: Latent-based regression through GAN semantics. arXiv preprint arXiv:2107.11186, 2021.
|
| 236 |
+
|
| 237 |
+
Utkarsh Ojha, Yijun Li, Jingwan Lu, Alexei A Efros, Yong Jae Lee, Eli Shechtman, and Richard Zhang. Few-shot image generation via cross-domain correspondence. arXiv preprint arXiv:2104.06820, 2021.
|
| 238 |
+
|
| 239 |
+
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345–1359, 2009.
|
| 240 |
+
|
| 241 |
+
Taesung Park, Ming-Yu Liu, Ting-Chun Wang, and Jun-Yan Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2337–2346, 2019.
|
| 242 |
+
|
| 243 |
+
Taesung Park, Alexei A Efros, Richard Zhang, and Jun-Yan Zhu. Contrastive learning for unpaired image-to-image translation. In European Conference on Computer Vision, pp. 319–345. Springer, 2020.
|
| 244 |
+
|
| 245 |
+
Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. StyleCLIP: Textdriven manipulation of StyleGAN imagery. arXiv preprint arXiv:2103.17249, 2021.
|
| 246 |
+
|
| 247 |
+
Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14104–14113, 2020.
|
| 248 |
+
|
| 249 |
+
Justin NM Pinkney and Doron Adler. Resolution dependant GAN interpolation for controllable image synthesis between domains. arXiv preprint arXiv:2010.05334, 2020.
|
| 250 |
+
|
| 251 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. preprint, 2018.
|
| 252 |
+
|
| 253 |
+
Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. Encoding in style: a StyleGAN encoder for image-to-image translation. In Proc. IEEE/CVF CVPR, pp. 2287–2296, 2021.
|
| 254 |
+
|
| 255 |
+
Ari Seff, Alex Beatson, Daniel Suo, and Han Liu. Continual learning in generative adversarial nets. arXiv preprint arXiv:1705.08395, 2017.
|
| 256 |
+
|
| 257 |
+
Yujun Shen, Jinjin Gu, Xiaoou Tang, and Bolei Zhou. Interpreting the latent space of GANs for semantic face editing. In Proc. CVPR, pp. 9243–9252, 2020a.
|
| 258 |
+
|
| 259 |
+
Yujun Shen, Ceyuan Yang, Xiaoou Tang, and Bolei Zhou. InterFaceGAN: interpreting the disentangled face representation learned by GANs. arXiv preprint arXiv:2005.09635, 2020b.
|
| 260 |
+
|
| 261 |
+
Guoxian Song, Linjie Luo, Jing Liu, Wan-Chun Ma, Chunpong Lai, Chuanxia Zheng, and Tat-Jen Cham. AgileGAN: stylizing portraits by inversion-consistent transfer learning. ACM Transactions on Graphics (TOG), 40(4):1–13, 2021.
|
| 262 |
+
|
| 263 |
+
Ayush Tewari, Mohamed Elgharib, Gaurav Bharaj, Florian Bernard, Hans-Peter Seidel, Patrick Perez, Michael Zollh ´ ofer, and Christian Theobalt. StyleRig: Rigging StyleGAN for 3d control ¨ over portrait images. arXiv preprint arXiv:2004.00121, 2020.
|
| 264 |
+
|
| 265 |
+
Hoang Thanh-Tung and Truyen Tran. Catastrophic forgetting and mode collapse in GANs. In 2020 International Joint Conference on Neural Networks (IJCNN), pp. 1–10. IEEE, 2020.
|
| 266 |
+
|
| 267 |
+
Lisa Torrey and Jude Shavlik. Transfer learning. In Handbook of research on machine learning applications and trends: algorithms, methods, and techniques, pp. 242–264. IGI global, 2010.
|
| 268 |
+
|
| 269 |
+
Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or. Designing an encoder for StyleGAN image manipulation. arXiv preprint arXiv:2102.02766, 2021.
|
| 270 |
+
|
| 271 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional GANs. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8798–8807, 2018a.
|
| 272 |
+
|
| 273 |
+
Xintao Wang, Ke Yu, Chao Dong, Xiaoou Tang, and Chen Change Loy. Deep network interpolation for continuous imagery effect transition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1692–1701, 2019.
|
| 274 |
+
|
| 275 |
+
Yaxing Wang, Chenshen Wu, Luis Herranz, Joost van de Weijer, Abel Gonzalez-Garcia, and Bogdan Raducanu. Transferring GANs: generating images from limited data. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 218–234, 2018b.
|
| 276 |
+
|
| 277 |
+
Yaxing Wang, Abel Gonzalez-Garcia, David Berga, Luis Herranz, Fahad Shahbaz Khan, and Joost van de Weijer. MineGAN: effective knowledge transfer from GANs to target domains with few images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9332–9341, 2020.
|
| 278 |
+
|
| 279 |
+
Wikipedia. Deepfake. https://en.wikipedia.org/wiki/Deepfake, 2021.
|
| 280 |
+
|
| 281 |
+
George Wolberg. Image morphing: a survey. The Visual Computer, 14(8):360–372, 1998.
|
| 282 |
+
|
| 283 |
+
Zongze Wu, Dani Lischinski, and Eli Shechtman. StyleSpace analysis: Disentangled controls for StyleGAN image generation. arXiv:2011.12799, 2020.
|
| 284 |
+
|
| 285 |
+
Weihao Xia, Yulun Zhang, Yujiu Yang, Jing-Hao Xue, Bolei Zhou, and Ming-Hsuan Yang. GAN inversion: A survey, 2021.
|
| 286 |
+
|
| 287 |
+
Tete Xiao, Yingcheng Liu, Bolei Zhou, Yuning Jiang, and Jian Sun. Unified perceptual parsing for scene understanding. In Proc. ECCV, pp. 418–434, 2018.
|
| 288 |
+
|
| 289 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems, volume 27, 2014.
|
| 290 |
+
|
| 291 |
+
Changqian Yu, Jingbo Wang, Chao Peng, Changxin Gao, Gang Yu, and Nong Sang. BiSeNet: Bilateral segmentation network for real-time semantic segmentation. In Proceedings of the European conference on computer vision (ECCV), pp. 325–341, 2018.
|
| 292 |
+
|
| 293 |
+
Mengyao Zhai, Lei Chen, Frederick Tung, Jiawei He, Megha Nawhal, and Greg Mori. Lifelong GAN: Continual learning for conditional image generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2759–2768, 2019.
|
| 294 |
+
|
| 295 |
+
Chuanxia Zheng, Tat-Jen Cham, and Jianfei Cai. The spatially-correlative loss for various image translation tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16407–16417, 2021.
|
| 296 |
+
|
| 297 |
+
Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain GAN inversion for real image editing. arXiv preprint arXiv:2004.00049, 2020a.
|
| 298 |
+
|
| 299 |
+
Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A. Efros. Generative visual manipula- ¨ tion on the natural image manifold. In Proceedings of European Conference on Computer Vision (ECCV), 2016.
|
| 300 |
+
|
| 301 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proc. IEEE ICCV, pp. 2223–2232, 2017a.
|
| 302 |
+
|
| 303 |
+
Jun-Yan Zhu, Richard Zhang, Deepak Pathak, Trevor Darrell, Alexei A Efros, Oliver Wang, and Eli Shechtman. Toward multimodal image-to-image translation. In Advances in Neural Information Processing Systems, 2017b.
|
| 304 |
+
|
| 305 |
+
Peihao Zhu, Rameen Abdal, Yipeng Qin, and Peter Wonka. SEAN: Image synthesis with semantic region-adaptive normalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5104–5113, 2020b.
|
| 306 |
+
|
| 307 |
+
# A APPENDIX
|
| 308 |
+
|
| 309 |
+
# A.1 EFFECT OF TUNING ON INDIVIDUAL FEATURE CONVOLUTION LAYERS
|
| 310 |
+
|
| 311 |
+
As part of our investigation of which parts of the network change during fine-tuning, we also examine in more detail the effect of resetting the weights of individual feature convolution layers on the generated images. We reset one layer at a time and measure the perceptual change in an image using LPIPS. Results are displayed in Table 2. As may be seen, each layer has an effect on the image, but resetting the middle resolution layers (32, 64, 128) induces the greatest LPIPS change.
|
| 312 |
+
|
| 313 |
+
# A.2 FURTHER SEMANTIC ALIGNMENT ANALYSIS
|
| 314 |
+
|
| 315 |
+
Since many semantic attributes cannot be controlled by a single style channel, nor by a single manipulation direction in $\mathcal { W }$ , we also compare the effect of different semantic manipulation directions in StyleSpace, which are discovered for the parent model using CLIP (Patashnik et al., 2021). Figures 10 and 11 demonstrate that these compound manipulations, e.g., expressions and hair styles, also retain their semantics in the child models.
|
| 316 |
+
|
| 317 |
+
# A.3 LOCALITY BIAS IN SEMANTICS TRANSFER.
|
| 318 |
+
|
| 319 |
+
We have demonstrated that a variety of localized controls retain their function during transfer learning between FFHQ and AFHQ. However, since the faces in these two datasets are roughly aligned, it is interesting to examine whether this occurs due to overlap between the corresponding semantic regions. To examine this, we perform transfer learning from a model pretrained on FFHQ (at $2 5 6 \times 2 5 6$ resolution) to three different versions of the same dataset: (i) shifted 60 pixels to the right, (ii) shifted 60 pixels downward, and (iii) flipped upside down. Figure 15 shows that the shifts, and particularly the flip, affect the identity/appearance of the images generated from the same latent codes in $\mathcal { Z }$ , however other high-level characteristics, such as gender, age, or hair length, remain similar. We also show the effect of manipulating five different style channels across different layers and different semantic regions. For the horizontally shifted dataset, all five channels retain their function. For the vertical shift, four out of the five channels retain their function (channel 15 45 that controls lipstick loses its effect). For the upside down flip, two out of five channels (9 409 for gaze and 12 479 for blond hair) retain their function. In summary, for 11 out of 15 cases, the function of a channel was transferred despite a significant change in the locality. Thus, locality bias cannot explain all of the alignment that occurs.
|
| 320 |
+
|
| 321 |
+
There are, however, some interesting examples of strong locality bias. Channel 6 501 controls smiling in the parent FFHQ model, but after an upside-down flip it controls receding hairline, this implies locality bias does contribute to channel-wise semantics transfer, since the forehead of the flipped faces overlaps the mouth location in the original images.
|
| 322 |
+
|
| 323 |
+
# A.4 SEMANTIC ALIGNMENT BETWEEN DIFFERENT RESOLUTIONS
|
| 324 |
+
|
| 325 |
+
Given a high resolution StyleGAN2 model, an aligned lower resolution model may be easily obtained by simply removing the high resolution layers, and fine-tuning to convergence. The finetuning is necessary, as without it the model generates low-contrast images, as shown in Figure 30. This works well because StyleGAN2 inherently supports multi-resolution synthesis, with the generator containing ToRGB layers and the discriminator containing corresponding FromRGB layers that directly operate in image space for different resolutions. Assuming a high resolution $( 1 0 2 4 \times 1 0 2 4 )$ model is already available, creating a low-resolution model $( 5 1 2 \times 5 1 2 )$ in this way is computationally efficient, requiring less than 2 days of fine-tuning on a single GTX1080Ti GPU, compared to more than one month of training from scratch. Figure 30 shows that the resulting low-resolution model is highly aligned with the original: the same latent code $z \in { \mathcal { Z } }$ generates nearly the same image, and the semantic controls in the parent model have the same effect in the child model. One of the important consequences of such alignment is that there’s no need to spend weeks of GPU time to re-discover the semantic StyleSpace controls (Wu et al., 2020). Furthermore, given an inversion model (Tov et al., 2021) for the parent model, it may be fine-tuned for the child model within a few GPU hours, instead of 2-3 days of training from scratch.
|
| 326 |
+
|
| 327 |
+
# A.5 METHODS AND SPACES FOR IMAGE TRANSLATION
|
| 328 |
+
|
| 329 |
+
To determine which latent space and inversion method (encoder or optimization) is best suited for translation of real images, we explore a number of alternatives. We modify the pSp encoder (Richardson et al., 2021) to embed images into W, $\mathcal { Z }$ , and $\mathcal { Z } +$ (Song et al., 2021) spaces. For $\mathcal { W } +$ we use the e4e encoder (Tov et al., 2021), which is based on pSp, but generates $\mathcal { W } +$ codes with better alignment with the latent manifold. We also modify the latent optimization method from the official StyleGAN2 implementation (Karras et al., 2020b) to embed into these different spaces. For $\mathcal { Z } / \mathcal { Z } +$ , it is crucial to use the truncation trick for both image inversion and generation, otherwise the translation results might exhibit strong artifacts (we use a truncation coefficient of 0.7). Inversion results corresponding to these different methods are shown in Figure 16 for AFHQ dogs and cats.
|
| 330 |
+
|
| 331 |
+
Examples of I2I translation (dog2wild and cat2dog) using these different inversion methods are shown in Figure 17. While inversion of source domain images to $\mathcal { W } +$ yields arguably the best reconstructions, when translating to the target domain via $\mathcal { W }$ or $\mathcal { W } +$ , the color palette of the results seems wrong, especially for the dog2wild translation. We attribute this to the fact that the mapping function (from $\mathcal { Z }$ to $\mathcal { W }$ ) changes when fine tuning the parent to the child, which affects the color palette, and translating using ${ \ w } / { \ w } +$ latent codes ignores this change. Translations via $\mathcal { Z } +$ or ${ \mathcal { Z } } \mathrm { + } _ { o p t }$ inversion also suffer from occasional color artifacts (mainly in the dog2wild examples).
|
| 332 |
+
|
| 333 |
+
Both $\mathcal { Z }$ and $\mathcal { Z } _ { o p t }$ , on the other hand, yield satisfactory translation results. We prefer $\mathcal { Z } _ { o p t }$ because it tends to produce a vivid color palette and to maintain a stronger resemblance of the source images, in terms of pose, shape, and colors. Quantitatively, translating via $\mathcal { Z } _ { o p t }$ inversion achieves best FID and KID over the other plausible alternatives, as reported in Table 5. Therefore we use translation via $\mathcal { Z } _ { o p t }$ as our preferred method.
|
| 334 |
+
|
| 335 |
+
We perform similar study for translation between nearby domains (FFHQ and cartoon) in Figure 18, 19 and 20. In our subjective opinion, translation via $\mathcal { Z } _ { o p t }$ still achieves the most cartoonish look. However, translations via $\mathcal { W }$ bear closer resemblance to the input portrait, while still achieving a satisfactory cartoonish look. As discussed in the text, this may be attributed to the fact that, for similar domains, the mapping function changes little during fine-tuning, resulting in pointwise alignment of the $\mathcal { W }$ spaces of the parent and child models.
|
| 336 |
+
|
| 337 |
+
# A.6 ZERO-SHOT REGRESSION
|
| 338 |
+
|
| 339 |
+
To leverage aligned models for regression tasks, we use LARGE (Nitzan et al., 2021), which demonstrated that the distance in $\mathcal { W } +$ space to the decision hyperplane associated with a semantic property, gauges the degree of that attribute in image space. As their method is designed for a few-shot setting, we simplify it slightly for our setting where the training data in the source domain is abundant. Concisely, we simply use the distances calculated in specific layers known to control certain attributes as the input features for the regression model. We demonstrate this approach for head pose regression and use the first four layers, which are known to control the pose in StyleGAN (Karras et al., 2019; Nitzan et al., 2021). At inference time, we use e4e (Tov et al., 2021) to encode images of the target domain into the $\mathcal { W } +$ space of the child model, compute the distances of the first four layers from the decision hyperplane, and input them to the human face yaw estimation model.
|
| 340 |
+
|
| 341 |
+
The zero-shot yaw regression results for AFHQ dogs and cats are depicted in Figures 28 and 29. As can be seen, the estimated yaw not only captures the correct tendency, but also produces a value that qualitatively seems reasonably close to actual yaw degree.
|
| 342 |
+
|
| 343 |
+
# A.7 METHODS TO BLEND ALIGNED MODELS
|
| 344 |
+
|
| 345 |
+
Layer swapping was introduced by Pinkney & Adler (2020) as a method to generate images of a new domain by “blending” together two existing data domains. It does that by creating a hybrid model contains layers from two aligned models. Specifically, the first (coarse) layers are taken from one model and the last (fine) layers are taken from another. We note that this method blends the two data domains in a specific manner. Thanks to the hierarchical structure of StyleGAN (Karras et al., 2019), the created model inherits the structure (coarse layers) from one model and texture from another (fine layers). Pinkney & Adler (2020) also mentioned that the fine layers could be interpolated between the models, however this idea wasn’t applied in practice.
|
| 346 |
+
|
| 347 |
+
The layer swapping method was shown to produce visually pleasing results on the task of stylizing human portraits (Pinkney & Adler, 2020; Song et al., 2021). However, there are a few disadvantages to this method. First, when domains are more distant (e.g. faces of humans and dogs), the results obtained by this approach are less intuitive and visually pleasing (see Figures 31 to 33). This coincides well with our observation from Figure 8. Since the feature convolution layers change much more significantly when transferring to a distant domain, the layers of a layer-swapped model are more alien to each other. Second, the number of intermediate steps is limited by the number of convolution layers in the generator, which is at most 18. This prevents the application of layer swapping for creating a smooth transition between images from different domains.
|
| 348 |
+
|
| 349 |
+
In our morphing application (Section 4.2), we present an alternative method to blend two aligned models. There we propose to perform a simple linear interpolation of all model weights to achieve a gradual transition. We compare the results of this approach with layer swapping in Figures 31 to 33. Please note that our proposed method is able to obtain “blended” images that seem more smooth and natural.
|
| 350 |
+
|
| 351 |
+
# A.8 FINE-TUNING IMPLEMENTATION DETAILS
|
| 352 |
+
|
| 353 |
+
Given a model pretrained on the parent domain, we fine-tune it on the child domain. Specifically, we use model config-f and the default hyper-parameters from the official Nvidia StyleGAN2 and StyleGAN2-ADA implementations in tensorflow. We use the augmentations of StyleGAN2-ADA only when the child domain is AFHQ or Metface.
|
| 354 |
+
|
| 355 |
+
Note that StyleGAN2-ADA implementation chooses the config based on input image resolution. It uses config-f for image resolution above $5 1 2 \times 5 1 2$ , and config-e for other resolutions. To use config-f without worrying about image resolution, one can specify the flag --cfg stylegan2 when using tran.py, and change line 179 in train.py from spec.fmaps $\ c = ~ 1$ if res $> = ~ 5 1 2$ else 0.5 to spec.fmaps $\ c = ~ 1$ .
|
| 356 |
+
|
| 357 |
+
# A.9 DETECTING LOCALIZED CHANNELS
|
| 358 |
+
|
| 359 |
+
We follow $\mathrm { W u }$ et al. (2020) to discover localized channels in the StyleGAN model. To reduce noise, we only consider channels to be localized if they have the strongest gradient in the same semantic region over $7 5 \%$ of sampling images, rather than $5 0 \%$ used in the original paper. For FFHQ and Metface models, we use the semantic segmentation maps from BiSeNet (Yu et al., 2018) pretrained on CelebAMask-HQ (Lee et al., 2020a). For AFHQ dogs, we using the semantic segmentation maps from a unified parsing network (Xiao et al., 2018) pretrained on Broden $^ +$ (Bau et al., 2017).
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 8: We reset the weights of different components in child models (Mega, dog, church) to their initial values, which come from the parent model (FFHQ). When resetting the weights in feature convolution layers, the output images change more drastically (content, structure), while resetting the weights of other components causes milder effects. This implies feature convolution layers contain most of new learned knowledge.
|
| 363 |
+
|
| 364 |
+
Table 2: We measure the extent to which the change in each feature convolution layer (during finetuning) affects the generated images. Given a parent FFHQ model and a child AFHQ dog model, we reset the feature convolution weights for each resolution of the child model to their original values in the parent model, and measure the LPIPS distance between the images generated by child model before and after resetting the weights. A higher LPIPS score indicates a more significant change in image space. It may be seen that the greatest change is caused by resetting the middle resolution layers (32, 64, 128).
|
| 365 |
+
|
| 366 |
+
<table><tr><td>Resolution</td><td>4</td><td>8</td><td>16</td><td>32</td><td>64</td><td>128</td><td>256</td><td>512</td></tr><tr><td>LPIPS</td><td>0.156</td><td>0.385</td><td>0.390</td><td>0.432</td><td>0.440</td><td>0.405</td><td>0.369</td><td>0.355</td></tr></table>
|
| 367 |
+
|
| 368 |
+
Table 3: The number of localized StyleSpace controls for various semantic regions for an FFHQ parent model and an FFHQ grandchild model, with training flow from FFHQ (parent) to AFHQ dog (child) then back to FFHQ (grandchild). Each column corresponds to a semantic region for parent and each row to a semantic region for grandchild. The number of localized channels shared between two models is indicated for each pair of semantic regions.
|
| 369 |
+
|
| 370 |
+
<table><tr><td></td><td></td><td>eyebrow 19</td><td>eye 5</td><td>ear 41</td><td>nose 21</td><td>mouth 32</td><td>neck 46</td><td>cloth 34</td><td>hair 62</td></tr><tr><td>eyebrow</td><td>29</td><td>8</td><td></td><td></td><td>1</td><td></td><td>1</td><td></td><td></td></tr><tr><td>eye</td><td>9</td><td></td><td>3</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ear</td><td>45</td><td></td><td></td><td>20</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>nose</td><td>23</td><td></td><td></td><td></td><td>8</td><td></td><td></td><td></td><td></td></tr><tr><td>mouth</td><td>55</td><td></td><td></td><td></td><td></td><td>11</td><td></td><td></td><td></td></tr><tr><td>neck</td><td>61</td><td></td><td></td><td></td><td>1</td><td></td><td>15</td><td></td><td></td></tr><tr><td>cloth</td><td>65</td><td></td><td></td><td></td><td></td><td></td><td></td><td>19</td><td></td></tr><tr><td>hair</td><td>70</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>33</td></tr></table>
|
| 371 |
+
|
| 372 |
+
<table><tr><td></td><td></td><td>eyebrow 19</td><td>eye 5</td><td>ear 41</td><td>nose 21</td><td>mouth 32</td><td>neck 46</td><td>cloth 34</td><td>hair 62</td></tr><tr><td>eyebrow</td><td>22</td><td></td><td></td><td></td><td></td><td>1</td><td>1</td><td></td><td></td></tr><tr><td>eye</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>1</td></tr><tr><td>ear</td><td>44</td><td></td><td></td><td></td><td></td><td>1</td><td>1</td><td>1</td><td></td></tr><tr><td>nose</td><td>19</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>mouth</td><td>28</td><td></td><td></td><td>1</td><td>1</td><td>1</td><td></td><td></td><td></td></tr><tr><td>neck</td><td>43</td><td></td><td></td><td>1</td><td></td><td>1</td><td>1</td><td></td><td>1</td></tr><tr><td>cloth</td><td>32</td><td></td><td></td><td>2</td><td>1</td><td></td><td></td><td>1</td><td></td></tr><tr><td>hair</td><td>85</td><td></td><td></td><td></td><td></td><td>1</td><td>2</td><td></td><td>2</td></tr></table>
|
| 373 |
+
|
| 374 |
+
Table 4: The number of localized StyleSpace controls for various semantic regions for two randomly initialized FFHQ models. Each column corresponds to a semantic region in one model and each row to a semantic region in the other model. The number of localized channels shared between two models is indicated for each pair of semantic regions. It is evident that the two models only have a small number of overlap channels across unrelated semantic regions (for example, hair and eye). This experiment serves as a negative control to show that a large number of overlap channels only occurs when the two models have parent and child relation, as is the case in Table 1
|
| 375 |
+
|
| 376 |
+

|
| 377 |
+
Figure 9: Semantic alignment: semantic controls discovered for the parent model (FFHQ) retain their function in the children models (Mega and Metface). This holds for individual channels in $s$ (bangs, smile, gaze), where the layer and channel number is indicated under each column. Semantic alignment is also observed for manipulation directions in $\mathcal { W }$ (pose, age, gender).
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 10: Semantic alignment of multiple channels: semantically meaningful directions in StyleSpace discovered in the parent model (FFHQ), detected using StyleCLIP (Patashnik et al., 2021), still control the same attributes in children models (Mega and Metface).
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 11: Semantic alignment of multiple channels: semantically meaningful directions in StyleSpace discovered in the parent model (FFHQ), detected using StyleCLIP (Patashnik et al., 2021), still control the same attributes in children models (Mega and Metface).
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 12: Examples of semantic alignment between single-channel, as well as multi-channel controls discovered for the parent model (StyleGAN2 trained on FFHQ) and a child model (AFHQ dogs). While the analogy between hair in humans and fur in dogs seems intuitive, there are also some less obvious analogies, such as hair length and ear length.
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 13: During transfer learning between domains, we can observe a smooth transition in images generated from the same latent code $z \in { \mathcal { Z } }$ . The top row demonstrates this for transfer from FFHQ to AFHQ dogs, while the bottom rows shows this for transfer from AFHQ dogs to cats. The number of epochs is indicated above each column. The most significant visual changes occur in early epochs (0–16), while later epochs mainly improve image quality and realism without significant changes in semantic attributes.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 14: Some degree of semantic alignment is present even when the source and target domains are very dissimilar. In the top two rows, we show that the latent direction that controls pose in the parent FFHQ model still controls pose in the child LSUN church model. In the bottom two rows, we examine a double transfer, with FFHQ as parent, AFHQ dog as child and LSUN bedroom as grandchild. The pose direction in FFHQ still controls the pose in the grandchild bedroom model.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 15: To understand whether locality bias contributes to semantics transfer, we fine-tune a pretrained FFHQ model in $2 5 6 \times 2 5 6$ resolution, to (i) a FFHQ dataset shifted 60 pixels to the right, (ii) a FFHQ dataset shifted 60 pixels downward, and (iii) a FFHQ dataset flipped upside-down. We examine the semantics transfer for 5 channels across different layers and different semantic regions. For the shift right case, all 5 channels retain their function. For the shift down case, 4 out of 5 channels retain their function (channel 15 45 loses its function for lipstick). For the upside-down flip, 2 out of 5 (9 409 gaze and 12 479 blond hair) retain their function. In summary, for 11 out of 15 cases, the semantic function of channels is transferred even if we break the locality bias. These results imply that the transfer of semantics cannot be fully attributed to locality bias.
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 16: To invert real images of animal faces to different latent spaces, we examine both encoders and latent optimization based methods. We use the pSp encoder (Richardson et al., 2021) as a backbone and modify it to embed into $\mathcal { W }$ , $\mathcal { Z }$ , and $\mathcal { Z } +$ (Song et al., 2021) spaces. For the $\mathcal { W } \mathcal { + }$ space, we use e4e (Tov et al., 2021), which also uses pSp (Richardson et al., 2021) as backbone. For optimization based inversion, we modify the optimization code from StyleGAN2 (Karras et al., 2020b) to $\mathcal { Z }$ or $\mathcal { Z } +$ space (two rightmost columns). All of the inversion methods yield reasonably faithful reconstructions, with occasional artifacts in the $\mathcal { Z }$ and ${ \mathcal { Z } } \mathrm { + } _ { o p t }$ reconstructions. Note that, as we show below, that better reconstruction does not necessarily yield the best image translation.
|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
Figure 17: Comparison of I2I results (dog2wild in the top four rows, cat2dog in the four bottom ones) for the different inversions shown in Figure 16. The color palette appears to be wrong for both $\mathcal { W } +$ and $\mathcal { W }$ encoding, especially for the dog to wildlife translation. This is not surprising, since the mapping function changes during fine tuning (see Figure 1), affecting the color palette, and inverting into the $\mathcal { W }$ or $\mathcal { W } +$ spaces ignores the difference between the mapping functions of the parent and child. Translations via $\mathcal { Z } +$ or ${ \mathcal { Z } } \mathrm { + } _ { o p t }$ inversion also suffer from occasional color artifacts (mainly in the dog2wild examples). Translations via either $\mathcal { Z }$ or $\mathcal { Z } _ { o p t }$ provide satisfactory results. We prefer $\mathcal { Z } _ { o p t }$ because it typically yields a more vivid color palette, while slightly better capturing the characteristics of the source images (especially in the dog2wild examples).
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 18: To invert real images of human faces to different latent spaces, we examine both encoders and latent optimization based methods. We use the pSp encoder (Richardson et al., 2021) as a backbone and modify it to embed into $\mathcal { W }$ space. For the $\mathcal { W } \mathcal { + }$ space, we use e4e (Tov et al., 2021), which also uses pSp (Richardson et al., 2021) as backbone. We also experimented with using the pSp encoder to $\mathcal { Z }$ , and $\mathcal { Z } +$ (Song et al., 2021) spaces, but training does not converge and results are unrealistic. For optimization-based inversion, we modify the optimization code from StyleGAN2 (Karras et al., 2020b) to $\mathcal { W }$ , $\mathcal { W } \mathcal { + }$ , $\mathcal { Z }$ or $\mathcal { Z } +$ spaces. In terms of reconstruction quality alone, $\mathcal { W } \mathcal { + }$ typically yields the best inversions; however, as we show below, better reconstruction does not necessarily yield the best image translation.
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 19: Comparison of I2I results (for real faces to cartoon-like, using FFHQ parent and Mega child) for the different inversions shown in Figure 18. Translation results via $\mathcal { W } _ { o p t }$ and $\mathcal { W } \mathrm { + } _ { o p t }$ contain strong artifacts. In our subjective opinion, translation via $\mathcal { Z } _ { o p t }$ achieves the most cartoonish look. However, translations via $\mathcal { W }$ bear closer resemblance to the input portrait, while still achieving a satisfactory cartoonish look. As discussed in the text, this may be attributed to the fact that, for similar domains, the mapping function changes little during fine-tuning, resulting in pointwise alignment of the $\mathcal { W }$ spaces of the parent and child models.
|
| 408 |
+
|
| 409 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Zenc</td><td rowspan=1 colspan=1>Z+enc</td><td rowspan=1 colspan=1>Zopt</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Zenc</td><td rowspan=1 colspan=1>Z+enc</td><td rowspan=1 colspan=1>Zopt</td></tr><tr><td rowspan=1 colspan=1>cat2dog</td><td rowspan=1 colspan=1>48.8</td><td rowspan=1 colspan=1>68.5</td><td rowspan=1 colspan=1>34.2</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>16.1</td><td rowspan=1 colspan=1>34.8</td><td rowspan=1 colspan=1>7.36</td></tr><tr><td rowspan=1 colspan=1>dog2wild</td><td rowspan=1 colspan=1>22.1</td><td rowspan=1 colspan=1>24.8</td><td rowspan=1 colspan=1>10.9</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>10.9</td><td rowspan=1 colspan=1>12.2</td><td rowspan=1 colspan=1>2.19</td></tr><tr><td rowspan=2 colspan=1>wild2dogdog2cat</td><td rowspan=2 colspan=1>60.030.4</td><td rowspan=1 colspan=1>62.5</td><td rowspan=1 colspan=2>34.7</td><td rowspan=1 colspan=1>15.5</td><td rowspan=1 colspan=1>22.7</td><td rowspan=2 colspan=1>5.983.79</td></tr><tr><td rowspan=1 colspan=1>21.1</td><td rowspan=1 colspan=2>17.9</td><td rowspan=1 colspan=1>14.5</td><td rowspan=1 colspan=1>5.49</td></tr><tr><td rowspan=1 colspan=8>(a)FID (b)KID×10³</td></tr></table>
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Table 5: A quantitative comparison of I2I translation via different latent spaces and inversion methods. Based on the qualitative results shown in Figure 17, we consider encoder-based inversion for $\mathcal { Z }$ and $\mathcal { Z } +$ spaces, and latent optimization method for $\mathcal { Z }$ space, to be promising methods and further examine them using FID and KID scores. Our results indicate that inversion $\mathcal { Z }$ using latent optimization achieves the best FID and KID for I2I translation tasks.
|
| 413 |
+
Figure 20: Image Toonification using our $\mathcal { Z } _ { o p t }$ method.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 21: Aligned models enable effective image translation between dissimilar domains (human face and dog face). Some interesting analogies emerge in these translations. For example, as the human hair becomes longer, so does the dog’s fur, while the dog’s ears change from “candle flame” ears, to “bat” ears, and finally to folded (“down-pointing”) ears. The fur color is mainly determined by the human hair color, and the dog pose mimics that of the human.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 22: Reference-based image translation. Given a real dog image as source and a real cat image as reference, we aim to obtain a cat image that keeps the content (mainly pose) from the source and the style (fur texture and color) from the reference. We first invert the input real images to latent space of StyleGAN, then take style codes for all layers below $n$ (low resolution) from the source, and style codes for layers above or equal to $n$ (high resolution) from the reference. The layer index $n$ is indicated above each column. Thus, index 0 represents the inverted reference, and index 23 represents the translation of the source to the target domain (cats), while the other indices correspond to standard style mixing in StyleGAN. We can see that when $n$ is around 6, the images combine the pose of the source with the style of the reference.
|
| 420 |
+
|
| 421 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>W+ enc</td><td rowspan=1 colspan=1>Z+ enc</td><td rowspan=1 colspan=1>Z enc</td><td rowspan=1 colspan=1>z_opts</td><td rowspan=1 colspan=1>W+ enc</td><td rowspan=1 colspan=1>Z+ enc</td><td rowspan=1 colspan=1>Z enc</td><td rowspan=1 colspan=1>z_opts</td></tr><tr><td rowspan=1 colspan=1>dog2cat</td><td rowspan=1 colspan=1>10.3</td><td rowspan=1 colspan=1>11.2</td><td rowspan=1 colspan=1>13.7</td><td rowspan=1 colspan=1>9.22</td><td rowspan=1 colspan=1>4.87</td><td rowspan=1 colspan=1>4.85</td><td rowspan=1 colspan=1>6.56</td><td rowspan=1 colspan=1>3.43</td></tr><tr><td rowspan=2 colspan=1>wild2dogcat2dogdog2wild</td><td rowspan=2 colspan=1>44.542.137.9</td><td rowspan=2 colspan=1>37.644.328.3</td><td rowspan=1 colspan=1>36.6</td><td rowspan=1 colspan=1>27.4</td><td rowspan=1 colspan=1>27.2</td><td rowspan=2 colspan=1>21.128.216.2</td><td rowspan=2 colspan=1>18.827.012.5</td><td rowspan=2 colspan=1>14.817.03.64</td></tr><tr><td rowspan=1 colspan=1>40.718.5</td><td rowspan=1 colspan=1>30.49.65</td><td rowspan=1 colspan=1>27.621.5</td></tr><tr><td rowspan=1 colspan=7>(a)FID (b) KID×10³</td><td rowspan=1 colspan=2>03</td></tr></table>
|
| 422 |
+
|
| 423 |
+
Table 6: A quantitative comparison of reference-based image translation using different inversion methods and latent spaces. It may be seen that the latent optimization method for $\mathcal { Z }$ achieves the best FID and KID for such translation tasks.
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
Figure 23: A qualitative comparison of reference-based image translation for different methods and spaces. Since here the colors are determined by the higher layers of the generator, whose style parameters come from the inversion of the reference image, the translation via $\mathcal { W } \mathcal { + }$ does not suffer from color palette issues. Thus, both translations via $\mathcal { W } \mathcal { + }$ and via $\mathcal { Z } _ { o p t }$ look satisfactory.
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
Figure 24: Given a pair of real images from domain $A$ (top-left) and $B$ (bottom-right), we smoothly transition between them by interpolating their latent codes in $\mathcal { W } +$ , as well as the model weights. $t _ { 1 }$ is the interpolation coefficient for the latent codes, while $t _ { 2 }$ is the coefficient for the model weights. In the same column (fixed $t _ { 1 }$ ), we obtain a smooth transition between the domains (different species, but the same pose and fur color). In the same row (fixed $t _ { 2 }$ ), we have a smooth transition inside the same domain (same species, varying pose and fur color). Any trajectory between the top-left and bottom-right corners yields a smooth morph sequence between two input images. See the accompanying video, which progresses along the diagonal $t _ { 1 } = t _ { 2 }$ .
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 25: Given a pair of real images from domain $A$ (top-left) and $B$ (bottom-right), we smoothly transition between them by interpolating their latent codes in $\mathcal { W } +$ , as well as the model weights. $t _ { 1 }$ is the interpolation coefficient for the latent codes, while $t _ { 2 }$ is the coefficient for the model weights. In the same column (fixed $t _ { 1 }$ ), we obtain a smooth transition between the domains (different species, but the same pose and fur color). In the same row (fixed $t _ { 2 }$ ), we have a smooth transition inside the same domain (same species, varying pose and fur color). Any trajectory between the top-left and bottom-right corners yields a smooth morph sequence between two input images. See the accompanying video, which progresses along the diagonal $t _ { 1 } = t _ { 2 }$ .
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 26: Given a pair of real images from domain $A$ (top-left) and $B$ (bottom-right), we smoothly transition between them by interpolating their latent codes in $\mathcal { W } +$ , as well as the model weights. $t _ { 1 }$ is the interpolation coefficient for the latent codes, while $t _ { 2 }$ is the coefficient for the model weights. In the same column (fixed $t _ { 1 }$ ), we obtain a smooth transition between the domains (different species, but the same pose and similar fur/hair color). In the same row (fixed $t _ { 2 }$ ), we have a smooth transition inside the same domain (same species, varying pose and color). Any trajectory between the topleft and bottom-right corners yields a smooth morph sequence between two input images. See the accompanying video, which progresses along the diagonal $t _ { 1 } = t _ { 2 }$ .
|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
Figure 27: Given a pair of real images from domain $A$ (top-left) and $B$ (bottom-right), we smoothly transition between them by interpolating their latent codes in $\mathcal { W } +$ , as well as the model weights. $t _ { 1 }$ is the interpolation coefficient for the latent codes, while $t _ { 2 }$ is the coefficient for the model weights. In the same column (fixed $t _ { 1 }$ ), we obtain a smooth transition between the domains (different species, but the same pose and similar fur/hair color). In the same row (fixed $t _ { 2 }$ ), we have a smooth transition inside the same domain (same species, varying pose and color). Any trajectory between the topleft and bottom-right corners yields a smooth morph sequence between two input images. See the accompanying video, which progresses along the diagonal $t _ { 1 } = t _ { 2 }$ .
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 28: Demonstration of our zero-shot dog yaw regression model. The images are from AFHQ dog dataset, split into several bins (rows), based on the regressed yaw values. The images shown are randomly picked from each bin (no cherry picking). The estimated yaw values capture the correct tendency (right facing to left facing), and in most cases appear to be close to the actual yaw degree.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 29: Demonstration of our zero-shot cat yaw regression model. The images are from AFHQ cat dataset, split into several bins (rows), based on the regressed yaw values. The images shown are randomly picked from each bin (no cherry picking). The estimated yaw values capture the correct tendency (right facing to left facing), and in most cases appear to be close to the actual yaw degree.
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
Figure 30: Starting from a pretrained StyleGAN2 model for FFHQ $1 0 2 4 \times 1 0 2 4$ resolution as parent, we use its weights to initialize models for $5 1 2 \times 5 1 2$ or $2 5 6 \times 2 5 6$ resolution. Before fine tuning (FT), it only generates low contrast images. After fine tuning (“Original” column), similar images with the same attributes (identity, hair length, gender, etc.) as parent model are generated given the same code $z \in { \mathcal { Z } }$ . Note that the generated images are not pixel-wise identical, but the different style channels retain their semantic function, as demonstrated by the four rightmost columns.
|
| 448 |
+
|
| 449 |
+

|
| 450 |
+
Figure 31: A comparison between layer swapping and model weight interpolation. We demonstrate transitioning between FFHQ and Mega using three different ways. Layer swapping: $A B$ means using a hybrid model whose low resolution layers come from model A, and high resolution layers from model B, while Layer swapping: $B A$ means the opposite roles (low from B, high from A). The resolution at which the switching occurs is shown above each result. The swapping resolution used by Toonify (Pinkney & Adler, 2020) is either $1 6 \times 1 6$ or $3 2 \times 3 2$ . Weight interpolation instead linearly interpolates the weights of all layers between model A and B. The interpolation ratio is shown shown above each result.
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
Figure 32: A comparison between layer swapping and model weight interpolation. Here we demonstrate transitioning between AFHQ dog and cat. Refer to Figure 31 for more details.
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
Figure 33: A comparison between layer swapping and model weight interpolation. Here we demonstrate transitioning between FFHQ and AFHQ dog. Refer to Figure 31 for more details.
|
| 457 |
+
|
| 458 |
+

|
| 459 |
+
Figure 34: Generative image translation from parent FFHQ model to child LSUN church model and grandchild FFHQ using the same latent code $z$ . Since the domain gap between FFHQ and LSUN church is too large, we can barely see any correspondence. But the parent FFHQ model and grandchild FFHQ models generate faces with highly similar attributes and identity. This implies that knowledge that was not transferred from task A (FFHQ generation) to task B (LSUN church generation), is only hidden in the latter model’s latent space, rather than forgotten.
|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
Figure 35: Applying the “Beard” and “Black hair” manipulation directions from parent FFHQ model to a child LSUN church model. The manipulation directions are discovered by StyleCLIP (Patashnik et al., 2021). Most manipulation directions from the FFHQ parent do not change anything in the child church model. Surprisingly, the beard direction from FFHQ appear to control the amount of trees in the church model to some extent, and the black hair direction from FFHQ makes the church building darker in the child model.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
Figure 36: Semantic alignment between parent and grandchild model. We first train a StyleGAN model on FFHQ (parent), then fine tune on LSUN church (child), and finally fine tune back to FFHQ (grandchild). We can see that the same channel still controls the same attribute between parent and grandchild model. Interestingly, channel 15 45 controls lipstick in the parent model, but makes the face slightly pink in the grandchild model. Although the exact function has changed after fine tuning, it is still semantically related to the original function.
|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
Figure 37: We demonstrate the ability of our method to perform I2I tasks that only change texture, while preserving the structure. Although this dataset has paired edge maps and shoe images, the pairing information is not used by our method. We slightly blur the edge maps to make the images more continuous. We first train a StyleGAN model on the shoes dataset (parent), then fine tune on edge maps dataset (child). Since edge maps mostly represent the structure of objects, and do not contain color or texture, we train an e4e encoder to $\mathcal { W } +$ from whose output we only use the parts that control generator resolutions below $3 2 \times 3 2$ (same as was done for multi-modal image translation). The parts that control higher-resolution layers are sampled, yielding multiple possible shoe images (sharing the same structure) for each edge map.
|
| 469 |
+
|
| 470 |
+
<table><tr><td></td><td>Mega</td><td>Metface</td><td>Dog</td><td>Cat</td><td>Wild</td><td>Unrelated FFHQ</td></tr><tr><td>L1 in W</td><td>0.033</td><td>0.057</td><td>0.162</td><td>0.172</td><td>0.141</td><td>0.391</td></tr></table>
|
| 471 |
+
|
| 472 |
+
Table 7: Average L1 distance between $w \in \mathcal { W }$ vectors mapped from the same latent code $z \in { \mathcal { Z } }$ for different pairs of models. Using a pretrained FFHQ model as parent, it is fine-tuned on different datasets separately. We sample 100K random $z$ vectors and compute the corresponding $w$ for each model. The mean change (per coordinate of $w$ ) is reported for each child model. It may be clearly seen that in models fine-tuned to nearby domains (Mega, Metface) the change in $w$ is much smaller than to more distant domains (Dog, Cat, Wild), and an order of magnitude smaller than the difference to another FFHQ model, trained independently. These results quantitatively demonstrate that the change in the mapping function is very small for similar domains, larger for more distant domains, but even for distant domains the mapping functions are more closely related than those of two separately trained models.
|
parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/Qg2vi4ZbHM9/Qg2vi4ZbHM9_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/URNZQmbxpwh/URNZQmbxpwh.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/URNZQmbxpwh/URNZQmbxpwh_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/URNZQmbxpwh/URNZQmbxpwh_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/URNZQmbxpwh/URNZQmbxpwh_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/akddwRG6EGi/akddwRG6EGi_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR
|
| 2 |
+
|
| 3 |
+
Shilong $\mathbf { L i u ^ { 1 , 2 * } }$ ∗, Feng $\mathbf { L i ^ { 2 , 3 } }$ , Hao Zhang2,3, Xiao Yang1,
|
| 4 |
+
Xianbiao $\mathbf { Q } \mathbf { i } ^ { 2 }$ , Hang $\mathbf { S u } ^ { 1 , 4 }$ , Jun $\mathbf { Z } \mathbf { h } \mathbf { u } ^ { 1 , 4 \dagger }$ , Lei Zhang2†
|
| 5 |
+
1Dept. of Comp. Sci. and Tech., BNRist Center, State Key Lab for Intell. Tech. & Sys., Institute for AI, Tsinghua-Bosch Joint Center for ML, Tsinghua University. 2International Digital Economy Academy (IDEA).
|
| 6 |
+
3Hong Kong University of Science and Technology.
|
| 7 |
+
4Peng Cheng Laboratory, Shenzhen, Guangdong, China.
|
| 8 |
+
{liusl20,yangxiao19}@mails.tsinghua.edu.cn
|
| 9 |
+
{fliay,hzhangcx}@connect.ust.hk
|
| 10 |
+
{qixianbiao,leizhang}@idea.edu.cn
|
| 11 |
+
{suhangss,dcszj}@mail.tsinghua.edu.cn
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We present in this paper a novel query formulation using dynamic anchor boxes for DETR (DEtection TRansformer) and offer a deeper understanding of the role of queries in DETR. This new formulation directly uses box coordinates as queries in Transformer decoders and dynamically updates them layer by layer. Using box coordinates not only helps using explicit positional priors to improve the queryto-feature similarity and eliminate the slow training convergence issue in DETR, but also allows us to modulate the positional attention map using the box width and height information. Such a design makes it clear that queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade manner. As a result, it leads to the best performance on MS-COCO benchmark among the DETR-like detection models under the same setting, e.g., AP $4 5 . 7 \%$ using ResNet50-DC5 as backbone trained in 50 epochs. We also conducted extensive experiments to confirm our analysis and verify the effectiveness of our methods. Code is available at https://github.com/IDEA-opensource/ DAB-DETR.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Object detection is a fundamental task in computer vision of wide applications. Most classical detectors are based on convolutional architectures which have made remarkable progress in the last decade (Ren et al., 2017; Girshick, 2015; Redmon et al., 2016; Bochkovskiy et al., 2020; Ge et al., 2021). Recently, Carion et al. (2020) proposed a Transformer-based end-to-end detector named DETR (DEtection TRansformer), which eliminates the need for hand-designed components, e.g., anchors, and shows promising performance compared with modern anchor-based detectors such as Faster RCNN (Ren et al., 2017).
|
| 20 |
+
|
| 21 |
+
In contrast to anchor-based detectors, DETR models object detection as a set prediction problem and uses 100 learnable queries to probe and pool features from images, which makes predictions without the need of using non-maximum suppression. However, due to its ineffective design and use of queries, DETR suffers from significantly slow training convergence, usually requiring 500 epochs to achieve a good performance. To address this issue, many follow-up works attempted to improve the design of DETR queries for both faster training convergence and better performance (Zhu et al., 2021; Gao et al., 2021; Meng et al., 2021; Wang et al., 2021).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Comparison of DETR, Conditional DETR, and our proposed DAB-DETR. For clarity, we only show the cross-attention part in the Transformer decoder. (a) DETR uses the learnable queries for all the layers without any adaptation, which accounts for its slow training convergence. (b) Conditional DETR adapts the learnable queries for each layer mainly to provide a better reference query point to pool features from the image feature map. In contrast, (c) DAB-DETR directly uses dynamically updated anchor boxes to provide both a reference query point $( x , y )$ and a reference anchor size $( w , h )$ to improve the cross-attention computation. We marked the modules with difference in purple.
|
| 25 |
+
|
| 26 |
+
Despite all the progress, the role of the learned queries in DETR is still not fully understood or utilized. While most previous attempts make each query in DETR more explicitly associated with one specific spatial position rather than multiple positions , the technical solutions are largely different. For example, Conditional DETR learns a conditional spatial query by adapting a query based on its content feature for better matching with image features (Meng et al., 2021). Efficient DETR introduces a dense prediction module to select top-K object queries (Yao et al., 2021) and Anchor DETR formulates queries as 2D anchor points (Wang et al., 2021), both associating each query with a specific spatial position. Similarly, Deformable DETR directly treats 2D reference points as queries and performs deformable cross-attention operation at each reference points (Zhu et al., 2021). But all the above works only leverage 2D positions as anchor points without considering the object scales.
|
| 27 |
+
|
| 28 |
+
Motivated by these studies, we take a closer look at the cross-attention module in Transformer decoder and propose to use anchor boxes, i.e., 4D box coordinates $( x , y , w , h )$ , as queries in DETR and update them layer by layer. This new query formulation introduce better spatial priors for the cross-attention module by considering both the position and size of each anchor box, which also leads to a much simpler implementation and a deeper understanding of the role of queries in DETR.
|
| 29 |
+
|
| 30 |
+
The key insight behind this formulation is that each query in DETR is formed by two parts: a content part (decoder self-attention output) and a positional part (e.g., learnable queries in DETR) 1. The cross-attention weights are computed by comparing a query with a set of keys which consists of two parts as a content part (encoded image feature) and a positional part (positional embedding). Thus, queries in Transformer decoder can be interpreted as pooling features from a feature map based on the query-to-feature similarity measure, which considers both the content and positional information. While the content similarity is for pooling semantically related features, the positional similarity is to provide a positional constraint for pooling features around the query position. This attention computing mechanism motivates us to formulate queries as anchor boxes as illustrated in Fig. 1 (c), allowing us to use the center position $( x , y )$ of an anchor box to pool features around the center and use the anchor box size $( w , h )$ to modulate the cross-attention map, adapting it to anchor box size. In addition, because of the use of coordinates as queries, anchor boxes can be updated layer by layer dynamically. In this way, queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade way.
|
| 31 |
+
|
| 32 |
+
We provide a better positional prior for pooling features by using anchor box size to modulate the cross-attention. Because the cross-attention can pool features from the whole feature map, it is crucial to provide a proper positional prior for each query to let the cross-attention module focus on a local region corresponding to a target object. It can also facilitate to speed up the training convergence of DETR. Most prior works improve DETR by associating each query with a specific location, but they assume an isotropic Gaussian positional prior of a fixed size(Fig. 4 (b)), which is inappropriate for objects of different scales. With the size information $( w , h )$ available in each query anchor box, we can modulate the Gaussian positional prior as an oval shape. More specifically, we divide the width and height from the cross-attention weight (before softmax) for its $x$ part and $y$ part separately, which helps the Gaussian prior to better match with objects of different scales(Fig. 4 (c)). To further improve the positional prior, we also introduce a temperature parameter to tune the flatness of positional attention, which has been overlooked in all prior works.
|
| 33 |
+
|
| 34 |
+
In summary, our proposed DAB-DETR (Dynamic Anchor Box DETR) presents a novel query formulation by directly learning anchors as queries. This formulation offers a deeper understanding of the role of queries, allowing us to use anchor size to modulate the positional cross-attention map in Transformer decoders and perform dynamic anchor update layer by layer. Our results demonstrate that DAB-DETR attains the best performance among DETR-like architectures under the same setting on the COCO object detection benchmark. The proposed method can achieve $4 5 . 7 \%$ AP when using a single ResNet-50 (He et al., 2016) model as backbone for training 50 epochs. We also conducted extensive experiments to confirm our analysis and verify the effectiveness of our methods.
|
| 35 |
+
|
| 36 |
+
# 2 RELATED WORK
|
| 37 |
+
|
| 38 |
+
Most classical detectors are anchor-based, using either anchor boxes (Ren et al., 2017; Girshick, 2015; Sun et al., 2021) or anchor points (Tian et al., 2019; Zhou et al., 2019). In contrast, DETR (Carion et al., 2020) is a fully anchor-free detector using a set of learnable vectors as queries. Many follow-up works attempted to solve the slow convergence of DETR from different perspectives. Sun et al. (2020) pointed out that the cause of slow training of DETR is due to the crossattention in decoders and hence proposed an encoder-only model. Gao et al. (2021) instead introduced a Gaussian prior to regulate the cross-attention. Despite their improved performance, they did not give a proper explanation of the slow training and the roles of queries in DETR.
|
| 39 |
+
|
| 40 |
+
Another direction to improve DETR, which is more relevant to our work, is towards a deeper understanding of the role of queries in DETR. As the learnable queries in DETR are used to provide positional constraints for feature pooling, most related works attempted to make each query in DETR more explicitly related to a specific spatial position rather than multiple position modes in the vanilla DETR. For example, Deformable DETR (Zhu et al., 2021) directly treats 2D reference points as queries and predicts deformable sampling points for each reference point to perform the deformable cross-attention operation. Conditional DETR (Meng et al., 2021) decouples the attention formulation and generates positional queries based on reference coordinates. Efficient DETR (Yao et al., 2021) introduces a dense prediction module to select top-K positions as object queries. Although these works connect queries with positional information, they do not have an explicit formulation to use anchors.
|
| 41 |
+
|
| 42 |
+
Different from the hypothesis in prior works that the learnable query vectors contain box coordinate information, our approach is based on a new perspective that all information contained in queries are box coordinates. That is, anchor boxes are better queries for DETR. A concurrent work Anchor DETR (Wang et al., 2021) also suggests learning anchor points directly, while it ignores the anchor width and height information as in other prior works. Besides DETR, Sun et al. (2021) proposed a sparse detector by learning boxes directly, which shares a similar anchor formulation with us, but it discards the Transformer structure and leverages hard ROI align for feature extraction. Table 1 summarizes the key differences between related works and our proposed DAB-DETR. We compare our model with related works on five dimensions: if the model directly learns anchors, if the model predicts reference coordinates (in its intermediate stage), if the model updates the reference anchors layer by layer, if the model uses the standard dense cross-attention, if the attention is modulated to better match with objects of different scales, and if the model updates the learned queries layer by layer. A more detailed comparison of DETR-like models is available in Sec. B of Appendix. We recommend this section for readers who have confusions about the table.
|
| 43 |
+
|
| 44 |
+
<table><tr><td>Models</td><td>Learn Anchors?</td><td>Reference Anchors</td><td>Dynamic Anchors</td><td>Standard Attention</td><td>Size-Modulated Attention</td><td>Update Learned Spatial Queries?</td></tr><tr><td>DETR</td><td>No</td><td>No</td><td></td><td>√</td><td></td><td></td></tr><tr><td>Deformable DETR</td><td>No</td><td>4D</td><td>√</td><td></td><td>√</td><td></td></tr><tr><td>SMCA</td><td>No</td><td>4D</td><td></td><td>√</td><td>√</td><td></td></tr><tr><td>Conditional DETR</td><td>No</td><td>2D</td><td></td><td>√</td><td></td><td></td></tr><tr><td>Anchor DETR</td><td>2D</td><td>2D</td><td>√</td><td></td><td></td><td></td></tr><tr><td>Sparse RCNN</td><td>4D</td><td>4D</td><td>√</td><td></td><td></td><td></td></tr><tr><td>DAB-DETR</td><td>4D</td><td>4D</td><td>√</td><td>√</td><td></td><td></td></tr></table>
|
| 45 |
+
|
| 46 |
+
Table 1: Comparison of representative related models and our DAB-DETR. The term “Learn Anchors?” asks if the model learns 2D points or 4D anchors as learnable parameters directly. The term ”Reference Anchors” means if the model predicts relative coordinates with respect to a reference points/anchors. The term “Dynamic Anchors” indicates if the model updates its anchors layer-by-layer. The term “Standard Attention” shows whether the model leverages the standard dense attention in cross-attention modules. The term “Object Scale-Modulated Attention” means if the attention is modulated to better match with object scales. The term “Size-Modulated Attention” means if the attention is modulated to better match with object scales. The term “Update Spatial Learned Queries?” means if the learned queries are updated layer by layer. Note that Sparse RCNN is not a DETR-like architecture. we list it here for their similar anchor formulation with us. See Sec. B of Appendix for a more detailed comparison of these models.
|
| 47 |
+
|
| 48 |
+
# 3 WHY A POSITIONAL PRIOR COULD SPEEDUP TRAINING?
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Comparison of self-attention in encoders and cross-attention in decoders of DETR. As they have the same key and value components, the only difference comes from the queries. Each query in an encoder is composed of an image feature (content information) and a positional embedding (positional information), whereas each query in a decoder is composed of a decoder embedding (content information) and a learnable query (postional information). The differences between two modules are marked in purple.
|
| 52 |
+
|
| 53 |
+
Much work has been done to accelerate the training convergence speed of DETR, while lacking a unified understanding of why their methods work. Sun et al. (2020) showed that the cross-attention module is mainly responsible for the slow convergence, but they simply removed the decoders for faster training. We follow their analysis to find which sub-module in the cross-attention affects the performance. Comparing the self-attention module in encoders with the cross-attention module in decoders, we find the key difference between their inputs comes from the queries, as shown in Fig. 2. As the decoder embeddings are initialized as 0, they are projected to the same space as the image features after the first cross-attention module. After that, they will go through a similar process in decoder layers as the image features in encoder layers. Hence the root cause is likely due to the learnable queries.
|
| 54 |
+
|
| 55 |
+
Two possible reasons in cross-attention account for the model’s slow training convergence: 1) it is hard to learn the queries due to the optimization challenge, and 2) the positional information in the learned queries is not encoded in the same way as the sinusoidal positional encoding used for image features. To see if it is the first reason, we reuse the well-learned queries from DETR (keep them fixed) and only train the other modules. The training curves in Fig. 3(a) show that the fixed queries only slightly improve the convergence in very early epochs, e.g., the first 25 epochs. Hence the query learning (or optimization) is likely not the key concern.
|
| 56 |
+
|
| 57 |
+
Then we turn to the second possibility and try to find out if the learned queries have some undesirable properties. As the learned queries are used to filter objects in certain regions, we visualize a few positional attention maps between the learned queries and the positional embeddings of image features in Fig. 4(a). Each query can be regarded as a positional prior to let decoders focus on a region of interest. Although they serve as a positional constraint, they also carry undesirable properties: multiple modes and nearly uniform attention weights. For example, the two attention maps at the top of Fig. 4(a) have two or more concentration centers, making it hard to locate objects when multiple objects exist in an image. The bottom maps of Fig. 4(a) focus on areas that are either too large or too small, and hence cannot inject useful positional information into the procedure of feature extraction. We conjecture that the multiple mode property of queries in DETR is likely the root cause for its slow training and we believe introducing explicit positional priors to constrain queries on a local region is desirable for training. To verify this assumption, we replace the query formulation in DETR with dynamic anchor boxes, which can enforce each query to focus on a specific area, and name this model DETR $+$ DAB. The training curves in Fig. 3(b) show that DETR $+$ DAB leads to much better performance compared with DETR, in terms of both detection AP and training/testing loss. Note that the only difference between DETR and DETR $^ +$ DAB is the formulation of queries and no other techniques like 300 queries or focal loss are introduced. It shows that after addressing the multi-mode issue of DETR queries, we can achieve both a faster training convergence and a higher detection accuracy.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 3: a): Training curves of the original DETR and DETR with fixed queries. b): Training curves of the original DETR and DETR $^ +$ DAB. We run each experiment 3 times and plot the mean value and the $9 5 \%$ confidence interval of each item.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 4: We visualize the positional attention between positional queries and positional keys for DETR, Conditional DETR, and our proposed DAB-DETR. Four attention maps in (a) are randomly sampled, and we select figures with similar query positions as in (a) for (b) and (c). The darker the color, the greater the attention weight, and vice versa. (a) Each attention map in DETR is calculated by performing dot product between a learned query and positional embeddings from a feature map, and can have multiple modes and unconcentrated attentions. (b) The positional queries in Conditional DETR are encoded in the same way as the image positional embeddings, resulting in Gaussian-like attention maps. However, it cannot adapt to objects of different scales. (c) DABDETR explicitly modulates the attention map using the width and height information of an anchor, making it more adaptive to object size and shape. The modulated attentions can be regarded as helping perform soft ROI pooling.
|
| 64 |
+
|
| 65 |
+
Some previous works also have similar analyses and confirmed this. For example, SMCA (Gao et al., 2021) speeds up the training by applying pre-defined Gaussian maps around reference points. Conditional DETR (Meng et al., 2021) uses explicit positional embedding as positional queries for training, yielding attention maps similar to Gaussian kernels as shown in Fig. 4(b). Although explicit positional priors lead to good performance in training, they ignore the scale information of an object. In contrast, our proposed DAB-DETR explicitly takes into account the object scale information to adaptively adjust attention weights, as shown in Fig. 4(c).
|
| 66 |
+
|
| 67 |
+
# 4 DAB-DETR
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 5: Framework of our proposed DAB-DETR.
|
| 71 |
+
|
| 72 |
+
# 4.1 OVERVIEW
|
| 73 |
+
|
| 74 |
+
Following DETR (Carion et al., 2020), our model is an end-to-end object detector which includes a CNN backbone, Transformer (Vaswani et al., 2017) encoders and decoders, and prediction heads for boxes and labels. We mainly improve the decoder part, as shown in Fig. 5.
|
| 75 |
+
|
| 76 |
+
Given an image, we extract image spatial features using a CNN backbone followed with Transformer encoders to refine the CNN features. Then dual queries, including positional queries (anchor boxes) and content queries (decoder embeddings), are fed into the decoder to probe the objects which correspond to the anchors and have similar patterns with the content queries. The dual queries are updated layer by layer to get close to the target ground-truth objects gradually. The outputs of the final decoder layer are used to predict the objects with labels and boxes by prediction heads, and then a bipartite graph matching is conducted to calculate loss as in DETR.
|
| 77 |
+
|
| 78 |
+
To illustrate the generality of our dynamic anchor boxes, we also design a stronger DABDeformable-DETR, which is available in Appendix.
|
| 79 |
+
|
| 80 |
+
# 4.2 LEARNING ANCHOR BOXES DIRECTLY
|
| 81 |
+
|
| 82 |
+
As discussed in Sec. 1 regarding the role of queries in DETR, we propose to directly learn query boxes or say anchor boxes and derive positional queries from these anchors. There are two attention modules in each decoder layer, including a self-attention module and a cross-attention module, which are used for query updating and feature probing, respectively. Each module needs queries, keys, and values to perform attention-based value aggregation, yet the inputs of these triplets differ.
|
| 83 |
+
|
| 84 |
+
We denote $A _ { q } = ( x _ { q } , y _ { q } , w _ { q } , h _ { q } )$ as the $q$ -th anchor, $x _ { q } , y _ { q } , w _ { q } , h _ { q } \in \mathbb { R }$ , and $C _ { q } \in \mathbb { R } ^ { D }$ and $P _ { q } \in$ $\mathbb { R } ^ { D }$ as its corresponding content query and positional query, where $D$ is the dimension of decoder embeddings and positional queries.
|
| 85 |
+
|
| 86 |
+
Given an anchor $A _ { q }$ , its positional query $P _ { q }$ is generated by:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
P _ { q } = \mathbf { M L P } ( \mathbf { P E } ( A _ { q } ) ) ,
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where PE means positional encoding to generate sinusoidal embeddings from float numbers and the parameters of MLP are shared across all layers. As $A _ { q }$ is a quaternion, we overload the PE operator here:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathrm { P E } ( A _ { q } ) = \mathrm { P E } ( x _ { q } , y _ { q } , w _ { q } , h _ { q } ) = \mathrm { C a t } ( \mathrm { P E } ( x _ { q } ) , \mathrm { P E } ( y _ { q } ) , \mathrm { P E } ( w _ { q } ) , \mathrm { P E } ( h _ { q } ) ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The notion Cat means concatenation function. In our implementations, the positional encoding function PE maps a float to a vector with $D / 2$ dimensions as: PE: $\mathbb { R } \mathbb { R } ^ { D / 2 }$ . Hence the function MLP projects a $2 D$ dimensional vector into $D$ dimensions: MLP: $\mathbb { R } ^ { 2 D } \to \mathbb { R } ^ { D }$ . The MLP module has two submodules, each of which is composed of a linear layer and a ReLU activation, and the feature reduction is conducted at the first linear layer.
|
| 99 |
+
|
| 100 |
+
In the self-attention module, all three of queries, keys, and values have the same content items, while the queries and keys contain extra position items:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathrm { S e l f - A t t n : } \quad Q _ { q } = C _ { q } + P _ { q } , \quad K _ { q } = C _ { q } + P _ { q } , \quad V _ { q } = C _ { q } ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Inspired by Conditional DETR (Meng et al., 2021), we concatenate the position and content information together as queries and keys in the cross-attention module, so that we can decouple the content and position contributions to the query-to-feature similarity computed as the dot product between a query and a key. To rescale the positional embeddings, we leverage the conditional spatial query (Meng et al., 2021) as well. More specifically, we learn a $\mathbf { M L P } ^ { ( \mathrm { c s q } ) } : \mathbb { R } ^ { D } \mathbb { R } ^ { D }$ to obtain a scale vector conditional on the content information and use it perform element-wise multiplication with the positional embeddings:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r l } { \mathrm { C r o s s \mathrm { - } A t t n : } \quad } & { Q _ { q } = \mathrm { C a t } ( C _ { q } , \mathrm { P E } ( x _ { q } , y _ { q } ) \cdot \mathrm { M L P } ^ { ( \mathrm { c s q } ) } ( C _ { q } ) ) , } \\ & { K _ { x , y } = \mathrm { C a t } ( F _ { x , y } , \mathrm { P E } ( x , y ) ) , \quad V _ { x , y } = F _ { x , y } , } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $F _ { x , y } \in \mathbb { R } ^ { D }$ is the image feature at position $( x , y )$ and $\cdot$ is an element-wise multiplication. Both the positional embeddings in queries and keys are generated based on 2D coordinates, making it more consistent to compare the positional similarity, as in previous works (Meng et al., 2021; Wang et al., 2021).
|
| 113 |
+
|
| 114 |
+
# 4.3 ANCHOR UPDATE
|
| 115 |
+
|
| 116 |
+
Using coordinates as queries for learning makes it possible to update them layer by layer. In contrast, for queries of high dimensional embeddings, such as in DETR (Carion et al., 2020) and Conditional DETR (Meng et al., 2021), it is hard to perform layer-by-layer query refinement, because it is unclear how to convert an updated anchor back to a high-dimensional query embedding.
|
| 117 |
+
|
| 118 |
+
Following the previous practice (Zhu et al., 2021; Wang et al., 2021), we update anchors in each layer after predicting relative positions $( \Delta x , \Delta y , \Delta w , \Delta h )$ by a prediction head, as shown in Fig. 5. Note that all prediction heads in different layers share the same parameters.
|
| 119 |
+
|
| 120 |
+
# 4.4 WIDTH & HEIGHT-MODULATED GAUSSIAN KERNEL
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 6: Positional attention maps modulated by width and height.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 7: Positional attention maps with different temperatures.
|
| 127 |
+
|
| 128 |
+
Traditional positional attention maps are used as a Gaussian-like prior, as shown in Fig. 6 left. But the prior is simply assumed isotropic and fixed size for all objects, leaving their scale information (width and height) ignored. To improve the positional prior, we propose to inject the scale information into the attention maps.
|
| 129 |
+
|
| 130 |
+
The query-to-key similarity in the original positional attention map is computed as the sum of dot products of two coordinate encodings:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
{ \mathrm { A t t n } } ( ( x , y ) , ( x _ { \mathrm { r e f } } , y _ { \mathrm { r e f } } ) ) = ( { \mathrm { P E } } ( x ) \cdot { \mathrm { P E } } ( x _ { \mathrm { r e f } } ) + { \mathrm { P E } } ( y ) \cdot { \mathrm { P E } } ( y _ { \mathrm { r e f } } ) ) / { \sqrt { D } } ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $1 / \sqrt { D }$ is used to rescale the value as suggested in Vaswani et al. (2017). We modulate the positional attention maps (before softmax) by dividing the relative anchor width and height from its $x$ part and $y$ part separately to smooth the Gaussian prior to better match with objects of different scales:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
{ \bf M o d u l a t e A t t m } ( ( x , y ) , ( x _ { \mathrm { r e f } } , y _ { \mathrm { r e f } } ) ) = ( { \bf P E } ( x ) \cdot { \bf P E } ( x _ { \mathrm { r e f } } ) \frac { w _ { q , \mathrm { r e f } } } { w _ { q } } + { \bf P E } ( y ) \cdot { \bf P E } ( y _ { \mathrm { r e f } } ) \frac { h _ { q , \mathrm { r e f } } } { h _ { q } } ) / \sqrt { D } ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $w _ { q }$ and $h _ { q }$ are the width and height of the anchor $A _ { q }$ , and $w _ { q , \mathrm { r e f } }$ and $h _ { q , \mathrm { r e f } }$ are the reference width and height that are calculated by:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
w _ { q , \mathrm { r e f } } , h _ { q , \mathrm { r e f } } = \sigma ( \mathbf { M L P } ( C _ { q } ) ) .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
This modulated positional attention helps us extract features of objects with different widths and heights, and the visualizations of modulated attentions are shown in Fig. 6.
|
| 149 |
+
|
| 150 |
+
# 4.5 TEMPERATURE TUNING
|
| 151 |
+
|
| 152 |
+
For position encoding, we use the sinusoidal function (Vaswani et al., 2017), which is defined as:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\mathrm { P E } ( x ) _ { 2 i } = \sin ( \frac { x } { T ^ { 2 i / D } } ) , \quad \mathrm { P E } ( x ) _ { 2 i + 1 } = \cos ( \frac { x } { T ^ { 2 i / D } } ) ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
where $T$ is a hand-design temperature, and the superscript $2 i$ and $2 i + 1$ denote the indices in the encoded vectors. The temperature $T$ in Eq. (8) influences the size of positional priors, as shown in Fig. 7. A larger $T$ results in a more flattened attention map, and vice versa. Note that the temperature $T$ is hard-coded in (Vaswani et al., 2017) as 10000 for natural language processing, in which the values of $x$ are integers representing each word’s position in a sentence. However, in DETR, the values of $x$ are floats between 0 and 1 representing bounding box coordinates. Hence a different temperature is highly desired for vision tasks. In this work, we empirically choose $T = 2 0$ in all our models.
|
| 159 |
+
|
| 160 |
+
# 5 EXPERIMENTS
|
| 161 |
+
|
| 162 |
+
We provide the training details in Appendix A.
|
| 163 |
+
|
| 164 |
+
# 5.1 MAIN RESULTS
|
| 165 |
+
|
| 166 |
+
Table 2 shows our main results on the COCO 2017 validation set. We compare our proposed DABDETR with DETR (Carion et al., 2020), Faster RCNN (Ren et al., 2017), Anchor DETR (Wang et al., 2021), SMCA (Gao et al., 2021), Deformable DETR (Zhu et al., 2021), TSP (Sun et al., 2020), and Conditional DETR (Meng et al., 2021). We showed two variations of our model: standard models and models marked with superscript ∗ that have 3 pattern embeddings (Wang et al., 2021). Our standard models outperform Conditional DETR with a large margin. We notice that our model introduces a slight increase of GFLOPs. GFLOPs may differ depending on the calculation scripts and we use the results reported by the authors in Table 2. Actually, we find in our tests that the GFLOPs of our standard models are nearly the same as the corresponding Conditional DETR models based on our GFLOPs calculation scripts, hence our model still has advantages over previous work under the same settings. When using pattern embeddings, our DAB-DETR with ∗ outperforms previous DETR-like methods on all four backbones with a large margin, even better than multiscale architectures. It verifies the correctness of our analysis and the effectiveness of our design.
|
| 167 |
+
|
| 168 |
+
# 5.2 ABLATIONS
|
| 169 |
+
|
| 170 |
+
Table 3 shows the effectiveness of each component in our model. We find that all modules we proposed contribute remarkably to our final results. The anchor box formulation improves the performance from $4 4 . 0 \%$ AP to $4 \dot { 5 } . 0 \%$ AP compared with the anchor point formulation (compare Row
|
| 171 |
+
|
| 172 |
+
Table 2: Results for our DAB-DETR and other detection models. All DETR-like models except DETR use 300 queries, while DETR uses 100. The models with superscript ∗ use 3 pattern embeddings as in Anchor DETR (Wang et al., 2021). We also provide stronger results of our DAB-DETR in Appendix G and Appendix C.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Model</td><td>MultiScale</td><td>#epochs</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>GFLOPs</td><td>Params</td></tr><tr><td>DETR-R50</td><td></td><td>500</td><td>42.0</td><td>62.4</td><td>44.2</td><td>20.5</td><td>45.8</td><td>61.1</td><td>86</td><td>41M</td></tr><tr><td>Faster RCNN-FPN-R50</td><td></td><td>108</td><td>42.0</td><td>62.1</td><td>45.5</td><td>26.6</td><td>45.5</td><td>53.4</td><td>180</td><td>42M</td></tr><tr><td>Anchor DETR-R50*</td><td></td><td>50</td><td>42.1</td><td>63.1</td><td>44.9</td><td>22.3</td><td>46.2</td><td>60.0</td><td>1</td><td>39M</td></tr><tr><td>Conditional DETR-R50</td><td></td><td>50</td><td>40.9</td><td>61.8</td><td>43.3</td><td>20.8</td><td>44.6</td><td>59.2</td><td>90</td><td>44M</td></tr><tr><td>DAB-DETR-R50</td><td></td><td>50</td><td>42.2</td><td>63.1</td><td>44.7</td><td>21.5</td><td>45.7</td><td>60.3</td><td>94</td><td>44M</td></tr><tr><td>DAB-DETR-R50*</td><td></td><td>50</td><td>42.6</td><td>63.2</td><td>45.6</td><td>21.8</td><td>46.2</td><td>61.1</td><td>100</td><td>44M</td></tr><tr><td>DETR-DC5-R50</td><td></td><td>500</td><td>43.3</td><td>63.1</td><td>45.9</td><td>22.5</td><td>47.3</td><td>61.1</td><td>187</td><td>41M</td></tr><tr><td>Deformable DETR-R50</td><td>√</td><td>50</td><td>43.8</td><td>62.6</td><td>47.7</td><td>26.4</td><td>47.1</td><td>58.0</td><td>173</td><td>40M</td></tr><tr><td>SMCA-R50</td><td>√</td><td>50</td><td>43.7</td><td>63.6</td><td>47.2</td><td>24.2</td><td>47.0</td><td>60.4</td><td>152</td><td>40M</td></tr><tr><td>TSP-RCNN-R50</td><td>√</td><td>96</td><td>45.0</td><td>64.5</td><td>49.6</td><td>29.7</td><td>47.7</td><td>58.0</td><td>188</td><td>1</td></tr><tr><td>Anchor DETR-DC5-R50*</td><td></td><td>50</td><td>44.2</td><td>64.7</td><td>47.5</td><td>24.7</td><td>48.2</td><td>60.6</td><td>151</td><td>39M</td></tr><tr><td>Conditional DETR-DC5-R50</td><td></td><td>50</td><td>43.8</td><td>64.4</td><td>46.7</td><td>24.0</td><td>47.6</td><td>60.7</td><td>195</td><td>44M</td></tr><tr><td>DAB-DETR-DC5-R50</td><td></td><td>50</td><td>44.5</td><td>65.1</td><td>47.7</td><td>25.3</td><td>48.2</td><td>62.3</td><td>202</td><td>44M</td></tr><tr><td>DAB-DETR-DC5-R50*</td><td></td><td>50</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td><td>216</td><td>44M</td></tr><tr><td>DETR-R101</td><td></td><td>500</td><td>43.5</td><td>63.8</td><td>46.4</td><td>21.9</td><td>48.0</td><td>61.8</td><td>152</td><td>60M</td></tr><tr><td>Faster RCNN-FPN-R101</td><td></td><td>108</td><td>44.0</td><td>63.9</td><td>47.8</td><td>27.2</td><td>48.1</td><td>56.0</td><td>246</td><td>60M</td></tr><tr><td>Anchor DETR-R101*</td><td></td><td>50</td><td>43.5</td><td>64.3</td><td>46.6</td><td>23.2</td><td>47.7</td><td>61.4</td><td>1</td><td>58M</td></tr><tr><td>Conditional DETR-R101</td><td></td><td>50</td><td>42.8</td><td>63.7</td><td>46.0</td><td>21.7</td><td>46.6</td><td>60.9</td><td>156</td><td>63M</td></tr><tr><td>DAB-DETR-R101</td><td></td><td>50</td><td>43.5</td><td>63.9</td><td>46.6</td><td>23.6</td><td>47.3</td><td>61.5</td><td>174</td><td>63M</td></tr><tr><td>DAB-DETR-R101*</td><td></td><td>50</td><td>44.1</td><td>64.7</td><td>47.2</td><td>24.1</td><td>48.2</td><td>62.9</td><td>179</td><td>63M</td></tr><tr><td>DETR-DC5-R101</td><td></td><td>500</td><td>44.9</td><td>64.7</td><td>47.7</td><td>23.7</td><td>49.5</td><td>62.3</td><td>253</td><td>60M</td></tr><tr><td>TSP-RCNN-R101</td><td>√</td><td>96</td><td>46.5</td><td>66.0</td><td>51.2</td><td>29.9</td><td>49.7</td><td>59.2</td><td>254</td><td>1</td></tr><tr><td>SMCA-R101</td><td>√</td><td>50</td><td>44.4</td><td>65.2</td><td>48.0</td><td>24.3</td><td>48.5</td><td>61.0</td><td>218</td><td>50M</td></tr><tr><td>Anchor DETR-R101*</td><td></td><td>50</td><td>45.1</td><td>65.7</td><td>48.8</td><td>25.8</td><td>49.4</td><td>61.6</td><td>1</td><td>58M</td></tr><tr><td>Conditional DETR-DC5-R101</td><td></td><td>50</td><td>45.0</td><td>65.5</td><td>48.4</td><td>26.1</td><td>48.9</td><td>62.8</td><td>262</td><td>63M</td></tr><tr><td>DAB-DETR-DC5-R101</td><td></td><td>50</td><td>45.8</td><td>65.9</td><td>49.3</td><td>27.0</td><td>49.8</td><td>63.8</td><td>282</td><td>63M</td></tr><tr><td>DAB-DETR-DC5-R101*</td><td></td><td>50</td><td>46.6</td><td>67.0</td><td>50.2</td><td>28.1</td><td>50.5</td><td>64.1</td><td>296</td><td>63M</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Table 3: Ablation results for our DAB-DETR. All models are tested over ResNet-50-DC5 backbone and the other parameters are the same as our default settings.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>#RoW</td><td>Anchor Box (4D) vs.Point (2D)Anchor Updatewh-Modulated AttentionTemperature Tuning</td><td></td><td></td><td></td><td>AP</td></tr><tr><td>1</td><td>4D</td><td>√</td><td>√</td><td>√</td><td>45.7</td></tr><tr><td>2</td><td>4D</td><td></td><td>√</td><td>√</td><td>44.0</td></tr><tr><td>3</td><td>4D</td><td>√</td><td></td><td>√</td><td>45.0</td></tr><tr><td>4</td><td>2D</td><td>√</td><td></td><td>√</td><td>44.0</td></tr><tr><td>5</td><td>4D</td><td>√</td><td>√</td><td></td><td>44.4</td></tr></table>
|
| 179 |
+
|
| 180 |
+
3 and Row 4) and the anchor update introduces $1 . 7 \%$ AP improvement (compare Row 1 and Row
|
| 181 |
+
2), which demonstrates the effectiveness of dynamic anchor box design.
|
| 182 |
+
|
| 183 |
+
After removing modulated attention and temperature tuning, the model performance drops to $4 5 . 0 \%$ (compare Row 1 and Row 3) and $4 4 . 4 \%$ (compare Row 1 and Row 5), respectively. Hence finegrained tuning of positional attentions is of great importance for improving the detection performance as well.
|
| 184 |
+
|
| 185 |
+
# 6 CONCLUSION
|
| 186 |
+
|
| 187 |
+
We have presented in this paper a novel query formulation using dynamic anchor boxes for DETR and offered a deeper understanding of the role of queries in DETR. Using anchor boxes as queries leads to several advantages, including a better positional prior with temperature tuning, sizemodulated attention to account for objects of different scales, and iterative anchor update for improving anchor estimate gradually. Such a design makes it clear that queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade manner. Extensive experiments were conducted and effectively confirmed our analysis and verified our algorithm design.
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGEMENTS
|
| 190 |
+
|
| 191 |
+
This work was supported by the National Key Research and Development Program of China (2020AAA0104304, 2020AAA0106000, 2020AAA0106302), NSFC Projects (Nos. 61620106010, 62061136001, 61621136008, 62076147, U19B2034, U1811461, U19A2081), Beijing NSF Project (No. JQ19016), Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Alibaba Joint Research Program, Tsinghua Institute for Guo Qiang, Tsinghua-OPPO Joint Research Center for Future Terminal Technology.
|
| 192 |
+
|
| 193 |
+
We thank all anonymous reviewers for their valuable comments and suggestions, especially the instructive questions from Reviewer 3.
|
| 194 |
+
|
| 195 |
+
# ETHICS STATEMENT
|
| 196 |
+
|
| 197 |
+
Object detection is a fundamental task in computer vision with wide applications. Hence any improvement of this field will yield lots of impacts. To visually perceive and interact with the environment, autonomous vehicles highly depend on this technique and will benefit from any of its improvement. It has also led to advances in medical imaging, word recognition, instance segmentation on natural images, and so on. Therefore a failure in this model could affect many tasks. Our study provides a deeper understanding of the roles of queries in DETR and improves the interpretability of this important submodule in the end-to-end Transformer-based detection framework.
|
| 198 |
+
|
| 199 |
+
As our model relies on deep neural networks, it can be attacked by adversarial examples. Similarly, as it relies on training data, it may produce biased results induced from training samples. These are common problems in deep learning and our community is working together to improve them. Finally, it is worth noting that detection models, especially face or human detection models, might pose a threat to people’s privacy and security if used by someone up to no good.
|
| 200 |
+
|
| 201 |
+
# REPRODUCIBILITY STATEMENT
|
| 202 |
+
|
| 203 |
+
We confirm the reproducibility of the results. We have released the source code on Github at https://github.com/IDEA-opensource/DAB-DETR with all materials that are needed to reproduce our results.
|
| 204 |
+
|
| 205 |
+
# REFERENCES
|
| 206 |
+
|
| 207 |
+
Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020.
|
| 208 |
+
Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pp. 213–229. Springer, 2020.
|
| 209 |
+
Xiyang Dai, Yinpeng Chen, Jianwei Yang, Pengchuan Zhang, Lu Yuan, and Lei Zhang. Dynamic detr: End-to-end object detection with dynamic attention. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2988–2997, October 2021.
|
| 210 |
+
Peng Gao, Minghang Zheng, Xiaogang Wang, Jifeng Dai, and Hongsheng Li. Fast convergence of detr with spatially modulated co-attention. arXiv preprint arXiv:2101.07448, 2021.
|
| 211 |
+
Zheng Ge, Songtao Liu, Feng Wang, Zeming Li, and Jian Sun. Yolox: Exceeding yolo series in 2021. arXiv preprint arXiv:2107.08430, 2021.
|
| 212 |
+
Ross Girshick. Fast r-cnn. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1440–1448, 2015.
|
| 213 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1026–1034, 2015.
|
| 214 |
+
|
| 215 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 216 |
+
|
| 217 |
+
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.
|
| 218 |
+
|
| 219 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(2):318– 327, 2020.
|
| 220 |
+
|
| 221 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018.
|
| 222 |
+
|
| 223 |
+
Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, and Jingdong Wang. Conditional detr for fast training convergence. arXiv preprint arXiv:2108.06152, 2021.
|
| 224 |
+
|
| 225 |
+
Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788, 2016.
|
| 226 |
+
|
| 227 |
+
Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1137–1149, 2017.
|
| 228 |
+
|
| 229 |
+
Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 658–666, 2019.
|
| 230 |
+
|
| 231 |
+
Peize Sun, Rufeng Zhang, Yi Jiang, Tao Kong, Chenfeng Xu, Wei Zhan, Masayoshi Tomizuka, Lei Li, Zehuan Yuan, Changhu Wang, and Ping Luo. Sparse r-cnn: End-to-end object detection with learnable proposals. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14454–14463, 2021.
|
| 232 |
+
|
| 233 |
+
Zhiqing Sun, Shengcao Cao, Yiming Yang, and Kris Kitani. Rethinking transformer-based set prediction for object detection. arXiv preprint arXiv:2011.10881, 2020.
|
| 234 |
+
|
| 235 |
+
Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 9627– 9636, 2019.
|
| 236 |
+
|
| 237 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 238 |
+
|
| 239 |
+
Yingming Wang, Xiangyu Zhang, Tong Yang, and Jian Sun. Anchor detr: Query design for transformer-based detector. arXiv preprint arXiv:2109.07107, 2021.
|
| 240 |
+
|
| 241 |
+
Zhuyu Yao, Jiangbo Ai, Boxun Li, and Chi Zhang. Efficient detr: Improving end-to-end object detector with dense prior. arXiv preprint arXiv:2104.01318, 2021.
|
| 242 |
+
|
| 243 |
+
Xingyi Zhou, Dequan Wang, and Philipp Krahenb ¨ uhl. Objects as points. ¨ arXiv preprint arXiv:1904.07850, 2019.
|
| 244 |
+
|
| 245 |
+
Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In ICLR 2021: The Ninth International Conference on Learning Representations, 2021.
|
| 246 |
+
|
| 247 |
+
# Appendix for DAB-DETR
|
| 248 |
+
|
| 249 |
+
# A TRAINING DETAILS
|
| 250 |
+
|
| 251 |
+
Architecture. Our model is almost the same as DETR which includes a CNN backbone, multiple Transformer (Vaswani et al., 2017) encoders and decoders, and two prediction heads for boxes and labels. We use ImageNet-pretrained ResNet (He et al., 2016) as our backbones, and 6 Transformer encoders and 6 Transformer decoders in our implementations. We follow previous works to report results over four backbones: ResNet-50, ResNet-101, and their $1 6 \times$ -resolution extensions ResNet50-DC5 and ResNet-101-DC5. As we need to predict boxes and labels in each decoder layer, the MLP networks for box and label predictions share the same parameters across different decoder layers. As inspired by Anchor DETR, we also leverage multiple pattern embeddings to perform multiple predictions at one position and the number of patterns is set as 3 which is the same as Anchor DETR. We also leverage PReLU (He et al., 2015) as our activations.
|
| 252 |
+
|
| 253 |
+
Following Deformable DETR and Conditional DETR, we use 300 anchors as queries. We select 300 predicted boxes and labels with the largest classification logits for evaluation as well. We also use focal loss (Lin et al., 2020) with $\alpha = 0 . 2 5$ , $\gamma = 2$ for classification. The same loss terms are used in bipartite matching and final loss calculating, but with different coefficients. Classification loss with coefficient 2.0 is used in bipartite matching but 1.0 in the final loss. L1 loss with coefficient 5.0 and GIOU loss (Rezatofighi et al., 2019) with coefficient 2.0 are consistent in both the matching and the final loss calculation procedures. All models are trained on 16 GPUs with 1 image per GPU and AdamW (Loshchilov & Hutter, 2018) is used for training with weight decay $1 0 ^ { - 4 }$ . The learning rates for backbone and other modules are set to $1 0 ^ { - 5 }$ and $1 0 ^ { - 4 }$ , respectively. We train our models for 50 epochs and drop the learning rate by 0.1 after 40 epochs. All models are trained on Nvidia A100 GPU. We search hyperparameters with batch size 64 and all results in our paper are reported with batch size 16. For better reproducing our results, we provide the memory needed and batch size/GPU in Table 4.
|
| 254 |
+
|
| 255 |
+
Dataset. We conduct the experiments on the COCO (Lin et al., 2014) object detection dataset. All models are trained on the train2017 split and evaluated on the val2017 split.
|
| 256 |
+
|
| 257 |
+
Table 4: GPU memory usage of each model.
|
| 258 |
+
|
| 259 |
+
<table><tr><td>Model</td><td>Batch Size/GPU</td><td>GPUMemory (MB)</td></tr><tr><td>DAB-DETR-R50</td><td>2</td><td>6527</td></tr><tr><td>DAB-DETR-R50*</td><td>1</td><td>3573</td></tr><tr><td>DAB-DETR-R50-DC5</td><td>1</td><td>13745</td></tr><tr><td>DAB-DETR-R50-DC5*</td><td>1</td><td>15475</td></tr><tr><td>DAB-DETR-R101</td><td>2</td><td>6913</td></tr><tr><td>DAB-DETR-R101*</td><td>1</td><td>4369</td></tr><tr><td>DAB-DETR-R101-DC5</td><td>1</td><td>13148</td></tr><tr><td>DAB-DETR-R101-DC5*</td><td>1</td><td>16744</td></tr></table>
|
| 260 |
+
|
| 261 |
+
# B COMPARISON OF DETR-LIKE MODELS
|
| 262 |
+
|
| 263 |
+
In this section, we provide a more detailed comparison of DETR-like models, including DETR (Carion et al., 2020), Conditional DETR (Meng et al., 2021), Anchor DETR (Wang et al., 2021), Deformable DETR (Zhu et al., 2021), our proposed DAB-DETR, and DAB-Deformable-DETR. Their model designs are illustrated in Fig. 8. We will discuss the difference between previous models and our models.
|
| 264 |
+
|
| 265 |
+
Anchor DETR (Wang et al., 2021) improves DETR by introducing 2D anchor points, which are updated layer by layer. It shares a similar motivation with our work. But it leaves the object scale information unconsidered and thus cannot modulate the cross-attention to make it adapt to objects of different scales. Moreover, the positional queries in its framework are of high dimension and passed to the self-attention modules in all layers without any adaptation. See the brown-colored part in Fig. 8 (d) for details. This design might be sub-optimal as the self-attention modules cannot leverage the refined anchor points in different layers.
|
| 266 |
+
|
| 267 |
+
Deformable DETR (Zhu et al., 2021) introduces 4D anchor boxes and updates them layer by layer, which is called iterative bounding box refinement in its paper. Its algorithm is mainly developed based on deformable attention, which requires reference points to sample attention points and meanwhile utilizes box width and height to modulate attention areas. However, as iterative bounding box refinement is closely coupled with the special design of deformable attention, it is nontrivial to apply it to general Transformer decoder-based DETR models. This is probably the reason why few works after Deformable DETR adopt this idea. Moreover, the position queries in Deformable DETR are passed to both the self-attention modules and the cross-attention modules in all layers without any adaptation. See the brown-colored part in Fig. 8 (e) for details. As a result, both its self-attention modules and cross-attention modules cannot fully leverage the refined anchor boxes in different layers.
|
| 268 |
+
|
| 269 |
+
To verify our analysis, we develop a variant of Deformable-DETR by formulating its queries as dynamic anchor boxes as in DAB-DETR. We call this variant as DAB-Deformable-DETR, which is illustrated in Fig. 8 (f). Under exactly the same setting using R50 as the backbone, DABDeformable-DETR improves Deformable-DETR by 0.5 AP (46.3 to 46.8) on COCO. See Table 5 for the performance comparison and Sec. C for more implementation details.
|
| 270 |
+
|
| 271 |
+
Dynamic DETR (Dai et al., 2021) is another interesting improvement of DETR. It also leverages anchor boxes to pool features, but it uses ROI pooling for feature extraction, which makes it less general to DETR-like models compared with our dynamic anchor boxes. Moreover, compared with cross-attention in Transformer decoders, which performs global feature pooling in a soft manner (based on attention maps), the ROI pooling operation only performs local feature pooling within a ROI window. In our opinion, the ROI pooling operation can help faster convergence as it enforces each query to associate with a specific spatial position. But it may lead to a sub-optimal result due to its ignorance of the global context outside a ROI window.
|
| 272 |
+
|
| 273 |
+
# C DAB-DEFORMABLE-DETR
|
| 274 |
+
|
| 275 |
+
To further demonstrate the effectiveness of our dynamic anchor boxes, we develop DABDeformable-DETR by adding our dynamic anchor boxes design to Deformable DETR (Zhu et al., 2021) 2. The difference between Deformable DETR and DAB-Deformable-DETR is shown in Fig. 8 (e) and (f). The results of Deformable DETR and DAB-Deformable-DETR are shown in Table 5. With no more than 10 lines of code modified, our DAB-Deformable-DETR (row 4) results in a significant performance improvement $( + 0 . 5$ AP) compared with the original Deformable DETR (row 3). All other settings except the query formulation are exactly the same in this experiment.
|
| 276 |
+
|
| 277 |
+
We also compare the speed of convergence in Fig. 9. It shows that our proposed dynamic anchor boxes speed up the training as well (left in Fig. 9). We believe one of the reasons for better performance is the update of learned queries. We plot the change of total loss, which is the sum-up of losses of all decoder layers, during training in the middle figure of Fig. 9. Interestingly, it shows that the total loss of DAB-Deformable-DETR is larger than Deformable DETR. However, the loss of the final layer of DAB-Deformable-DETR is lower than that in Deformable DETR (right in Fig. 9), which is a good indicator of the better performance of DAB-Deformable-DETR as the inference result only takes from the last layer.
|
| 278 |
+
|
| 279 |
+
# D ANCHORS VISUALIZATION
|
| 280 |
+
|
| 281 |
+
We visualize the learned anchor boxes in Fig. 10. When learning anchor points as queries, the learned points are distributed evenly around the image, while the centers seem to distribute randomly when learning anchor boxes directly. This might be because the centers are coupled with anchor sizes. The right-most figure shows the visualization of the learned anchor boxes. We only show a partial set for visualization clarity. Most boxes are of medium size and no particular pattern is found in the distribution of boxes.
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 8: Comparison of DETR-like models. For clarity, we only show two layers of Transformer decoder and omit the FFN blocks. We mark the modules with difference in purple and marked the learned high-dimensional queries in brown. DAB-DETR (c) is proposed in our paper, and DABDeformable-DETR (f) is a variant of Deformable DETR modified by introducing our dynamic anchors boxes. All previous models (a,b,d,e) leverage high-dimensional queries (shaded in brown) to pass positional information to each layers, which are semantic ambiguous and are not updated layer by layer. In contrast, DAB-DETR (c) directly uses dynamically updated anchor boxes to provide both a reference query point $( x , y )$ and a reference anchor size $( w , h )$ to improve the cross-attention computation. DAB-Deformable-DETR (f) uses dynamically updated anchor boxes to formulate its queries as well.
|
| 285 |
+
|
| 286 |
+
<table><tr><td># row</td><td>Model</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>Params</td></tr><tr><td>1</td><td>Deformable DETR</td><td>43.8</td><td>62.6</td><td>47.7</td><td>26.4</td><td>47.1</td><td>58.0</td><td>40M</td></tr><tr><td>2</td><td>Deformable DETR+</td><td>45.4</td><td>64.7</td><td>49.0</td><td>26.8</td><td>48.3</td><td>61.7</td><td>40M</td></tr><tr><td>3</td><td>Deformable DETR+ (open source)</td><td>46.3</td><td>65.3</td><td>50.2</td><td>28.6</td><td>49.3</td><td>62.1</td><td>47M</td></tr><tr><td>4</td><td>DAB-Deformable-DETR(Ours)</td><td>46.8</td><td>66.0</td><td>50.4</td><td>29.1</td><td>49.8</td><td>62.3</td><td>47M</td></tr></table>
|
| 287 |
+
|
| 288 |
+
Table 5: Comparison of the results of Deformable DETR and DAB-Deformable-DETR. The models in row 1 and row 2 are copied from the original paper, and the models in row 3 and row 4 are tested under the same standard R50 multi-scale setting. Deformable ${ \mathrm { D E T R } } +$ means the Deformable DETR model with iterative bounding box refinement and the result of Deformable ${ \mathrm { D E T R } } +$ (open source) is reported by us using the open-source code. The only difference between row 3 and row 4 is the formulation of queries.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure 9: Comparison of the training of Deformable DETR and DAB-Deformable-DETR models. We plot the change of AP (left), the loss of all layers (middle), and the loss of the last layer (right) during training, respectively. With no more than 10 lines of code modified, DAB-Deformable-DETR results in a better performance compared with the original Deformable DETR model (see the left figure). While the loss of all layers of DAB-Deformable-DETR is larger than that in Deformable DETR (see the middle figure), our models have a lower loss of the last layer (see the right figure), which is the most important as the inference result only takes from the last layer. The two models are tested under the same standard R50 multi-scale setting.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure 10: Learned anchor points when learning 2D coordinates only (left), and anchor center points (middle) and partial anchor boxes (right) when learning anchor boxes directly.
|
| 295 |
+
|
| 296 |
+
# E RESULTS WITH DIFFERENT TEMPERATURES
|
| 297 |
+
|
| 298 |
+
Table 6 shows the results of models using different temperatures in the positional encoding function. As larger temperature generates more flattened attention maps, it leads to better performances for larger objects. For example, the model with $T = 2$ and the model with $T = 1 0 0 0 0$ have similar AP results, but the former has better performances on $\mathsf { A P } _ { S }$ and $\mathsf { A P } _ { M }$ , while the latter works better on $\mathsf { A P } _ { L }$ , which also validates the role of positional priors in DETR.
|
| 299 |
+
|
| 300 |
+
<table><tr><td>Temperature</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>2</td><td>39.6</td><td>60.7</td><td>41.9</td><td>19.3</td><td>43.3</td><td>58.0</td></tr><tr><td>5</td><td>40.0</td><td>61.1</td><td>42.1</td><td>19.5</td><td>43.4</td><td>58.9</td></tr><tr><td>10</td><td>40.0</td><td>61.1</td><td>42.3</td><td>19.7</td><td>43.5</td><td>59.3</td></tr><tr><td>20</td><td>40.1</td><td>61.1</td><td>42.8</td><td>19.8</td><td>43.7</td><td>58.6</td></tr><tr><td>50</td><td>39.8</td><td>61.0</td><td>42.2</td><td>19.7</td><td>43.2</td><td>58.8</td></tr><tr><td>100</td><td>39.8</td><td>60.8</td><td>42.1</td><td>19.3</td><td>43.3</td><td>58.4</td></tr><tr><td>10000</td><td>39.5</td><td>60.7</td><td>41.7</td><td>18.9</td><td>42.6</td><td>58.9</td></tr></table>
|
| 301 |
+
|
| 302 |
+
Table 6: Comparison of models with different temperatures. All models are trained with the ResNet50 backbone, batch size 64, no multiple pattern embeddings, and no modulated attentions. Default Settings are used for the rest of the parameters.
|
| 303 |
+
|
| 304 |
+
# F RESULTS WITH LESS DECODER LAYERS
|
| 305 |
+
|
| 306 |
+
Table 7 shows the results of models with different decoder layers. All models are trained under our standard ResNet-50-DC setting except the number of decoder layers.
|
| 307 |
+
Table 7: Comparison of models with different number of decoder layers. All models are trained under our standard ResNet-50-DC setting except the number of decoder layers.
|
| 308 |
+
|
| 309 |
+
<table><tr><td>decoder layers</td><td>GFLOPs</td><td>Parmas</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>2</td><td>202</td><td>36M</td><td>40.2</td><td>59.0</td><td>42.9</td><td>22.2</td><td>43.5</td><td>55.4</td></tr><tr><td>3</td><td>206</td><td>38M</td><td>43.9</td><td>63.4</td><td>47.4</td><td>24.6</td><td>47.8</td><td>60.5</td></tr><tr><td>4</td><td>210</td><td>40M</td><td>44.9</td><td>64.5</td><td>48.2</td><td>25.9</td><td>48.5</td><td>61.0</td></tr><tr><td>5</td><td>213</td><td>42M</td><td>45.2</td><td>65.5</td><td>48.6</td><td>26.6</td><td>48.9</td><td>62.3</td></tr><tr><td>6</td><td>216</td><td>44M</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td></tr></table>
|
| 310 |
+
|
| 311 |
+
# G FIXED $x , y$ FOR BETTER PERFORMANCE
|
| 312 |
+
|
| 313 |
+
We provide in this section an interesting experiment. As we all know, all box coordinates $x , y , h , w$ are learned from data. When we fix $x , y$ of the anchor boxes with the random initialization, the model’s performance increases consistently. The comparison of standard DAB-DETR and DABDETR with fixed $x , y$ coordinates is shown in Table 8. Note that we only fix $x , y$ at the first layer to prevent them from learning information from data. But $x , y$ will be updated in other layers. We conjecture that the randomly initialized and fixed $x , y$ coordinates can help to avoid overfitting, which may account for this phenomenon.
|
| 314 |
+
|
| 315 |
+
# H COMPARISON OF BOX UPDATE
|
| 316 |
+
|
| 317 |
+
To further demonstrate the effectiveness of our dynamic anchor box design, we plot the layer-bylayer update result of boxes of DAB-DETR and Conditional DETR in Fig. 11. All DETR-like models have a stacked layers structure. Hence the outputs of each layer can be viewed as a refining procedure. However, due to the high-dimensional queries that are shared across all layers, the update of queries between layers is not stable. As shaded in yellow in Fig. 11 (b), some boxes predicted in the latter layers are worse than their previous layers.
|
| 318 |
+
|
| 319 |
+
# I ANALYSIS OF FAILURE CASES
|
| 320 |
+
|
| 321 |
+
Fig. 12 presents some samples where our model does not predict well. We find our model may have some troubles when facing dense objects, very small objects, or very large objects in an image. To
|
| 322 |
+
|
| 323 |
+
<table><tr><td>Model</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>DAB-DETR-R50*</td><td>42.6</td><td>63.2</td><td>45.6</td><td>21.8</td><td>46.2</td><td>61.1</td></tr><tr><td>DAB-DETR-R50*-fixedx&y</td><td>42.9(+0.3)</td><td>63.7</td><td>45.3</td><td>22.0</td><td>46.8</td><td>60.9</td></tr><tr><td>DAB-DETR-DC5-R50</td><td>44.5</td><td>65.1</td><td>47.7</td><td>25.3</td><td>48.2</td><td>62.3</td></tr><tr><td>DAB-DETR-DC5-R50-fixedx&y</td><td>44.7(+0.2)</td><td>65.3</td><td>47.9</td><td>24.9</td><td>48.2</td><td>62.0</td></tr><tr><td>DAB-DETR-DC5-R50*</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td></tr><tr><td>DAB-DETR-DC5-R50*-fixedx&y</td><td>45.8(+0.1)</td><td>66.5</td><td>48.9</td><td>26.4</td><td>49.6</td><td>62.7</td></tr><tr><td>DAB-DETR-R101*</td><td>44.1</td><td>64.7</td><td>47.2</td><td>24.1</td><td>48.2</td><td>62.9</td></tr><tr><td>DAB-DETR-R101*-fixedx&y</td><td>44.8(+0.7)</td><td>65.4</td><td>48.2</td><td>25.1</td><td>48.9</td><td>63.1</td></tr><tr><td>DAB-DETR-DC5-R101*</td><td>46.6</td><td>67.0</td><td>50.2</td><td>28.1</td><td>50.5</td><td>64.1</td></tr><tr><td>DAB-DETR-DC5-R101*-fixedx&y</td><td>46.7(+0.1)</td><td>67.3</td><td>50.7</td><td>27.3</td><td>50.9</td><td>64.1</td></tr></table>
|
| 324 |
+
|
| 325 |
+
Table 8: Comparison of DAB-DETR and DAB-DETR with fixed anchor centers $x , y$ . When fixing $x , y$ of queries with random values, the performance of the models is improved consistently. The models with superscript ∗ use 3 pattern embeddings as in Anchor DETR.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 11: We compare the layer-by-layer update of boxes of DAB-DETR (a) and Conditional DETR (b). The green boxes are ground truth annotations while the red boxes are model predictions. The boxes of Conditional DETR have larger variances and we mark some boundaries of boxes with a large change in yellow.
|
| 329 |
+
|
| 330 |
+
improve the performance of our model, we will introduce a multi-scale technique into our model to improve the detection performance on small and large objects.
|
| 331 |
+
|
| 332 |
+
# J COMPARISON OF RUNTIME
|
| 333 |
+
|
| 334 |
+
We compare the runtime of DETR, Conditional DETR, and our proposed DAB-DETR in Table 9. Their runtime speeds are reported on a single Nvidia A100 GPU. Our DAB-DETR has a similar inference speed but better performance compared with Conditional DETR, which is our direct competitor.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 12: We visualize some images where our model does not predict well, including dense objects (a,b,c), very small objects (d), and very large objects (e,f). The green boxes are ground truth annotations while red boxes are predictions of models.
|
| 338 |
+
|
| 339 |
+
<table><tr><td>Model</td><td>time(s/img)</td><td>epoches</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>Parmas</td></tr><tr><td>DETR-R50</td><td>0.048</td><td>500</td><td>42.0</td><td>62.4</td><td>44.2</td><td>20.5</td><td>45.8</td><td>61.1</td><td>41M</td></tr><tr><td>Conditional DETR-R50</td><td>0.057</td><td>50</td><td>40.9</td><td>61.8</td><td>43.3</td><td>20.8</td><td>44.6</td><td>59.2</td><td>44M</td></tr><tr><td>DAB-DETR-R50</td><td>0.059</td><td>50</td><td>42.2</td><td>63.1</td><td>44.7</td><td>21.5</td><td>45.7</td><td>60.3</td><td>44M</td></tr><tr><td>DETR-R101</td><td>0.074</td><td>500</td><td>43.5</td><td>63.8</td><td>46.4</td><td>21.9</td><td>48.0</td><td>61.8</td><td>60M</td></tr><tr><td>Conditional DETR-R101</td><td>0.082</td><td>50</td><td>42.8</td><td>63.7</td><td>46.0</td><td>21.7</td><td>46.6</td><td>60.9</td><td>63M</td></tr><tr><td>DAB-DETR-R101</td><td>0.085</td><td>50</td><td>43.5</td><td>63.9</td><td>46.6</td><td>23.6</td><td>47.3</td><td>61.5</td><td>63M</td></tr></table>
|
| 340 |
+
|
| 341 |
+
Table 9: Comparison of the runtime of DETR, Conditional DETR, and our proposed DAB-DETR. All speeds are reported on a single Nvidia A100 GPU.
|
| 342 |
+
|
| 343 |
+
# K COMPARISON OF MODEL CONVERGENCE
|
| 344 |
+
|
| 345 |
+
We present convergence curves of DETR, Conditional DETR, and our DAB-DETR in Fig. 13. All models are trained under the standard R50 (DC5) setting. The results demonstrate the effectiveness of our model. Our DAB-DETR is trained with our f ix x&y variants. see Appendix G for more details about the f ix x&y results. Both Conditional DETR and DAB-DETR use 300 queries, while DETR leverages 100 queries.
|
| 346 |
+
|
| 347 |
+
Our DAB-DETR converges faster than Conditional DETR, especially in early epochs, as shown in Fig. 13.
|
| 348 |
+
|
| 349 |
+
# L VISUALIZATION RESULTS OF ITERATIVE BOX UPDATE
|
| 350 |
+
|
| 351 |
+
We present more visualization results of iterative box update in Fig. 14 and Fig. 15. The initial anchors, anchors updated after the first decoder layer, and the anchors predicted from the last decoder layer are plotted in the first, the second, and the third columns, respectively.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 13: Convergence curves of DETR, Conditional DETR, and our DAB-DETR. All models are trained under the R50 (DC5) setting.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 14: Visualizations for layer-by-layer anchor box update. We plot the initial anchor boxes (left), anchor boxes after the first decoder layer (middle), and the output of the last decoder layer (right), respectively. The green boxes are ground truth annotations, while the red boxes are predictions of our model. The results are obtained using the ResNet-50 backbone. More visualizations are available in Fig. 15.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 15: More visualizations for layer-by-layer anchor box update. We plot the initial anchor boxes (left), anchor boxes after the first decoder layer (middle), and the output of the last decoder layer (right), respectively. The green boxes are ground truth annotations, while the red boxes are predictions of our model. The results are obtained using the ResNet-50 backbone.
|
parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_content_list.json
ADDED
|
@@ -0,0 +1,1842 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 4 |
+
"text": "DAB-DETR: DYNAMIC ANCHOR BOXES ARE BETTER QUERIES FOR DETR ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
174,
|
| 8 |
+
98,
|
| 9 |
+
669,
|
| 10 |
+
147
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Shilong $\\mathbf { L i u ^ { 1 , 2 * } }$ ∗, Feng $\\mathbf { L i ^ { 2 , 3 } }$ , Hao Zhang2,3, Xiao Yang1, \nXianbiao $\\mathbf { Q } \\mathbf { i } ^ { 2 }$ , Hang $\\mathbf { S u } ^ { 1 , 4 }$ , Jun $\\mathbf { Z } \\mathbf { h } \\mathbf { u } ^ { 1 , 4 \\dagger }$ , Lei Zhang2† \n1Dept. of Comp. Sci. and Tech., BNRist Center, State Key Lab for Intell. Tech. & Sys., Institute for AI, Tsinghua-Bosch Joint Center for ML, Tsinghua University. 2International Digital Economy Academy (IDEA). \n3Hong Kong University of Science and Technology. \n4Peng Cheng Laboratory, Shenzhen, Guangdong, China. \n{liusl20,yangxiao19}@mails.tsinghua.edu.cn \n{fliay,hzhangcx}@connect.ust.hk \n{qixianbiao,leizhang}@idea.edu.cn \n{suhangss,dcszj}@mail.tsinghua.edu.cn ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
184,
|
| 19 |
+
171,
|
| 20 |
+
730,
|
| 21 |
+
332
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
367,
|
| 32 |
+
544,
|
| 33 |
+
382
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "We present in this paper a novel query formulation using dynamic anchor boxes for DETR (DEtection TRansformer) and offer a deeper understanding of the role of queries in DETR. This new formulation directly uses box coordinates as queries in Transformer decoders and dynamically updates them layer by layer. Using box coordinates not only helps using explicit positional priors to improve the queryto-feature similarity and eliminate the slow training convergence issue in DETR, but also allows us to modulate the positional attention map using the box width and height information. Such a design makes it clear that queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade manner. As a result, it leads to the best performance on MS-COCO benchmark among the DETR-like detection models under the same setting, e.g., AP $4 5 . 7 \\%$ using ResNet50-DC5 as backbone trained in 50 epochs. We also conducted extensive experiments to confirm our analysis and verify the effectiveness of our methods. Code is available at https://github.com/IDEA-opensource/ DAB-DETR. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
402,
|
| 43 |
+
764,
|
| 44 |
+
609
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
643,
|
| 55 |
+
336,
|
| 56 |
+
660
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Object detection is a fundamental task in computer vision of wide applications. Most classical detectors are based on convolutional architectures which have made remarkable progress in the last decade (Ren et al., 2017; Girshick, 2015; Redmon et al., 2016; Bochkovskiy et al., 2020; Ge et al., 2021). Recently, Carion et al. (2020) proposed a Transformer-based end-to-end detector named DETR (DEtection TRansformer), which eliminates the need for hand-designed components, e.g., anchors, and shows promising performance compared with modern anchor-based detectors such as Faster RCNN (Ren et al., 2017). ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
678,
|
| 66 |
+
825,
|
| 67 |
+
775
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "In contrast to anchor-based detectors, DETR models object detection as a set prediction problem and uses 100 learnable queries to probe and pool features from images, which makes predictions without the need of using non-maximum suppression. However, due to its ineffective design and use of queries, DETR suffers from significantly slow training convergence, usually requiring 500 epochs to achieve a good performance. To address this issue, many follow-up works attempted to improve the design of DETR queries for both faster training convergence and better performance (Zhu et al., 2021; Gao et al., 2021; Meng et al., 2021; Wang et al., 2021). ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
782,
|
| 77 |
+
825,
|
| 78 |
+
880
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "image",
|
| 84 |
+
"img_path": "images/50025b9e1a3db31bdb559ba46e4ff85585c6469427c2c021eac499844c44e68b.jpg",
|
| 85 |
+
"image_caption": [
|
| 86 |
+
"Figure 1: Comparison of DETR, Conditional DETR, and our proposed DAB-DETR. For clarity, we only show the cross-attention part in the Transformer decoder. (a) DETR uses the learnable queries for all the layers without any adaptation, which accounts for its slow training convergence. (b) Conditional DETR adapts the learnable queries for each layer mainly to provide a better reference query point to pool features from the image feature map. In contrast, (c) DAB-DETR directly uses dynamically updated anchor boxes to provide both a reference query point $( x , y )$ and a reference anchor size $( w , h )$ to improve the cross-attention computation. We marked the modules with difference in purple. "
|
| 87 |
+
],
|
| 88 |
+
"image_footnote": [],
|
| 89 |
+
"bbox": [
|
| 90 |
+
225,
|
| 91 |
+
98,
|
| 92 |
+
756,
|
| 93 |
+
275
|
| 94 |
+
],
|
| 95 |
+
"page_idx": 1
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"type": "text",
|
| 99 |
+
"text": "Despite all the progress, the role of the learned queries in DETR is still not fully understood or utilized. While most previous attempts make each query in DETR more explicitly associated with one specific spatial position rather than multiple positions , the technical solutions are largely different. For example, Conditional DETR learns a conditional spatial query by adapting a query based on its content feature for better matching with image features (Meng et al., 2021). Efficient DETR introduces a dense prediction module to select top-K object queries (Yao et al., 2021) and Anchor DETR formulates queries as 2D anchor points (Wang et al., 2021), both associating each query with a specific spatial position. Similarly, Deformable DETR directly treats 2D reference points as queries and performs deformable cross-attention operation at each reference points (Zhu et al., 2021). But all the above works only leverage 2D positions as anchor points without considering the object scales. ",
|
| 100 |
+
"bbox": [
|
| 101 |
+
173,
|
| 102 |
+
416,
|
| 103 |
+
825,
|
| 104 |
+
556
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "Motivated by these studies, we take a closer look at the cross-attention module in Transformer decoder and propose to use anchor boxes, i.e., 4D box coordinates $( x , y , w , h )$ , as queries in DETR and update them layer by layer. This new query formulation introduce better spatial priors for the cross-attention module by considering both the position and size of each anchor box, which also leads to a much simpler implementation and a deeper understanding of the role of queries in DETR. ",
|
| 111 |
+
"bbox": [
|
| 112 |
+
174,
|
| 113 |
+
563,
|
| 114 |
+
825,
|
| 115 |
+
633
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "The key insight behind this formulation is that each query in DETR is formed by two parts: a content part (decoder self-attention output) and a positional part (e.g., learnable queries in DETR) 1. The cross-attention weights are computed by comparing a query with a set of keys which consists of two parts as a content part (encoded image feature) and a positional part (positional embedding). Thus, queries in Transformer decoder can be interpreted as pooling features from a feature map based on the query-to-feature similarity measure, which considers both the content and positional information. While the content similarity is for pooling semantically related features, the positional similarity is to provide a positional constraint for pooling features around the query position. This attention computing mechanism motivates us to formulate queries as anchor boxes as illustrated in Fig. 1 (c), allowing us to use the center position $( x , y )$ of an anchor box to pool features around the center and use the anchor box size $( w , h )$ to modulate the cross-attention map, adapting it to anchor box size. In addition, because of the use of coordinates as queries, anchor boxes can be updated layer by layer dynamically. In this way, queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade way. ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
173,
|
| 124 |
+
640,
|
| 125 |
+
825,
|
| 126 |
+
834
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "We provide a better positional prior for pooling features by using anchor box size to modulate the cross-attention. Because the cross-attention can pool features from the whole feature map, it is crucial to provide a proper positional prior for each query to let the cross-attention module focus on a local region corresponding to a target object. It can also facilitate to speed up the training convergence of DETR. Most prior works improve DETR by associating each query with a specific location, but they assume an isotropic Gaussian positional prior of a fixed size(Fig. 4 (b)), which is inappropriate for objects of different scales. With the size information $( w , h )$ available in each query anchor box, we can modulate the Gaussian positional prior as an oval shape. More specifically, we divide the width and height from the cross-attention weight (before softmax) for its $x$ part and $y$ part separately, which helps the Gaussian prior to better match with objects of different scales(Fig. 4 (c)). To further improve the positional prior, we also introduce a temperature parameter to tune the flatness of positional attention, which has been overlooked in all prior works. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
840,
|
| 136 |
+
823,
|
| 137 |
+
869
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "",
|
| 144 |
+
"bbox": [
|
| 145 |
+
174,
|
| 146 |
+
103,
|
| 147 |
+
825,
|
| 148 |
+
242
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 2
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "In summary, our proposed DAB-DETR (Dynamic Anchor Box DETR) presents a novel query formulation by directly learning anchors as queries. This formulation offers a deeper understanding of the role of queries, allowing us to use anchor size to modulate the positional cross-attention map in Transformer decoders and perform dynamic anchor update layer by layer. Our results demonstrate that DAB-DETR attains the best performance among DETR-like architectures under the same setting on the COCO object detection benchmark. The proposed method can achieve $4 5 . 7 \\%$ AP when using a single ResNet-50 (He et al., 2016) model as backbone for training 50 epochs. We also conducted extensive experiments to confirm our analysis and verify the effectiveness of our methods. ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
174,
|
| 157 |
+
250,
|
| 158 |
+
825,
|
| 159 |
+
375
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 2
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "2 RELATED WORK ",
|
| 166 |
+
"text_level": 1,
|
| 167 |
+
"bbox": [
|
| 168 |
+
176,
|
| 169 |
+
410,
|
| 170 |
+
344,
|
| 171 |
+
426
|
| 172 |
+
],
|
| 173 |
+
"page_idx": 2
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"type": "text",
|
| 177 |
+
"text": "Most classical detectors are anchor-based, using either anchor boxes (Ren et al., 2017; Girshick, 2015; Sun et al., 2021) or anchor points (Tian et al., 2019; Zhou et al., 2019). In contrast, DETR (Carion et al., 2020) is a fully anchor-free detector using a set of learnable vectors as queries. Many follow-up works attempted to solve the slow convergence of DETR from different perspectives. Sun et al. (2020) pointed out that the cause of slow training of DETR is due to the crossattention in decoders and hence proposed an encoder-only model. Gao et al. (2021) instead introduced a Gaussian prior to regulate the cross-attention. Despite their improved performance, they did not give a proper explanation of the slow training and the roles of queries in DETR. ",
|
| 178 |
+
"bbox": [
|
| 179 |
+
174,
|
| 180 |
+
450,
|
| 181 |
+
825,
|
| 182 |
+
563
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "Another direction to improve DETR, which is more relevant to our work, is towards a deeper understanding of the role of queries in DETR. As the learnable queries in DETR are used to provide positional constraints for feature pooling, most related works attempted to make each query in DETR more explicitly related to a specific spatial position rather than multiple position modes in the vanilla DETR. For example, Deformable DETR (Zhu et al., 2021) directly treats 2D reference points as queries and predicts deformable sampling points for each reference point to perform the deformable cross-attention operation. Conditional DETR (Meng et al., 2021) decouples the attention formulation and generates positional queries based on reference coordinates. Efficient DETR (Yao et al., 2021) introduces a dense prediction module to select top-K positions as object queries. Although these works connect queries with positional information, they do not have an explicit formulation to use anchors. ",
|
| 189 |
+
"bbox": [
|
| 190 |
+
174,
|
| 191 |
+
569,
|
| 192 |
+
825,
|
| 193 |
+
722
|
| 194 |
+
],
|
| 195 |
+
"page_idx": 2
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"type": "text",
|
| 199 |
+
"text": "Different from the hypothesis in prior works that the learnable query vectors contain box coordinate information, our approach is based on a new perspective that all information contained in queries are box coordinates. That is, anchor boxes are better queries for DETR. A concurrent work Anchor DETR (Wang et al., 2021) also suggests learning anchor points directly, while it ignores the anchor width and height information as in other prior works. Besides DETR, Sun et al. (2021) proposed a sparse detector by learning boxes directly, which shares a similar anchor formulation with us, but it discards the Transformer structure and leverages hard ROI align for feature extraction. Table 1 summarizes the key differences between related works and our proposed DAB-DETR. We compare our model with related works on five dimensions: if the model directly learns anchors, if the model predicts reference coordinates (in its intermediate stage), if the model updates the reference anchors layer by layer, if the model uses the standard dense cross-attention, if the attention is modulated to better match with objects of different scales, and if the model updates the learned queries layer by layer. A more detailed comparison of DETR-like models is available in Sec. B of Appendix. We recommend this section for readers who have confusions about the table. ",
|
| 200 |
+
"bbox": [
|
| 201 |
+
174,
|
| 202 |
+
729,
|
| 203 |
+
825,
|
| 204 |
+
922
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 2
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "table",
|
| 210 |
+
"img_path": "images/8f60cf1ce12a8720d6c8e83675563a8030269c7c94704d90532ae4ac22983fc4.jpg",
|
| 211 |
+
"table_caption": [],
|
| 212 |
+
"table_footnote": [],
|
| 213 |
+
"table_body": "<table><tr><td>Models</td><td>Learn Anchors?</td><td>Reference Anchors</td><td>Dynamic Anchors</td><td>Standard Attention</td><td>Size-Modulated Attention</td><td>Update Learned Spatial Queries?</td></tr><tr><td>DETR</td><td>No</td><td>No</td><td></td><td>√</td><td></td><td></td></tr><tr><td>Deformable DETR</td><td>No</td><td>4D</td><td>√</td><td></td><td>√</td><td></td></tr><tr><td>SMCA</td><td>No</td><td>4D</td><td></td><td>√</td><td>√</td><td></td></tr><tr><td>Conditional DETR</td><td>No</td><td>2D</td><td></td><td>√</td><td></td><td></td></tr><tr><td>Anchor DETR</td><td>2D</td><td>2D</td><td>√</td><td></td><td></td><td></td></tr><tr><td>Sparse RCNN</td><td>4D</td><td>4D</td><td>√</td><td></td><td></td><td></td></tr><tr><td>DAB-DETR</td><td>4D</td><td>4D</td><td>√</td><td>√</td><td></td><td></td></tr></table>",
|
| 214 |
+
"bbox": [
|
| 215 |
+
205,
|
| 216 |
+
101,
|
| 217 |
+
789,
|
| 218 |
+
179
|
| 219 |
+
],
|
| 220 |
+
"page_idx": 3
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"type": "text",
|
| 224 |
+
"text": "Table 1: Comparison of representative related models and our DAB-DETR. The term “Learn Anchors?” asks if the model learns 2D points or 4D anchors as learnable parameters directly. The term ”Reference Anchors” means if the model predicts relative coordinates with respect to a reference points/anchors. The term “Dynamic Anchors” indicates if the model updates its anchors layer-by-layer. The term “Standard Attention” shows whether the model leverages the standard dense attention in cross-attention modules. The term “Object Scale-Modulated Attention” means if the attention is modulated to better match with object scales. The term “Size-Modulated Attention” means if the attention is modulated to better match with object scales. The term “Update Spatial Learned Queries?” means if the learned queries are updated layer by layer. Note that Sparse RCNN is not a DETR-like architecture. we list it here for their similar anchor formulation with us. See Sec. B of Appendix for a more detailed comparison of these models. ",
|
| 225 |
+
"bbox": [
|
| 226 |
+
173,
|
| 227 |
+
188,
|
| 228 |
+
825,
|
| 229 |
+
342
|
| 230 |
+
],
|
| 231 |
+
"page_idx": 3
|
| 232 |
+
},
|
| 233 |
+
{
|
| 234 |
+
"type": "text",
|
| 235 |
+
"text": "3 WHY A POSITIONAL PRIOR COULD SPEEDUP TRAINING? ",
|
| 236 |
+
"text_level": 1,
|
| 237 |
+
"bbox": [
|
| 238 |
+
174,
|
| 239 |
+
356,
|
| 240 |
+
678,
|
| 241 |
+
372
|
| 242 |
+
],
|
| 243 |
+
"page_idx": 3
|
| 244 |
+
},
|
| 245 |
+
{
|
| 246 |
+
"type": "image",
|
| 247 |
+
"img_path": "images/9f660f7e509fc434d6f36a11b536be96d637d0bb80223445d121f6c6e5fdeb2f.jpg",
|
| 248 |
+
"image_caption": [
|
| 249 |
+
"Figure 2: Comparison of self-attention in encoders and cross-attention in decoders of DETR. As they have the same key and value components, the only difference comes from the queries. Each query in an encoder is composed of an image feature (content information) and a positional embedding (positional information), whereas each query in a decoder is composed of a decoder embedding (content information) and a learnable query (postional information). The differences between two modules are marked in purple. "
|
| 250 |
+
],
|
| 251 |
+
"image_footnote": [],
|
| 252 |
+
"bbox": [
|
| 253 |
+
294,
|
| 254 |
+
397,
|
| 255 |
+
699,
|
| 256 |
+
535
|
| 257 |
+
],
|
| 258 |
+
"page_idx": 3
|
| 259 |
+
},
|
| 260 |
+
{
|
| 261 |
+
"type": "text",
|
| 262 |
+
"text": "Much work has been done to accelerate the training convergence speed of DETR, while lacking a unified understanding of why their methods work. Sun et al. (2020) showed that the cross-attention module is mainly responsible for the slow convergence, but they simply removed the decoders for faster training. We follow their analysis to find which sub-module in the cross-attention affects the performance. Comparing the self-attention module in encoders with the cross-attention module in decoders, we find the key difference between their inputs comes from the queries, as shown in Fig. 2. As the decoder embeddings are initialized as 0, they are projected to the same space as the image features after the first cross-attention module. After that, they will go through a similar process in decoder layers as the image features in encoder layers. Hence the root cause is likely due to the learnable queries. ",
|
| 263 |
+
"bbox": [
|
| 264 |
+
174,
|
| 265 |
+
631,
|
| 266 |
+
825,
|
| 267 |
+
770
|
| 268 |
+
],
|
| 269 |
+
"page_idx": 3
|
| 270 |
+
},
|
| 271 |
+
{
|
| 272 |
+
"type": "text",
|
| 273 |
+
"text": "Two possible reasons in cross-attention account for the model’s slow training convergence: 1) it is hard to learn the queries due to the optimization challenge, and 2) the positional information in the learned queries is not encoded in the same way as the sinusoidal positional encoding used for image features. To see if it is the first reason, we reuse the well-learned queries from DETR (keep them fixed) and only train the other modules. The training curves in Fig. 3(a) show that the fixed queries only slightly improve the convergence in very early epochs, e.g., the first 25 epochs. Hence the query learning (or optimization) is likely not the key concern. ",
|
| 274 |
+
"bbox": [
|
| 275 |
+
174,
|
| 276 |
+
777,
|
| 277 |
+
825,
|
| 278 |
+
875
|
| 279 |
+
],
|
| 280 |
+
"page_idx": 3
|
| 281 |
+
},
|
| 282 |
+
{
|
| 283 |
+
"type": "text",
|
| 284 |
+
"text": "Then we turn to the second possibility and try to find out if the learned queries have some undesirable properties. As the learned queries are used to filter objects in certain regions, we visualize a few positional attention maps between the learned queries and the positional embeddings of image features in Fig. 4(a). Each query can be regarded as a positional prior to let decoders focus on a region of interest. Although they serve as a positional constraint, they also carry undesirable properties: multiple modes and nearly uniform attention weights. For example, the two attention maps at the top of Fig. 4(a) have two or more concentration centers, making it hard to locate objects when multiple objects exist in an image. The bottom maps of Fig. 4(a) focus on areas that are either too large or too small, and hence cannot inject useful positional information into the procedure of feature extraction. We conjecture that the multiple mode property of queries in DETR is likely the root cause for its slow training and we believe introducing explicit positional priors to constrain queries on a local region is desirable for training. To verify this assumption, we replace the query formulation in DETR with dynamic anchor boxes, which can enforce each query to focus on a specific area, and name this model DETR $+$ DAB. The training curves in Fig. 3(b) show that DETR $+$ DAB leads to much better performance compared with DETR, in terms of both detection AP and training/testing loss. Note that the only difference between DETR and DETR $^ +$ DAB is the formulation of queries and no other techniques like 300 queries or focal loss are introduced. It shows that after addressing the multi-mode issue of DETR queries, we can achieve both a faster training convergence and a higher detection accuracy. ",
|
| 285 |
+
"bbox": [
|
| 286 |
+
176,
|
| 287 |
+
882,
|
| 288 |
+
823,
|
| 289 |
+
924
|
| 290 |
+
],
|
| 291 |
+
"page_idx": 3
|
| 292 |
+
},
|
| 293 |
+
{
|
| 294 |
+
"type": "image",
|
| 295 |
+
"img_path": "images/198bb5024b93e33cc8bd1e32128e12e7529d537cd742609920e53ec907af7a73.jpg",
|
| 296 |
+
"image_caption": [
|
| 297 |
+
"Figure 3: a): Training curves of the original DETR and DETR with fixed queries. b): Training curves of the original DETR and DETR $^ +$ DAB. We run each experiment 3 times and plot the mean value and the $9 5 \\%$ confidence interval of each item. "
|
| 298 |
+
],
|
| 299 |
+
"image_footnote": [],
|
| 300 |
+
"bbox": [
|
| 301 |
+
194,
|
| 302 |
+
102,
|
| 303 |
+
815,
|
| 304 |
+
202
|
| 305 |
+
],
|
| 306 |
+
"page_idx": 4
|
| 307 |
+
},
|
| 308 |
+
{
|
| 309 |
+
"type": "image",
|
| 310 |
+
"img_path": "images/8fa5db19b42e033de568f2a5d992f124c053cefd4e65f454d82283f6d687711f.jpg",
|
| 311 |
+
"image_caption": [
|
| 312 |
+
"Figure 4: We visualize the positional attention between positional queries and positional keys for DETR, Conditional DETR, and our proposed DAB-DETR. Four attention maps in (a) are randomly sampled, and we select figures with similar query positions as in (a) for (b) and (c). The darker the color, the greater the attention weight, and vice versa. (a) Each attention map in DETR is calculated by performing dot product between a learned query and positional embeddings from a feature map, and can have multiple modes and unconcentrated attentions. (b) The positional queries in Conditional DETR are encoded in the same way as the image positional embeddings, resulting in Gaussian-like attention maps. However, it cannot adapt to objects of different scales. (c) DABDETR explicitly modulates the attention map using the width and height information of an anchor, making it more adaptive to object size and shape. The modulated attentions can be regarded as helping perform soft ROI pooling. "
|
| 313 |
+
],
|
| 314 |
+
"image_footnote": [],
|
| 315 |
+
"bbox": [
|
| 316 |
+
254,
|
| 317 |
+
273,
|
| 318 |
+
741,
|
| 319 |
+
397
|
| 320 |
+
],
|
| 321 |
+
"page_idx": 4
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"type": "text",
|
| 325 |
+
"text": "",
|
| 326 |
+
"bbox": [
|
| 327 |
+
173,
|
| 328 |
+
597,
|
| 329 |
+
825,
|
| 330 |
+
819
|
| 331 |
+
],
|
| 332 |
+
"page_idx": 4
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"type": "text",
|
| 336 |
+
"text": "Some previous works also have similar analyses and confirmed this. For example, SMCA (Gao et al., 2021) speeds up the training by applying pre-defined Gaussian maps around reference points. Conditional DETR (Meng et al., 2021) uses explicit positional embedding as positional queries for training, yielding attention maps similar to Gaussian kernels as shown in Fig. 4(b). Although explicit positional priors lead to good performance in training, they ignore the scale information of an object. In contrast, our proposed DAB-DETR explicitly takes into account the object scale information to adaptively adjust attention weights, as shown in Fig. 4(c). ",
|
| 337 |
+
"bbox": [
|
| 338 |
+
174,
|
| 339 |
+
827,
|
| 340 |
+
825,
|
| 341 |
+
924
|
| 342 |
+
],
|
| 343 |
+
"page_idx": 4
|
| 344 |
+
},
|
| 345 |
+
{
|
| 346 |
+
"type": "text",
|
| 347 |
+
"text": "4 DAB-DETR ",
|
| 348 |
+
"text_level": 1,
|
| 349 |
+
"bbox": [
|
| 350 |
+
174,
|
| 351 |
+
102,
|
| 352 |
+
312,
|
| 353 |
+
117
|
| 354 |
+
],
|
| 355 |
+
"page_idx": 5
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"type": "image",
|
| 359 |
+
"img_path": "images/1582072dae193559f73935a48de754190851aea8e4ee1ff7f332fff9a547fd59.jpg",
|
| 360 |
+
"image_caption": [
|
| 361 |
+
"Figure 5: Framework of our proposed DAB-DETR. "
|
| 362 |
+
],
|
| 363 |
+
"image_footnote": [],
|
| 364 |
+
"bbox": [
|
| 365 |
+
344,
|
| 366 |
+
145,
|
| 367 |
+
658,
|
| 368 |
+
387
|
| 369 |
+
],
|
| 370 |
+
"page_idx": 5
|
| 371 |
+
},
|
| 372 |
+
{
|
| 373 |
+
"type": "text",
|
| 374 |
+
"text": "4.1 OVERVIEW ",
|
| 375 |
+
"text_level": 1,
|
| 376 |
+
"bbox": [
|
| 377 |
+
174,
|
| 378 |
+
433,
|
| 379 |
+
290,
|
| 380 |
+
448
|
| 381 |
+
],
|
| 382 |
+
"page_idx": 5
|
| 383 |
+
},
|
| 384 |
+
{
|
| 385 |
+
"type": "text",
|
| 386 |
+
"text": "Following DETR (Carion et al., 2020), our model is an end-to-end object detector which includes a CNN backbone, Transformer (Vaswani et al., 2017) encoders and decoders, and prediction heads for boxes and labels. We mainly improve the decoder part, as shown in Fig. 5. ",
|
| 387 |
+
"bbox": [
|
| 388 |
+
174,
|
| 389 |
+
460,
|
| 390 |
+
823,
|
| 391 |
+
502
|
| 392 |
+
],
|
| 393 |
+
"page_idx": 5
|
| 394 |
+
},
|
| 395 |
+
{
|
| 396 |
+
"type": "text",
|
| 397 |
+
"text": "Given an image, we extract image spatial features using a CNN backbone followed with Transformer encoders to refine the CNN features. Then dual queries, including positional queries (anchor boxes) and content queries (decoder embeddings), are fed into the decoder to probe the objects which correspond to the anchors and have similar patterns with the content queries. The dual queries are updated layer by layer to get close to the target ground-truth objects gradually. The outputs of the final decoder layer are used to predict the objects with labels and boxes by prediction heads, and then a bipartite graph matching is conducted to calculate loss as in DETR. ",
|
| 398 |
+
"bbox": [
|
| 399 |
+
174,
|
| 400 |
+
510,
|
| 401 |
+
825,
|
| 402 |
+
607
|
| 403 |
+
],
|
| 404 |
+
"page_idx": 5
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"type": "text",
|
| 408 |
+
"text": "To illustrate the generality of our dynamic anchor boxes, we also design a stronger DABDeformable-DETR, which is available in Appendix. ",
|
| 409 |
+
"bbox": [
|
| 410 |
+
174,
|
| 411 |
+
613,
|
| 412 |
+
821,
|
| 413 |
+
642
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 5
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "text",
|
| 419 |
+
"text": "4.2 LEARNING ANCHOR BOXES DIRECTLY ",
|
| 420 |
+
"text_level": 1,
|
| 421 |
+
"bbox": [
|
| 422 |
+
176,
|
| 423 |
+
660,
|
| 424 |
+
483,
|
| 425 |
+
675
|
| 426 |
+
],
|
| 427 |
+
"page_idx": 5
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"type": "text",
|
| 431 |
+
"text": "As discussed in Sec. 1 regarding the role of queries in DETR, we propose to directly learn query boxes or say anchor boxes and derive positional queries from these anchors. There are two attention modules in each decoder layer, including a self-attention module and a cross-attention module, which are used for query updating and feature probing, respectively. Each module needs queries, keys, and values to perform attention-based value aggregation, yet the inputs of these triplets differ. ",
|
| 432 |
+
"bbox": [
|
| 433 |
+
174,
|
| 434 |
+
688,
|
| 435 |
+
825,
|
| 436 |
+
758
|
| 437 |
+
],
|
| 438 |
+
"page_idx": 5
|
| 439 |
+
},
|
| 440 |
+
{
|
| 441 |
+
"type": "text",
|
| 442 |
+
"text": "We denote $A _ { q } = ( x _ { q } , y _ { q } , w _ { q } , h _ { q } )$ as the $q$ -th anchor, $x _ { q } , y _ { q } , w _ { q } , h _ { q } \\in \\mathbb { R }$ , and $C _ { q } \\in \\mathbb { R } ^ { D }$ and $P _ { q } \\in$ $\\mathbb { R } ^ { D }$ as its corresponding content query and positional query, where $D$ is the dimension of decoder embeddings and positional queries. ",
|
| 443 |
+
"bbox": [
|
| 444 |
+
176,
|
| 445 |
+
763,
|
| 446 |
+
823,
|
| 447 |
+
808
|
| 448 |
+
],
|
| 449 |
+
"page_idx": 5
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"type": "text",
|
| 453 |
+
"text": "Given an anchor $A _ { q }$ , its positional query $P _ { q }$ is generated by: ",
|
| 454 |
+
"bbox": [
|
| 455 |
+
173,
|
| 456 |
+
814,
|
| 457 |
+
568,
|
| 458 |
+
830
|
| 459 |
+
],
|
| 460 |
+
"page_idx": 5
|
| 461 |
+
},
|
| 462 |
+
{
|
| 463 |
+
"type": "equation",
|
| 464 |
+
"img_path": "images/eeba89bf6383acfcf2c2f6896a23ba333c89766071091f3da3ad2b2b58de8653.jpg",
|
| 465 |
+
"text": "$$\nP _ { q } = \\mathbf { M L P } ( \\mathbf { P E } ( A _ { q } ) ) ,\n$$",
|
| 466 |
+
"text_format": "latex",
|
| 467 |
+
"bbox": [
|
| 468 |
+
426,
|
| 469 |
+
852,
|
| 470 |
+
570,
|
| 471 |
+
869
|
| 472 |
+
],
|
| 473 |
+
"page_idx": 5
|
| 474 |
+
},
|
| 475 |
+
{
|
| 476 |
+
"type": "text",
|
| 477 |
+
"text": "where PE means positional encoding to generate sinusoidal embeddings from float numbers and the parameters of MLP are shared across all layers. As $A _ { q }$ is a quaternion, we overload the PE operator here: ",
|
| 478 |
+
"bbox": [
|
| 479 |
+
176,
|
| 480 |
+
881,
|
| 481 |
+
823,
|
| 482 |
+
922
|
| 483 |
+
],
|
| 484 |
+
"page_idx": 5
|
| 485 |
+
},
|
| 486 |
+
{
|
| 487 |
+
"type": "equation",
|
| 488 |
+
"img_path": "images/e5955a395367403733f1dbdc29523677b4632ba926a10b2426b0b8c93fe1fc76.jpg",
|
| 489 |
+
"text": "$$\n\\mathrm { P E } ( A _ { q } ) = \\mathrm { P E } ( x _ { q } , y _ { q } , w _ { q } , h _ { q } ) = \\mathrm { C a t } ( \\mathrm { P E } ( x _ { q } ) , \\mathrm { P E } ( y _ { q } ) , \\mathrm { P E } ( w _ { q } ) , \\mathrm { P E } ( h _ { q } ) ) .\n$$",
|
| 490 |
+
"text_format": "latex",
|
| 491 |
+
"bbox": [
|
| 492 |
+
261,
|
| 493 |
+
118,
|
| 494 |
+
736,
|
| 495 |
+
137
|
| 496 |
+
],
|
| 497 |
+
"page_idx": 6
|
| 498 |
+
},
|
| 499 |
+
{
|
| 500 |
+
"type": "text",
|
| 501 |
+
"text": "The notion Cat means concatenation function. In our implementations, the positional encoding function PE maps a float to a vector with $D / 2$ dimensions as: PE: $\\mathbb { R } \\mathbb { R } ^ { D / 2 }$ . Hence the function MLP projects a $2 D$ dimensional vector into $D$ dimensions: MLP: $\\mathbb { R } ^ { 2 D } \\to \\mathbb { R } ^ { D }$ . The MLP module has two submodules, each of which is composed of a linear layer and a ReLU activation, and the feature reduction is conducted at the first linear layer. ",
|
| 502 |
+
"bbox": [
|
| 503 |
+
173,
|
| 504 |
+
148,
|
| 505 |
+
825,
|
| 506 |
+
220
|
| 507 |
+
],
|
| 508 |
+
"page_idx": 6
|
| 509 |
+
},
|
| 510 |
+
{
|
| 511 |
+
"type": "text",
|
| 512 |
+
"text": "In the self-attention module, all three of queries, keys, and values have the same content items, while the queries and keys contain extra position items: ",
|
| 513 |
+
"bbox": [
|
| 514 |
+
171,
|
| 515 |
+
227,
|
| 516 |
+
825,
|
| 517 |
+
256
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 6
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "equation",
|
| 523 |
+
"img_path": "images/1fb09105cd49a948179c9e74c66cd1ba825d327fb08f2ad3e1fa02d35b53a14a.jpg",
|
| 524 |
+
"text": "$$\n\\mathrm { S e l f - A t t n : } \\quad Q _ { q } = C _ { q } + P _ { q } , \\quad K _ { q } = C _ { q } + P _ { q } , \\quad V _ { q } = C _ { q } ,\n$$",
|
| 525 |
+
"text_format": "latex",
|
| 526 |
+
"bbox": [
|
| 527 |
+
299,
|
| 528 |
+
277,
|
| 529 |
+
696,
|
| 530 |
+
295
|
| 531 |
+
],
|
| 532 |
+
"page_idx": 6
|
| 533 |
+
},
|
| 534 |
+
{
|
| 535 |
+
"type": "text",
|
| 536 |
+
"text": "Inspired by Conditional DETR (Meng et al., 2021), we concatenate the position and content information together as queries and keys in the cross-attention module, so that we can decouple the content and position contributions to the query-to-feature similarity computed as the dot product between a query and a key. To rescale the positional embeddings, we leverage the conditional spatial query (Meng et al., 2021) as well. More specifically, we learn a $\\mathbf { M L P } ^ { ( \\mathrm { c s q } ) } : \\mathbb { R } ^ { D } \\mathbb { R } ^ { D }$ to obtain a scale vector conditional on the content information and use it perform element-wise multiplication with the positional embeddings: ",
|
| 537 |
+
"bbox": [
|
| 538 |
+
173,
|
| 539 |
+
306,
|
| 540 |
+
825,
|
| 541 |
+
409
|
| 542 |
+
],
|
| 543 |
+
"page_idx": 6
|
| 544 |
+
},
|
| 545 |
+
{
|
| 546 |
+
"type": "equation",
|
| 547 |
+
"img_path": "images/674fd855676b4d481459b8b77c81f60be7030397b8378979477751018a261512.jpg",
|
| 548 |
+
"text": "$$\n\\begin{array} { r l } { \\mathrm { C r o s s \\mathrm { - } A t t n : } \\quad } & { Q _ { q } = \\mathrm { C a t } ( C _ { q } , \\mathrm { P E } ( x _ { q } , y _ { q } ) \\cdot \\mathrm { M L P } ^ { ( \\mathrm { c s q } ) } ( C _ { q } ) ) , } \\\\ & { K _ { x , y } = \\mathrm { C a t } ( F _ { x , y } , \\mathrm { P E } ( x , y ) ) , \\quad V _ { x , y } = F _ { x , y } , } \\end{array}\n$$",
|
| 549 |
+
"text_format": "latex",
|
| 550 |
+
"bbox": [
|
| 551 |
+
297,
|
| 552 |
+
426,
|
| 553 |
+
691,
|
| 554 |
+
465
|
| 555 |
+
],
|
| 556 |
+
"page_idx": 6
|
| 557 |
+
},
|
| 558 |
+
{
|
| 559 |
+
"type": "text",
|
| 560 |
+
"text": "where $F _ { x , y } \\in \\mathbb { R } ^ { D }$ is the image feature at position $( x , y )$ and $\\cdot$ is an element-wise multiplication. Both the positional embeddings in queries and keys are generated based on 2D coordinates, making it more consistent to compare the positional similarity, as in previous works (Meng et al., 2021; Wang et al., 2021). ",
|
| 561 |
+
"bbox": [
|
| 562 |
+
174,
|
| 563 |
+
477,
|
| 564 |
+
825,
|
| 565 |
+
535
|
| 566 |
+
],
|
| 567 |
+
"page_idx": 6
|
| 568 |
+
},
|
| 569 |
+
{
|
| 570 |
+
"type": "text",
|
| 571 |
+
"text": "4.3 ANCHOR UPDATE ",
|
| 572 |
+
"text_level": 1,
|
| 573 |
+
"bbox": [
|
| 574 |
+
174,
|
| 575 |
+
553,
|
| 576 |
+
338,
|
| 577 |
+
568
|
| 578 |
+
],
|
| 579 |
+
"page_idx": 6
|
| 580 |
+
},
|
| 581 |
+
{
|
| 582 |
+
"type": "text",
|
| 583 |
+
"text": "Using coordinates as queries for learning makes it possible to update them layer by layer. In contrast, for queries of high dimensional embeddings, such as in DETR (Carion et al., 2020) and Conditional DETR (Meng et al., 2021), it is hard to perform layer-by-layer query refinement, because it is unclear how to convert an updated anchor back to a high-dimensional query embedding. ",
|
| 584 |
+
"bbox": [
|
| 585 |
+
174,
|
| 586 |
+
579,
|
| 587 |
+
825,
|
| 588 |
+
637
|
| 589 |
+
],
|
| 590 |
+
"page_idx": 6
|
| 591 |
+
},
|
| 592 |
+
{
|
| 593 |
+
"type": "text",
|
| 594 |
+
"text": "Following the previous practice (Zhu et al., 2021; Wang et al., 2021), we update anchors in each layer after predicting relative positions $( \\Delta x , \\Delta y , \\Delta w , \\Delta h )$ by a prediction head, as shown in Fig. 5. Note that all prediction heads in different layers share the same parameters. ",
|
| 595 |
+
"bbox": [
|
| 596 |
+
174,
|
| 597 |
+
642,
|
| 598 |
+
825,
|
| 599 |
+
685
|
| 600 |
+
],
|
| 601 |
+
"page_idx": 6
|
| 602 |
+
},
|
| 603 |
+
{
|
| 604 |
+
"type": "text",
|
| 605 |
+
"text": "4.4 WIDTH & HEIGHT-MODULATED GAUSSIAN KERNEL ",
|
| 606 |
+
"text_level": 1,
|
| 607 |
+
"bbox": [
|
| 608 |
+
173,
|
| 609 |
+
704,
|
| 610 |
+
578,
|
| 611 |
+
718
|
| 612 |
+
],
|
| 613 |
+
"page_idx": 6
|
| 614 |
+
},
|
| 615 |
+
{
|
| 616 |
+
"type": "image",
|
| 617 |
+
"img_path": "images/fcdeaa2aa901b6a35aa4e492fecce481aa9deae8904cb6c9fdef0f90b8f3de4a.jpg",
|
| 618 |
+
"image_caption": [
|
| 619 |
+
"Figure 6: Positional attention maps modulated by width and height. "
|
| 620 |
+
],
|
| 621 |
+
"image_footnote": [],
|
| 622 |
+
"bbox": [
|
| 623 |
+
235,
|
| 624 |
+
752,
|
| 625 |
+
450,
|
| 626 |
+
813
|
| 627 |
+
],
|
| 628 |
+
"page_idx": 6
|
| 629 |
+
},
|
| 630 |
+
{
|
| 631 |
+
"type": "image",
|
| 632 |
+
"img_path": "images/3804bac0a785bfa9964038b4f01abee75a5ac656b54bb3c3ed120611d8cfdf55.jpg",
|
| 633 |
+
"image_caption": [
|
| 634 |
+
"Figure 7: Positional attention maps with different temperatures. "
|
| 635 |
+
],
|
| 636 |
+
"image_footnote": [],
|
| 637 |
+
"bbox": [
|
| 638 |
+
542,
|
| 639 |
+
752,
|
| 640 |
+
759,
|
| 641 |
+
813
|
| 642 |
+
],
|
| 643 |
+
"page_idx": 6
|
| 644 |
+
},
|
| 645 |
+
{
|
| 646 |
+
"type": "text",
|
| 647 |
+
"text": "Traditional positional attention maps are used as a Gaussian-like prior, as shown in Fig. 6 left. But the prior is simply assumed isotropic and fixed size for all objects, leaving their scale information (width and height) ignored. To improve the positional prior, we propose to inject the scale information into the attention maps. ",
|
| 648 |
+
"bbox": [
|
| 649 |
+
173,
|
| 650 |
+
867,
|
| 651 |
+
825,
|
| 652 |
+
924
|
| 653 |
+
],
|
| 654 |
+
"page_idx": 6
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"type": "text",
|
| 658 |
+
"text": "The query-to-key similarity in the original positional attention map is computed as the sum of dot products of two coordinate encodings: ",
|
| 659 |
+
"bbox": [
|
| 660 |
+
173,
|
| 661 |
+
103,
|
| 662 |
+
823,
|
| 663 |
+
132
|
| 664 |
+
],
|
| 665 |
+
"page_idx": 7
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"type": "equation",
|
| 669 |
+
"img_path": "images/92f3db0548ac57d53d716adc1b0f475ce573d37b41df79738d1e9d553c045df6.jpg",
|
| 670 |
+
"text": "$$\n{ \\mathrm { A t t n } } ( ( x , y ) , ( x _ { \\mathrm { r e f } } , y _ { \\mathrm { r e f } } ) ) = ( { \\mathrm { P E } } ( x ) \\cdot { \\mathrm { P E } } ( x _ { \\mathrm { r e f } } ) + { \\mathrm { P E } } ( y ) \\cdot { \\mathrm { P E } } ( y _ { \\mathrm { r e f } } ) ) / { \\sqrt { D } } ,\n$$",
|
| 671 |
+
"text_format": "latex",
|
| 672 |
+
"bbox": [
|
| 673 |
+
266,
|
| 674 |
+
136,
|
| 675 |
+
728,
|
| 676 |
+
156
|
| 677 |
+
],
|
| 678 |
+
"page_idx": 7
|
| 679 |
+
},
|
| 680 |
+
{
|
| 681 |
+
"type": "text",
|
| 682 |
+
"text": "where $1 / \\sqrt { D }$ is used to rescale the value as suggested in Vaswani et al. (2017). We modulate the positional attention maps (before softmax) by dividing the relative anchor width and height from its $x$ part and $y$ part separately to smooth the Gaussian prior to better match with objects of different scales: ",
|
| 683 |
+
"bbox": [
|
| 684 |
+
174,
|
| 685 |
+
161,
|
| 686 |
+
826,
|
| 687 |
+
218
|
| 688 |
+
],
|
| 689 |
+
"page_idx": 7
|
| 690 |
+
},
|
| 691 |
+
{
|
| 692 |
+
"type": "equation",
|
| 693 |
+
"img_path": "images/6b1136f27f6a89111e6b0872c0ce6fbc898f8642ae01a6af0223a9ec0bae5234.jpg",
|
| 694 |
+
"text": "$$\n{ \\bf M o d u l a t e A t t m } ( ( x , y ) , ( x _ { \\mathrm { r e f } } , y _ { \\mathrm { r e f } } ) ) = ( { \\bf P E } ( x ) \\cdot { \\bf P E } ( x _ { \\mathrm { r e f } } ) \\frac { w _ { q , \\mathrm { r e f } } } { w _ { q } } + { \\bf P E } ( y ) \\cdot { \\bf P E } ( y _ { \\mathrm { r e f } } ) \\frac { h _ { q , \\mathrm { r e f } } } { h _ { q } } ) / \\sqrt { D } ,\n$$",
|
| 695 |
+
"text_format": "latex",
|
| 696 |
+
"bbox": [
|
| 697 |
+
186,
|
| 698 |
+
237,
|
| 699 |
+
787,
|
| 700 |
+
271
|
| 701 |
+
],
|
| 702 |
+
"page_idx": 7
|
| 703 |
+
},
|
| 704 |
+
{
|
| 705 |
+
"type": "text",
|
| 706 |
+
"text": "where $w _ { q }$ and $h _ { q }$ are the width and height of the anchor $A _ { q }$ , and $w _ { q , \\mathrm { r e f } }$ and $h _ { q , \\mathrm { r e f } }$ are the reference width and height that are calculated by: ",
|
| 707 |
+
"bbox": [
|
| 708 |
+
176,
|
| 709 |
+
275,
|
| 710 |
+
828,
|
| 711 |
+
303
|
| 712 |
+
],
|
| 713 |
+
"page_idx": 7
|
| 714 |
+
},
|
| 715 |
+
{
|
| 716 |
+
"type": "equation",
|
| 717 |
+
"img_path": "images/76c433afc2de4b2fa36598cdffc2804fc08bdfe9c0fb5db25ac5e61abc024b8b.jpg",
|
| 718 |
+
"text": "$$\nw _ { q , \\mathrm { r e f } } , h _ { q , \\mathrm { r e f } } = \\sigma ( \\mathbf { M L P } ( C _ { q } ) ) .\n$$",
|
| 719 |
+
"text_format": "latex",
|
| 720 |
+
"bbox": [
|
| 721 |
+
401,
|
| 722 |
+
308,
|
| 723 |
+
596,
|
| 724 |
+
325
|
| 725 |
+
],
|
| 726 |
+
"page_idx": 7
|
| 727 |
+
},
|
| 728 |
+
{
|
| 729 |
+
"type": "text",
|
| 730 |
+
"text": "This modulated positional attention helps us extract features of objects with different widths and heights, and the visualizations of modulated attentions are shown in Fig. 6. ",
|
| 731 |
+
"bbox": [
|
| 732 |
+
173,
|
| 733 |
+
329,
|
| 734 |
+
823,
|
| 735 |
+
357
|
| 736 |
+
],
|
| 737 |
+
"page_idx": 7
|
| 738 |
+
},
|
| 739 |
+
{
|
| 740 |
+
"type": "text",
|
| 741 |
+
"text": "4.5 TEMPERATURE TUNING",
|
| 742 |
+
"text_level": 1,
|
| 743 |
+
"bbox": [
|
| 744 |
+
174,
|
| 745 |
+
373,
|
| 746 |
+
380,
|
| 747 |
+
387
|
| 748 |
+
],
|
| 749 |
+
"page_idx": 7
|
| 750 |
+
},
|
| 751 |
+
{
|
| 752 |
+
"type": "text",
|
| 753 |
+
"text": "For position encoding, we use the sinusoidal function (Vaswani et al., 2017), which is defined as: ",
|
| 754 |
+
"bbox": [
|
| 755 |
+
173,
|
| 756 |
+
398,
|
| 757 |
+
810,
|
| 758 |
+
414
|
| 759 |
+
],
|
| 760 |
+
"page_idx": 7
|
| 761 |
+
},
|
| 762 |
+
{
|
| 763 |
+
"type": "equation",
|
| 764 |
+
"img_path": "images/ffe251c5a74ac39ac55f7e642d4487d7a2845e58947c33798e478174bbfef6d1.jpg",
|
| 765 |
+
"text": "$$\n\\mathrm { P E } ( x ) _ { 2 i } = \\sin ( \\frac { x } { T ^ { 2 i / D } } ) , \\quad \\mathrm { P E } ( x ) _ { 2 i + 1 } = \\cos ( \\frac { x } { T ^ { 2 i / D } } ) ,\n$$",
|
| 766 |
+
"text_format": "latex",
|
| 767 |
+
"bbox": [
|
| 768 |
+
320,
|
| 769 |
+
417,
|
| 770 |
+
676,
|
| 771 |
+
445
|
| 772 |
+
],
|
| 773 |
+
"page_idx": 7
|
| 774 |
+
},
|
| 775 |
+
{
|
| 776 |
+
"type": "text",
|
| 777 |
+
"text": "where $T$ is a hand-design temperature, and the superscript $2 i$ and $2 i + 1$ denote the indices in the encoded vectors. The temperature $T$ in Eq. (8) influences the size of positional priors, as shown in Fig. 7. A larger $T$ results in a more flattened attention map, and vice versa. Note that the temperature $T$ is hard-coded in (Vaswani et al., 2017) as 10000 for natural language processing, in which the values of $x$ are integers representing each word’s position in a sentence. However, in DETR, the values of $x$ are floats between 0 and 1 representing bounding box coordinates. Hence a different temperature is highly desired for vision tasks. In this work, we empirically choose $T = 2 0$ in all our models. ",
|
| 778 |
+
"bbox": [
|
| 779 |
+
173,
|
| 780 |
+
448,
|
| 781 |
+
825,
|
| 782 |
+
559
|
| 783 |
+
],
|
| 784 |
+
"page_idx": 7
|
| 785 |
+
},
|
| 786 |
+
{
|
| 787 |
+
"type": "text",
|
| 788 |
+
"text": "5 EXPERIMENTS ",
|
| 789 |
+
"text_level": 1,
|
| 790 |
+
"bbox": [
|
| 791 |
+
174,
|
| 792 |
+
574,
|
| 793 |
+
326,
|
| 794 |
+
590
|
| 795 |
+
],
|
| 796 |
+
"page_idx": 7
|
| 797 |
+
},
|
| 798 |
+
{
|
| 799 |
+
"type": "text",
|
| 800 |
+
"text": "We provide the training details in Appendix A. ",
|
| 801 |
+
"bbox": [
|
| 802 |
+
176,
|
| 803 |
+
601,
|
| 804 |
+
480,
|
| 805 |
+
616
|
| 806 |
+
],
|
| 807 |
+
"page_idx": 7
|
| 808 |
+
},
|
| 809 |
+
{
|
| 810 |
+
"type": "text",
|
| 811 |
+
"text": "5.1 MAIN RESULTS ",
|
| 812 |
+
"text_level": 1,
|
| 813 |
+
"bbox": [
|
| 814 |
+
176,
|
| 815 |
+
632,
|
| 816 |
+
323,
|
| 817 |
+
647
|
| 818 |
+
],
|
| 819 |
+
"page_idx": 7
|
| 820 |
+
},
|
| 821 |
+
{
|
| 822 |
+
"type": "text",
|
| 823 |
+
"text": "Table 2 shows our main results on the COCO 2017 validation set. We compare our proposed DABDETR with DETR (Carion et al., 2020), Faster RCNN (Ren et al., 2017), Anchor DETR (Wang et al., 2021), SMCA (Gao et al., 2021), Deformable DETR (Zhu et al., 2021), TSP (Sun et al., 2020), and Conditional DETR (Meng et al., 2021). We showed two variations of our model: standard models and models marked with superscript ∗ that have 3 pattern embeddings (Wang et al., 2021). Our standard models outperform Conditional DETR with a large margin. We notice that our model introduces a slight increase of GFLOPs. GFLOPs may differ depending on the calculation scripts and we use the results reported by the authors in Table 2. Actually, we find in our tests that the GFLOPs of our standard models are nearly the same as the corresponding Conditional DETR models based on our GFLOPs calculation scripts, hence our model still has advantages over previous work under the same settings. When using pattern embeddings, our DAB-DETR with ∗ outperforms previous DETR-like methods on all four backbones with a large margin, even better than multiscale architectures. It verifies the correctness of our analysis and the effectiveness of our design. ",
|
| 824 |
+
"bbox": [
|
| 825 |
+
174,
|
| 826 |
+
659,
|
| 827 |
+
825,
|
| 828 |
+
839
|
| 829 |
+
],
|
| 830 |
+
"page_idx": 7
|
| 831 |
+
},
|
| 832 |
+
{
|
| 833 |
+
"type": "text",
|
| 834 |
+
"text": "5.2 ABLATIONS ",
|
| 835 |
+
"text_level": 1,
|
| 836 |
+
"bbox": [
|
| 837 |
+
174,
|
| 838 |
+
856,
|
| 839 |
+
297,
|
| 840 |
+
869
|
| 841 |
+
],
|
| 842 |
+
"page_idx": 7
|
| 843 |
+
},
|
| 844 |
+
{
|
| 845 |
+
"type": "text",
|
| 846 |
+
"text": "Table 3 shows the effectiveness of each component in our model. We find that all modules we proposed contribute remarkably to our final results. The anchor box formulation improves the performance from $4 4 . 0 \\%$ AP to $4 \\dot { 5 } . 0 \\%$ AP compared with the anchor point formulation (compare Row ",
|
| 847 |
+
"bbox": [
|
| 848 |
+
176,
|
| 849 |
+
882,
|
| 850 |
+
823,
|
| 851 |
+
924
|
| 852 |
+
],
|
| 853 |
+
"page_idx": 7
|
| 854 |
+
},
|
| 855 |
+
{
|
| 856 |
+
"type": "table",
|
| 857 |
+
"img_path": "images/36fc15af4c380b49e7e92319c659607005791eb61a7e22e81dbd58b270229f8a.jpg",
|
| 858 |
+
"table_caption": [
|
| 859 |
+
"Table 2: Results for our DAB-DETR and other detection models. All DETR-like models except DETR use 300 queries, while DETR uses 100. The models with superscript ∗ use 3 pattern embeddings as in Anchor DETR (Wang et al., 2021). We also provide stronger results of our DAB-DETR in Appendix G and Appendix C. "
|
| 860 |
+
],
|
| 861 |
+
"table_footnote": [],
|
| 862 |
+
"table_body": "<table><tr><td>Model</td><td>MultiScale</td><td>#epochs</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>GFLOPs</td><td>Params</td></tr><tr><td>DETR-R50</td><td></td><td>500</td><td>42.0</td><td>62.4</td><td>44.2</td><td>20.5</td><td>45.8</td><td>61.1</td><td>86</td><td>41M</td></tr><tr><td>Faster RCNN-FPN-R50</td><td></td><td>108</td><td>42.0</td><td>62.1</td><td>45.5</td><td>26.6</td><td>45.5</td><td>53.4</td><td>180</td><td>42M</td></tr><tr><td>Anchor DETR-R50*</td><td></td><td>50</td><td>42.1</td><td>63.1</td><td>44.9</td><td>22.3</td><td>46.2</td><td>60.0</td><td>1</td><td>39M</td></tr><tr><td>Conditional DETR-R50</td><td></td><td>50</td><td>40.9</td><td>61.8</td><td>43.3</td><td>20.8</td><td>44.6</td><td>59.2</td><td>90</td><td>44M</td></tr><tr><td>DAB-DETR-R50</td><td></td><td>50</td><td>42.2</td><td>63.1</td><td>44.7</td><td>21.5</td><td>45.7</td><td>60.3</td><td>94</td><td>44M</td></tr><tr><td>DAB-DETR-R50*</td><td></td><td>50</td><td>42.6</td><td>63.2</td><td>45.6</td><td>21.8</td><td>46.2</td><td>61.1</td><td>100</td><td>44M</td></tr><tr><td>DETR-DC5-R50</td><td></td><td>500</td><td>43.3</td><td>63.1</td><td>45.9</td><td>22.5</td><td>47.3</td><td>61.1</td><td>187</td><td>41M</td></tr><tr><td>Deformable DETR-R50</td><td>√</td><td>50</td><td>43.8</td><td>62.6</td><td>47.7</td><td>26.4</td><td>47.1</td><td>58.0</td><td>173</td><td>40M</td></tr><tr><td>SMCA-R50</td><td>√</td><td>50</td><td>43.7</td><td>63.6</td><td>47.2</td><td>24.2</td><td>47.0</td><td>60.4</td><td>152</td><td>40M</td></tr><tr><td>TSP-RCNN-R50</td><td>√</td><td>96</td><td>45.0</td><td>64.5</td><td>49.6</td><td>29.7</td><td>47.7</td><td>58.0</td><td>188</td><td>1</td></tr><tr><td>Anchor DETR-DC5-R50*</td><td></td><td>50</td><td>44.2</td><td>64.7</td><td>47.5</td><td>24.7</td><td>48.2</td><td>60.6</td><td>151</td><td>39M</td></tr><tr><td>Conditional DETR-DC5-R50</td><td></td><td>50</td><td>43.8</td><td>64.4</td><td>46.7</td><td>24.0</td><td>47.6</td><td>60.7</td><td>195</td><td>44M</td></tr><tr><td>DAB-DETR-DC5-R50</td><td></td><td>50</td><td>44.5</td><td>65.1</td><td>47.7</td><td>25.3</td><td>48.2</td><td>62.3</td><td>202</td><td>44M</td></tr><tr><td>DAB-DETR-DC5-R50*</td><td></td><td>50</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td><td>216</td><td>44M</td></tr><tr><td>DETR-R101</td><td></td><td>500</td><td>43.5</td><td>63.8</td><td>46.4</td><td>21.9</td><td>48.0</td><td>61.8</td><td>152</td><td>60M</td></tr><tr><td>Faster RCNN-FPN-R101</td><td></td><td>108</td><td>44.0</td><td>63.9</td><td>47.8</td><td>27.2</td><td>48.1</td><td>56.0</td><td>246</td><td>60M</td></tr><tr><td>Anchor DETR-R101*</td><td></td><td>50</td><td>43.5</td><td>64.3</td><td>46.6</td><td>23.2</td><td>47.7</td><td>61.4</td><td>1</td><td>58M</td></tr><tr><td>Conditional DETR-R101</td><td></td><td>50</td><td>42.8</td><td>63.7</td><td>46.0</td><td>21.7</td><td>46.6</td><td>60.9</td><td>156</td><td>63M</td></tr><tr><td>DAB-DETR-R101</td><td></td><td>50</td><td>43.5</td><td>63.9</td><td>46.6</td><td>23.6</td><td>47.3</td><td>61.5</td><td>174</td><td>63M</td></tr><tr><td>DAB-DETR-R101*</td><td></td><td>50</td><td>44.1</td><td>64.7</td><td>47.2</td><td>24.1</td><td>48.2</td><td>62.9</td><td>179</td><td>63M</td></tr><tr><td>DETR-DC5-R101</td><td></td><td>500</td><td>44.9</td><td>64.7</td><td>47.7</td><td>23.7</td><td>49.5</td><td>62.3</td><td>253</td><td>60M</td></tr><tr><td>TSP-RCNN-R101</td><td>√</td><td>96</td><td>46.5</td><td>66.0</td><td>51.2</td><td>29.9</td><td>49.7</td><td>59.2</td><td>254</td><td>1</td></tr><tr><td>SMCA-R101</td><td>√</td><td>50</td><td>44.4</td><td>65.2</td><td>48.0</td><td>24.3</td><td>48.5</td><td>61.0</td><td>218</td><td>50M</td></tr><tr><td>Anchor DETR-R101*</td><td></td><td>50</td><td>45.1</td><td>65.7</td><td>48.8</td><td>25.8</td><td>49.4</td><td>61.6</td><td>1</td><td>58M</td></tr><tr><td>Conditional DETR-DC5-R101</td><td></td><td>50</td><td>45.0</td><td>65.5</td><td>48.4</td><td>26.1</td><td>48.9</td><td>62.8</td><td>262</td><td>63M</td></tr><tr><td>DAB-DETR-DC5-R101</td><td></td><td>50</td><td>45.8</td><td>65.9</td><td>49.3</td><td>27.0</td><td>49.8</td><td>63.8</td><td>282</td><td>63M</td></tr><tr><td>DAB-DETR-DC5-R101*</td><td></td><td>50</td><td>46.6</td><td>67.0</td><td>50.2</td><td>28.1</td><td>50.5</td><td>64.1</td><td>296</td><td>63M</td></tr></table>",
|
| 863 |
+
"bbox": [
|
| 864 |
+
204,
|
| 865 |
+
102,
|
| 866 |
+
790,
|
| 867 |
+
446
|
| 868 |
+
],
|
| 869 |
+
"page_idx": 8
|
| 870 |
+
},
|
| 871 |
+
{
|
| 872 |
+
"type": "table",
|
| 873 |
+
"img_path": "images/c44dfafb2184421e294e3285b0e6487db6ee084b3bff12f3db33aaca86d43da1.jpg",
|
| 874 |
+
"table_caption": [
|
| 875 |
+
"Table 3: Ablation results for our DAB-DETR. All models are tested over ResNet-50-DC5 backbone and the other parameters are the same as our default settings. "
|
| 876 |
+
],
|
| 877 |
+
"table_footnote": [],
|
| 878 |
+
"table_body": "<table><tr><td>#RoW</td><td>Anchor Box (4D) vs.Point (2D)Anchor Updatewh-Modulated AttentionTemperature Tuning</td><td></td><td></td><td></td><td>AP</td></tr><tr><td>1</td><td>4D</td><td>√</td><td>√</td><td>√</td><td>45.7</td></tr><tr><td>2</td><td>4D</td><td></td><td>√</td><td>√</td><td>44.0</td></tr><tr><td>3</td><td>4D</td><td>√</td><td></td><td>√</td><td>45.0</td></tr><tr><td>4</td><td>2D</td><td>√</td><td></td><td>√</td><td>44.0</td></tr><tr><td>5</td><td>4D</td><td>√</td><td>√</td><td></td><td>44.4</td></tr></table>",
|
| 879 |
+
"bbox": [
|
| 880 |
+
253,
|
| 881 |
+
532,
|
| 882 |
+
741,
|
| 883 |
+
602
|
| 884 |
+
],
|
| 885 |
+
"page_idx": 8
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"type": "text",
|
| 889 |
+
"text": "3 and Row 4) and the anchor update introduces $1 . 7 \\%$ AP improvement (compare Row 1 and Row \n2), which demonstrates the effectiveness of dynamic anchor box design. ",
|
| 890 |
+
"bbox": [
|
| 891 |
+
173,
|
| 892 |
+
671,
|
| 893 |
+
821,
|
| 894 |
+
700
|
| 895 |
+
],
|
| 896 |
+
"page_idx": 8
|
| 897 |
+
},
|
| 898 |
+
{
|
| 899 |
+
"type": "text",
|
| 900 |
+
"text": "After removing modulated attention and temperature tuning, the model performance drops to $4 5 . 0 \\%$ (compare Row 1 and Row 3) and $4 4 . 4 \\%$ (compare Row 1 and Row 5), respectively. Hence finegrained tuning of positional attentions is of great importance for improving the detection performance as well. ",
|
| 901 |
+
"bbox": [
|
| 902 |
+
174,
|
| 903 |
+
707,
|
| 904 |
+
823,
|
| 905 |
+
763
|
| 906 |
+
],
|
| 907 |
+
"page_idx": 8
|
| 908 |
+
},
|
| 909 |
+
{
|
| 910 |
+
"type": "text",
|
| 911 |
+
"text": "6 CONCLUSION ",
|
| 912 |
+
"text_level": 1,
|
| 913 |
+
"bbox": [
|
| 914 |
+
176,
|
| 915 |
+
790,
|
| 916 |
+
318,
|
| 917 |
+
806
|
| 918 |
+
],
|
| 919 |
+
"page_idx": 8
|
| 920 |
+
},
|
| 921 |
+
{
|
| 922 |
+
"type": "text",
|
| 923 |
+
"text": "We have presented in this paper a novel query formulation using dynamic anchor boxes for DETR and offered a deeper understanding of the role of queries in DETR. Using anchor boxes as queries leads to several advantages, including a better positional prior with temperature tuning, sizemodulated attention to account for objects of different scales, and iterative anchor update for improving anchor estimate gradually. Such a design makes it clear that queries in DETR can be implemented as performing soft ROI pooling layer by layer in a cascade manner. Extensive experiments were conducted and effectively confirmed our analysis and verified our algorithm design. ",
|
| 924 |
+
"bbox": [
|
| 925 |
+
174,
|
| 926 |
+
825,
|
| 927 |
+
823,
|
| 928 |
+
924
|
| 929 |
+
],
|
| 930 |
+
"page_idx": 8
|
| 931 |
+
},
|
| 932 |
+
{
|
| 933 |
+
"type": "text",
|
| 934 |
+
"text": "ACKNOWLEDGEMENTS ",
|
| 935 |
+
"text_level": 1,
|
| 936 |
+
"bbox": [
|
| 937 |
+
176,
|
| 938 |
+
103,
|
| 939 |
+
367,
|
| 940 |
+
117
|
| 941 |
+
],
|
| 942 |
+
"page_idx": 9
|
| 943 |
+
},
|
| 944 |
+
{
|
| 945 |
+
"type": "text",
|
| 946 |
+
"text": "This work was supported by the National Key Research and Development Program of China (2020AAA0104304, 2020AAA0106000, 2020AAA0106302), NSFC Projects (Nos. 61620106010, 62061136001, 61621136008, 62076147, U19B2034, U1811461, U19A2081), Beijing NSF Project (No. JQ19016), Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Alibaba Joint Research Program, Tsinghua Institute for Guo Qiang, Tsinghua-OPPO Joint Research Center for Future Terminal Technology. ",
|
| 947 |
+
"bbox": [
|
| 948 |
+
174,
|
| 949 |
+
133,
|
| 950 |
+
825,
|
| 951 |
+
218
|
| 952 |
+
],
|
| 953 |
+
"page_idx": 9
|
| 954 |
+
},
|
| 955 |
+
{
|
| 956 |
+
"type": "text",
|
| 957 |
+
"text": "We thank all anonymous reviewers for their valuable comments and suggestions, especially the instructive questions from Reviewer 3. ",
|
| 958 |
+
"bbox": [
|
| 959 |
+
176,
|
| 960 |
+
224,
|
| 961 |
+
823,
|
| 962 |
+
252
|
| 963 |
+
],
|
| 964 |
+
"page_idx": 9
|
| 965 |
+
},
|
| 966 |
+
{
|
| 967 |
+
"type": "text",
|
| 968 |
+
"text": "ETHICS STATEMENT ",
|
| 969 |
+
"text_level": 1,
|
| 970 |
+
"bbox": [
|
| 971 |
+
176,
|
| 972 |
+
273,
|
| 973 |
+
343,
|
| 974 |
+
290
|
| 975 |
+
],
|
| 976 |
+
"page_idx": 9
|
| 977 |
+
},
|
| 978 |
+
{
|
| 979 |
+
"type": "text",
|
| 980 |
+
"text": "Object detection is a fundamental task in computer vision with wide applications. Hence any improvement of this field will yield lots of impacts. To visually perceive and interact with the environment, autonomous vehicles highly depend on this technique and will benefit from any of its improvement. It has also led to advances in medical imaging, word recognition, instance segmentation on natural images, and so on. Therefore a failure in this model could affect many tasks. Our study provides a deeper understanding of the roles of queries in DETR and improves the interpretability of this important submodule in the end-to-end Transformer-based detection framework. ",
|
| 981 |
+
"bbox": [
|
| 982 |
+
174,
|
| 983 |
+
306,
|
| 984 |
+
825,
|
| 985 |
+
402
|
| 986 |
+
],
|
| 987 |
+
"page_idx": 9
|
| 988 |
+
},
|
| 989 |
+
{
|
| 990 |
+
"type": "text",
|
| 991 |
+
"text": "As our model relies on deep neural networks, it can be attacked by adversarial examples. Similarly, as it relies on training data, it may produce biased results induced from training samples. These are common problems in deep learning and our community is working together to improve them. Finally, it is worth noting that detection models, especially face or human detection models, might pose a threat to people’s privacy and security if used by someone up to no good. ",
|
| 992 |
+
"bbox": [
|
| 993 |
+
174,
|
| 994 |
+
410,
|
| 995 |
+
825,
|
| 996 |
+
479
|
| 997 |
+
],
|
| 998 |
+
"page_idx": 9
|
| 999 |
+
},
|
| 1000 |
+
{
|
| 1001 |
+
"type": "text",
|
| 1002 |
+
"text": "REPRODUCIBILITY STATEMENT ",
|
| 1003 |
+
"text_level": 1,
|
| 1004 |
+
"bbox": [
|
| 1005 |
+
176,
|
| 1006 |
+
501,
|
| 1007 |
+
437,
|
| 1008 |
+
517
|
| 1009 |
+
],
|
| 1010 |
+
"page_idx": 9
|
| 1011 |
+
},
|
| 1012 |
+
{
|
| 1013 |
+
"type": "text",
|
| 1014 |
+
"text": "We confirm the reproducibility of the results. We have released the source code on Github at https://github.com/IDEA-opensource/DAB-DETR with all materials that are needed to reproduce our results. ",
|
| 1015 |
+
"bbox": [
|
| 1016 |
+
174,
|
| 1017 |
+
532,
|
| 1018 |
+
825,
|
| 1019 |
+
574
|
| 1020 |
+
],
|
| 1021 |
+
"page_idx": 9
|
| 1022 |
+
},
|
| 1023 |
+
{
|
| 1024 |
+
"type": "text",
|
| 1025 |
+
"text": "REFERENCES ",
|
| 1026 |
+
"text_level": 1,
|
| 1027 |
+
"bbox": [
|
| 1028 |
+
176,
|
| 1029 |
+
597,
|
| 1030 |
+
285,
|
| 1031 |
+
612
|
| 1032 |
+
],
|
| 1033 |
+
"page_idx": 9
|
| 1034 |
+
},
|
| 1035 |
+
{
|
| 1036 |
+
"type": "text",
|
| 1037 |
+
"text": "Alexey Bochkovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934, 2020. \nNicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pp. 213–229. Springer, 2020. \nXiyang Dai, Yinpeng Chen, Jianwei Yang, Pengchuan Zhang, Lu Yuan, and Lei Zhang. Dynamic detr: End-to-end object detection with dynamic attention. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2988–2997, October 2021. \nPeng Gao, Minghang Zheng, Xiaogang Wang, Jifeng Dai, and Hongsheng Li. Fast convergence of detr with spatially modulated co-attention. arXiv preprint arXiv:2101.07448, 2021. \nZheng Ge, Songtao Liu, Feng Wang, Zeming Li, and Jian Sun. Yolox: Exceeding yolo series in 2021. arXiv preprint arXiv:2107.08430, 2021. \nRoss Girshick. Fast r-cnn. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1440–1448, 2015. \nKaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1026–1034, 2015. ",
|
| 1038 |
+
"bbox": [
|
| 1039 |
+
171,
|
| 1040 |
+
619,
|
| 1041 |
+
826,
|
| 1042 |
+
925
|
| 1043 |
+
],
|
| 1044 |
+
"page_idx": 9
|
| 1045 |
+
},
|
| 1046 |
+
{
|
| 1047 |
+
"type": "text",
|
| 1048 |
+
"text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016. ",
|
| 1049 |
+
"bbox": [
|
| 1050 |
+
174,
|
| 1051 |
+
103,
|
| 1052 |
+
821,
|
| 1053 |
+
146
|
| 1054 |
+
],
|
| 1055 |
+
"page_idx": 10
|
| 1056 |
+
},
|
| 1057 |
+
{
|
| 1058 |
+
"type": "text",
|
| 1059 |
+
"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. ",
|
| 1060 |
+
"bbox": [
|
| 1061 |
+
176,
|
| 1062 |
+
155,
|
| 1063 |
+
821,
|
| 1064 |
+
198
|
| 1065 |
+
],
|
| 1066 |
+
"page_idx": 10
|
| 1067 |
+
},
|
| 1068 |
+
{
|
| 1069 |
+
"type": "text",
|
| 1070 |
+
"text": "Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(2):318– 327, 2020. ",
|
| 1071 |
+
"bbox": [
|
| 1072 |
+
173,
|
| 1073 |
+
205,
|
| 1074 |
+
825,
|
| 1075 |
+
248
|
| 1076 |
+
],
|
| 1077 |
+
"page_idx": 10
|
| 1078 |
+
},
|
| 1079 |
+
{
|
| 1080 |
+
"type": "text",
|
| 1081 |
+
"text": "Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2018. ",
|
| 1082 |
+
"bbox": [
|
| 1083 |
+
173,
|
| 1084 |
+
257,
|
| 1085 |
+
820,
|
| 1086 |
+
287
|
| 1087 |
+
],
|
| 1088 |
+
"page_idx": 10
|
| 1089 |
+
},
|
| 1090 |
+
{
|
| 1091 |
+
"type": "text",
|
| 1092 |
+
"text": "Depu Meng, Xiaokang Chen, Zejia Fan, Gang Zeng, Houqiang Li, Yuhui Yuan, Lei Sun, and Jingdong Wang. Conditional detr for fast training convergence. arXiv preprint arXiv:2108.06152, 2021. ",
|
| 1093 |
+
"bbox": [
|
| 1094 |
+
174,
|
| 1095 |
+
295,
|
| 1096 |
+
825,
|
| 1097 |
+
338
|
| 1098 |
+
],
|
| 1099 |
+
"page_idx": 10
|
| 1100 |
+
},
|
| 1101 |
+
{
|
| 1102 |
+
"type": "text",
|
| 1103 |
+
"text": "Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi. You only look once: Unified, real-time object detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 779–788, 2016. ",
|
| 1104 |
+
"bbox": [
|
| 1105 |
+
173,
|
| 1106 |
+
347,
|
| 1107 |
+
825,
|
| 1108 |
+
390
|
| 1109 |
+
],
|
| 1110 |
+
"page_idx": 10
|
| 1111 |
+
},
|
| 1112 |
+
{
|
| 1113 |
+
"type": "text",
|
| 1114 |
+
"text": "Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6):1137–1149, 2017. ",
|
| 1115 |
+
"bbox": [
|
| 1116 |
+
173,
|
| 1117 |
+
398,
|
| 1118 |
+
825,
|
| 1119 |
+
441
|
| 1120 |
+
],
|
| 1121 |
+
"page_idx": 10
|
| 1122 |
+
},
|
| 1123 |
+
{
|
| 1124 |
+
"type": "text",
|
| 1125 |
+
"text": "Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, and Silvio Savarese. Generalized intersection over union: A metric and a loss for bounding box regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 658–666, 2019. ",
|
| 1126 |
+
"bbox": [
|
| 1127 |
+
173,
|
| 1128 |
+
450,
|
| 1129 |
+
825,
|
| 1130 |
+
507
|
| 1131 |
+
],
|
| 1132 |
+
"page_idx": 10
|
| 1133 |
+
},
|
| 1134 |
+
{
|
| 1135 |
+
"type": "text",
|
| 1136 |
+
"text": "Peize Sun, Rufeng Zhang, Yi Jiang, Tao Kong, Chenfeng Xu, Wei Zhan, Masayoshi Tomizuka, Lei Li, Zehuan Yuan, Changhu Wang, and Ping Luo. Sparse r-cnn: End-to-end object detection with learnable proposals. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14454–14463, 2021. ",
|
| 1137 |
+
"bbox": [
|
| 1138 |
+
173,
|
| 1139 |
+
515,
|
| 1140 |
+
825,
|
| 1141 |
+
573
|
| 1142 |
+
],
|
| 1143 |
+
"page_idx": 10
|
| 1144 |
+
},
|
| 1145 |
+
{
|
| 1146 |
+
"type": "text",
|
| 1147 |
+
"text": "Zhiqing Sun, Shengcao Cao, Yiming Yang, and Kris Kitani. Rethinking transformer-based set prediction for object detection. arXiv preprint arXiv:2011.10881, 2020. ",
|
| 1148 |
+
"bbox": [
|
| 1149 |
+
168,
|
| 1150 |
+
580,
|
| 1151 |
+
823,
|
| 1152 |
+
611
|
| 1153 |
+
],
|
| 1154 |
+
"page_idx": 10
|
| 1155 |
+
},
|
| 1156 |
+
{
|
| 1157 |
+
"type": "text",
|
| 1158 |
+
"text": "Zhi Tian, Chunhua Shen, Hao Chen, and Tong He. Fcos: Fully convolutional one-stage object detection. In 2019 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 9627– 9636, 2019. ",
|
| 1159 |
+
"bbox": [
|
| 1160 |
+
171,
|
| 1161 |
+
618,
|
| 1162 |
+
825,
|
| 1163 |
+
661
|
| 1164 |
+
],
|
| 1165 |
+
"page_idx": 10
|
| 1166 |
+
},
|
| 1167 |
+
{
|
| 1168 |
+
"type": "text",
|
| 1169 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017. ",
|
| 1170 |
+
"bbox": [
|
| 1171 |
+
173,
|
| 1172 |
+
670,
|
| 1173 |
+
825,
|
| 1174 |
+
713
|
| 1175 |
+
],
|
| 1176 |
+
"page_idx": 10
|
| 1177 |
+
},
|
| 1178 |
+
{
|
| 1179 |
+
"type": "text",
|
| 1180 |
+
"text": "Yingming Wang, Xiangyu Zhang, Tong Yang, and Jian Sun. Anchor detr: Query design for transformer-based detector. arXiv preprint arXiv:2109.07107, 2021. ",
|
| 1181 |
+
"bbox": [
|
| 1182 |
+
174,
|
| 1183 |
+
722,
|
| 1184 |
+
823,
|
| 1185 |
+
751
|
| 1186 |
+
],
|
| 1187 |
+
"page_idx": 10
|
| 1188 |
+
},
|
| 1189 |
+
{
|
| 1190 |
+
"type": "text",
|
| 1191 |
+
"text": "Zhuyu Yao, Jiangbo Ai, Boxun Li, and Chi Zhang. Efficient detr: Improving end-to-end object detector with dense prior. arXiv preprint arXiv:2104.01318, 2021. ",
|
| 1192 |
+
"bbox": [
|
| 1193 |
+
174,
|
| 1194 |
+
760,
|
| 1195 |
+
823,
|
| 1196 |
+
789
|
| 1197 |
+
],
|
| 1198 |
+
"page_idx": 10
|
| 1199 |
+
},
|
| 1200 |
+
{
|
| 1201 |
+
"type": "text",
|
| 1202 |
+
"text": "Xingyi Zhou, Dequan Wang, and Philipp Krahenb ¨ uhl. Objects as points. ¨ arXiv preprint arXiv:1904.07850, 2019. ",
|
| 1203 |
+
"bbox": [
|
| 1204 |
+
173,
|
| 1205 |
+
797,
|
| 1206 |
+
825,
|
| 1207 |
+
827
|
| 1208 |
+
],
|
| 1209 |
+
"page_idx": 10
|
| 1210 |
+
},
|
| 1211 |
+
{
|
| 1212 |
+
"type": "text",
|
| 1213 |
+
"text": "Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. In ICLR 2021: The Ninth International Conference on Learning Representations, 2021. ",
|
| 1214 |
+
"bbox": [
|
| 1215 |
+
174,
|
| 1216 |
+
835,
|
| 1217 |
+
825,
|
| 1218 |
+
878
|
| 1219 |
+
],
|
| 1220 |
+
"page_idx": 10
|
| 1221 |
+
},
|
| 1222 |
+
{
|
| 1223 |
+
"type": "text",
|
| 1224 |
+
"text": "Appendix for DAB-DETR ",
|
| 1225 |
+
"text_level": 1,
|
| 1226 |
+
"bbox": [
|
| 1227 |
+
390,
|
| 1228 |
+
101,
|
| 1229 |
+
607,
|
| 1230 |
+
119
|
| 1231 |
+
],
|
| 1232 |
+
"page_idx": 11
|
| 1233 |
+
},
|
| 1234 |
+
{
|
| 1235 |
+
"type": "text",
|
| 1236 |
+
"text": "A TRAINING DETAILS ",
|
| 1237 |
+
"text_level": 1,
|
| 1238 |
+
"bbox": [
|
| 1239 |
+
176,
|
| 1240 |
+
138,
|
| 1241 |
+
374,
|
| 1242 |
+
156
|
| 1243 |
+
],
|
| 1244 |
+
"page_idx": 11
|
| 1245 |
+
},
|
| 1246 |
+
{
|
| 1247 |
+
"type": "text",
|
| 1248 |
+
"text": "Architecture. Our model is almost the same as DETR which includes a CNN backbone, multiple Transformer (Vaswani et al., 2017) encoders and decoders, and two prediction heads for boxes and labels. We use ImageNet-pretrained ResNet (He et al., 2016) as our backbones, and 6 Transformer encoders and 6 Transformer decoders in our implementations. We follow previous works to report results over four backbones: ResNet-50, ResNet-101, and their $1 6 \\times$ -resolution extensions ResNet50-DC5 and ResNet-101-DC5. As we need to predict boxes and labels in each decoder layer, the MLP networks for box and label predictions share the same parameters across different decoder layers. As inspired by Anchor DETR, we also leverage multiple pattern embeddings to perform multiple predictions at one position and the number of patterns is set as 3 which is the same as Anchor DETR. We also leverage PReLU (He et al., 2015) as our activations. ",
|
| 1249 |
+
"bbox": [
|
| 1250 |
+
174,
|
| 1251 |
+
171,
|
| 1252 |
+
825,
|
| 1253 |
+
310
|
| 1254 |
+
],
|
| 1255 |
+
"page_idx": 11
|
| 1256 |
+
},
|
| 1257 |
+
{
|
| 1258 |
+
"type": "text",
|
| 1259 |
+
"text": "Following Deformable DETR and Conditional DETR, we use 300 anchors as queries. We select 300 predicted boxes and labels with the largest classification logits for evaluation as well. We also use focal loss (Lin et al., 2020) with $\\alpha = 0 . 2 5$ , $\\gamma = 2$ for classification. The same loss terms are used in bipartite matching and final loss calculating, but with different coefficients. Classification loss with coefficient 2.0 is used in bipartite matching but 1.0 in the final loss. L1 loss with coefficient 5.0 and GIOU loss (Rezatofighi et al., 2019) with coefficient 2.0 are consistent in both the matching and the final loss calculation procedures. All models are trained on 16 GPUs with 1 image per GPU and AdamW (Loshchilov & Hutter, 2018) is used for training with weight decay $1 0 ^ { - 4 }$ . The learning rates for backbone and other modules are set to $1 0 ^ { - 5 }$ and $1 0 ^ { - 4 }$ , respectively. We train our models for 50 epochs and drop the learning rate by 0.1 after 40 epochs. All models are trained on Nvidia A100 GPU. We search hyperparameters with batch size 64 and all results in our paper are reported with batch size 16. For better reproducing our results, we provide the memory needed and batch size/GPU in Table 4. ",
|
| 1260 |
+
"bbox": [
|
| 1261 |
+
174,
|
| 1262 |
+
318,
|
| 1263 |
+
825,
|
| 1264 |
+
497
|
| 1265 |
+
],
|
| 1266 |
+
"page_idx": 11
|
| 1267 |
+
},
|
| 1268 |
+
{
|
| 1269 |
+
"type": "text",
|
| 1270 |
+
"text": "Dataset. We conduct the experiments on the COCO (Lin et al., 2014) object detection dataset. All models are trained on the train2017 split and evaluated on the val2017 split. ",
|
| 1271 |
+
"bbox": [
|
| 1272 |
+
171,
|
| 1273 |
+
505,
|
| 1274 |
+
823,
|
| 1275 |
+
534
|
| 1276 |
+
],
|
| 1277 |
+
"page_idx": 11
|
| 1278 |
+
},
|
| 1279 |
+
{
|
| 1280 |
+
"type": "table",
|
| 1281 |
+
"img_path": "images/f12752c15ea6cce16a870e9b3aeac47fa6c0e37c6d664267b16685ada703f463.jpg",
|
| 1282 |
+
"table_caption": [
|
| 1283 |
+
"Table 4: GPU memory usage of each model. "
|
| 1284 |
+
],
|
| 1285 |
+
"table_footnote": [],
|
| 1286 |
+
"table_body": "<table><tr><td>Model</td><td>Batch Size/GPU</td><td>GPUMemory (MB)</td></tr><tr><td>DAB-DETR-R50</td><td>2</td><td>6527</td></tr><tr><td>DAB-DETR-R50*</td><td>1</td><td>3573</td></tr><tr><td>DAB-DETR-R50-DC5</td><td>1</td><td>13745</td></tr><tr><td>DAB-DETR-R50-DC5*</td><td>1</td><td>15475</td></tr><tr><td>DAB-DETR-R101</td><td>2</td><td>6913</td></tr><tr><td>DAB-DETR-R101*</td><td>1</td><td>4369</td></tr><tr><td>DAB-DETR-R101-DC5</td><td>1</td><td>13148</td></tr><tr><td>DAB-DETR-R101-DC5*</td><td>1</td><td>16744</td></tr></table>",
|
| 1287 |
+
"bbox": [
|
| 1288 |
+
334,
|
| 1289 |
+
547,
|
| 1290 |
+
658,
|
| 1291 |
+
662
|
| 1292 |
+
],
|
| 1293 |
+
"page_idx": 11
|
| 1294 |
+
},
|
| 1295 |
+
{
|
| 1296 |
+
"type": "text",
|
| 1297 |
+
"text": "B COMPARISON OF DETR-LIKE MODELS ",
|
| 1298 |
+
"text_level": 1,
|
| 1299 |
+
"bbox": [
|
| 1300 |
+
174,
|
| 1301 |
+
717,
|
| 1302 |
+
531,
|
| 1303 |
+
733
|
| 1304 |
+
],
|
| 1305 |
+
"page_idx": 11
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"type": "text",
|
| 1309 |
+
"text": "In this section, we provide a more detailed comparison of DETR-like models, including DETR (Carion et al., 2020), Conditional DETR (Meng et al., 2021), Anchor DETR (Wang et al., 2021), Deformable DETR (Zhu et al., 2021), our proposed DAB-DETR, and DAB-Deformable-DETR. Their model designs are illustrated in Fig. 8. We will discuss the difference between previous models and our models. ",
|
| 1310 |
+
"bbox": [
|
| 1311 |
+
173,
|
| 1312 |
+
750,
|
| 1313 |
+
825,
|
| 1314 |
+
819
|
| 1315 |
+
],
|
| 1316 |
+
"page_idx": 11
|
| 1317 |
+
},
|
| 1318 |
+
{
|
| 1319 |
+
"type": "text",
|
| 1320 |
+
"text": "Anchor DETR (Wang et al., 2021) improves DETR by introducing 2D anchor points, which are updated layer by layer. It shares a similar motivation with our work. But it leaves the object scale information unconsidered and thus cannot modulate the cross-attention to make it adapt to objects of different scales. Moreover, the positional queries in its framework are of high dimension and passed to the self-attention modules in all layers without any adaptation. See the brown-colored part in Fig. 8 (d) for details. This design might be sub-optimal as the self-attention modules cannot leverage the refined anchor points in different layers. ",
|
| 1321 |
+
"bbox": [
|
| 1322 |
+
173,
|
| 1323 |
+
825,
|
| 1324 |
+
825,
|
| 1325 |
+
924
|
| 1326 |
+
],
|
| 1327 |
+
"page_idx": 11
|
| 1328 |
+
},
|
| 1329 |
+
{
|
| 1330 |
+
"type": "text",
|
| 1331 |
+
"text": "Deformable DETR (Zhu et al., 2021) introduces 4D anchor boxes and updates them layer by layer, which is called iterative bounding box refinement in its paper. Its algorithm is mainly developed based on deformable attention, which requires reference points to sample attention points and meanwhile utilizes box width and height to modulate attention areas. However, as iterative bounding box refinement is closely coupled with the special design of deformable attention, it is nontrivial to apply it to general Transformer decoder-based DETR models. This is probably the reason why few works after Deformable DETR adopt this idea. Moreover, the position queries in Deformable DETR are passed to both the self-attention modules and the cross-attention modules in all layers without any adaptation. See the brown-colored part in Fig. 8 (e) for details. As a result, both its self-attention modules and cross-attention modules cannot fully leverage the refined anchor boxes in different layers. ",
|
| 1332 |
+
"bbox": [
|
| 1333 |
+
174,
|
| 1334 |
+
103,
|
| 1335 |
+
825,
|
| 1336 |
+
256
|
| 1337 |
+
],
|
| 1338 |
+
"page_idx": 12
|
| 1339 |
+
},
|
| 1340 |
+
{
|
| 1341 |
+
"type": "text",
|
| 1342 |
+
"text": "To verify our analysis, we develop a variant of Deformable-DETR by formulating its queries as dynamic anchor boxes as in DAB-DETR. We call this variant as DAB-Deformable-DETR, which is illustrated in Fig. 8 (f). Under exactly the same setting using R50 as the backbone, DABDeformable-DETR improves Deformable-DETR by 0.5 AP (46.3 to 46.8) on COCO. See Table 5 for the performance comparison and Sec. C for more implementation details. ",
|
| 1343 |
+
"bbox": [
|
| 1344 |
+
174,
|
| 1345 |
+
263,
|
| 1346 |
+
823,
|
| 1347 |
+
333
|
| 1348 |
+
],
|
| 1349 |
+
"page_idx": 12
|
| 1350 |
+
},
|
| 1351 |
+
{
|
| 1352 |
+
"type": "text",
|
| 1353 |
+
"text": "Dynamic DETR (Dai et al., 2021) is another interesting improvement of DETR. It also leverages anchor boxes to pool features, but it uses ROI pooling for feature extraction, which makes it less general to DETR-like models compared with our dynamic anchor boxes. Moreover, compared with cross-attention in Transformer decoders, which performs global feature pooling in a soft manner (based on attention maps), the ROI pooling operation only performs local feature pooling within a ROI window. In our opinion, the ROI pooling operation can help faster convergence as it enforces each query to associate with a specific spatial position. But it may lead to a sub-optimal result due to its ignorance of the global context outside a ROI window. ",
|
| 1354 |
+
"bbox": [
|
| 1355 |
+
174,
|
| 1356 |
+
340,
|
| 1357 |
+
825,
|
| 1358 |
+
450
|
| 1359 |
+
],
|
| 1360 |
+
"page_idx": 12
|
| 1361 |
+
},
|
| 1362 |
+
{
|
| 1363 |
+
"type": "text",
|
| 1364 |
+
"text": "C DAB-DEFORMABLE-DETR ",
|
| 1365 |
+
"text_level": 1,
|
| 1366 |
+
"bbox": [
|
| 1367 |
+
176,
|
| 1368 |
+
478,
|
| 1369 |
+
439,
|
| 1370 |
+
494
|
| 1371 |
+
],
|
| 1372 |
+
"page_idx": 12
|
| 1373 |
+
},
|
| 1374 |
+
{
|
| 1375 |
+
"type": "text",
|
| 1376 |
+
"text": "To further demonstrate the effectiveness of our dynamic anchor boxes, we develop DABDeformable-DETR by adding our dynamic anchor boxes design to Deformable DETR (Zhu et al., 2021) 2. The difference between Deformable DETR and DAB-Deformable-DETR is shown in Fig. 8 (e) and (f). The results of Deformable DETR and DAB-Deformable-DETR are shown in Table 5. With no more than 10 lines of code modified, our DAB-Deformable-DETR (row 4) results in a significant performance improvement $( + 0 . 5$ AP) compared with the original Deformable DETR (row 3). All other settings except the query formulation are exactly the same in this experiment. ",
|
| 1377 |
+
"bbox": [
|
| 1378 |
+
174,
|
| 1379 |
+
515,
|
| 1380 |
+
823,
|
| 1381 |
+
612
|
| 1382 |
+
],
|
| 1383 |
+
"page_idx": 12
|
| 1384 |
+
},
|
| 1385 |
+
{
|
| 1386 |
+
"type": "text",
|
| 1387 |
+
"text": "We also compare the speed of convergence in Fig. 9. It shows that our proposed dynamic anchor boxes speed up the training as well (left in Fig. 9). We believe one of the reasons for better performance is the update of learned queries. We plot the change of total loss, which is the sum-up of losses of all decoder layers, during training in the middle figure of Fig. 9. Interestingly, it shows that the total loss of DAB-Deformable-DETR is larger than Deformable DETR. However, the loss of the final layer of DAB-Deformable-DETR is lower than that in Deformable DETR (right in Fig. 9), which is a good indicator of the better performance of DAB-Deformable-DETR as the inference result only takes from the last layer. ",
|
| 1388 |
+
"bbox": [
|
| 1389 |
+
174,
|
| 1390 |
+
619,
|
| 1391 |
+
825,
|
| 1392 |
+
731
|
| 1393 |
+
],
|
| 1394 |
+
"page_idx": 12
|
| 1395 |
+
},
|
| 1396 |
+
{
|
| 1397 |
+
"type": "text",
|
| 1398 |
+
"text": "D ANCHORS VISUALIZATION ",
|
| 1399 |
+
"text_level": 1,
|
| 1400 |
+
"bbox": [
|
| 1401 |
+
176,
|
| 1402 |
+
757,
|
| 1403 |
+
431,
|
| 1404 |
+
773
|
| 1405 |
+
],
|
| 1406 |
+
"page_idx": 12
|
| 1407 |
+
},
|
| 1408 |
+
{
|
| 1409 |
+
"type": "text",
|
| 1410 |
+
"text": "We visualize the learned anchor boxes in Fig. 10. When learning anchor points as queries, the learned points are distributed evenly around the image, while the centers seem to distribute randomly when learning anchor boxes directly. This might be because the centers are coupled with anchor sizes. The right-most figure shows the visualization of the learned anchor boxes. We only show a partial set for visualization clarity. Most boxes are of medium size and no particular pattern is found in the distribution of boxes. ",
|
| 1411 |
+
"bbox": [
|
| 1412 |
+
174,
|
| 1413 |
+
794,
|
| 1414 |
+
825,
|
| 1415 |
+
877
|
| 1416 |
+
],
|
| 1417 |
+
"page_idx": 12
|
| 1418 |
+
},
|
| 1419 |
+
{
|
| 1420 |
+
"type": "image",
|
| 1421 |
+
"img_path": "images/2f874a661f0077ebab33b42d2ec4f95b3b8aeea4509a20ccab81cfb3c8803b35.jpg",
|
| 1422 |
+
"image_caption": [
|
| 1423 |
+
"Figure 8: Comparison of DETR-like models. For clarity, we only show two layers of Transformer decoder and omit the FFN blocks. We mark the modules with difference in purple and marked the learned high-dimensional queries in brown. DAB-DETR (c) is proposed in our paper, and DABDeformable-DETR (f) is a variant of Deformable DETR modified by introducing our dynamic anchors boxes. All previous models (a,b,d,e) leverage high-dimensional queries (shaded in brown) to pass positional information to each layers, which are semantic ambiguous and are not updated layer by layer. In contrast, DAB-DETR (c) directly uses dynamically updated anchor boxes to provide both a reference query point $( x , y )$ and a reference anchor size $( w , h )$ to improve the cross-attention computation. DAB-Deformable-DETR (f) uses dynamically updated anchor boxes to formulate its queries as well. "
|
| 1424 |
+
],
|
| 1425 |
+
"image_footnote": [],
|
| 1426 |
+
"bbox": [
|
| 1427 |
+
183,
|
| 1428 |
+
150,
|
| 1429 |
+
797,
|
| 1430 |
+
717
|
| 1431 |
+
],
|
| 1432 |
+
"page_idx": 13
|
| 1433 |
+
},
|
| 1434 |
+
{
|
| 1435 |
+
"type": "table",
|
| 1436 |
+
"img_path": "images/42e5c23c704b57c8610a040bc306e7af13fa4a4fbb345547ecc88c769ba16ecb.jpg",
|
| 1437 |
+
"table_caption": [],
|
| 1438 |
+
"table_footnote": [],
|
| 1439 |
+
"table_body": "<table><tr><td># row</td><td>Model</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>Params</td></tr><tr><td>1</td><td>Deformable DETR</td><td>43.8</td><td>62.6</td><td>47.7</td><td>26.4</td><td>47.1</td><td>58.0</td><td>40M</td></tr><tr><td>2</td><td>Deformable DETR+</td><td>45.4</td><td>64.7</td><td>49.0</td><td>26.8</td><td>48.3</td><td>61.7</td><td>40M</td></tr><tr><td>3</td><td>Deformable DETR+ (open source)</td><td>46.3</td><td>65.3</td><td>50.2</td><td>28.6</td><td>49.3</td><td>62.1</td><td>47M</td></tr><tr><td>4</td><td>DAB-Deformable-DETR(Ours)</td><td>46.8</td><td>66.0</td><td>50.4</td><td>29.1</td><td>49.8</td><td>62.3</td><td>47M</td></tr></table>",
|
| 1440 |
+
"bbox": [
|
| 1441 |
+
173,
|
| 1442 |
+
101,
|
| 1443 |
+
821,
|
| 1444 |
+
189
|
| 1445 |
+
],
|
| 1446 |
+
"page_idx": 14
|
| 1447 |
+
},
|
| 1448 |
+
{
|
| 1449 |
+
"type": "text",
|
| 1450 |
+
"text": "Table 5: Comparison of the results of Deformable DETR and DAB-Deformable-DETR. The models in row 1 and row 2 are copied from the original paper, and the models in row 3 and row 4 are tested under the same standard R50 multi-scale setting. Deformable ${ \\mathrm { D E T R } } +$ means the Deformable DETR model with iterative bounding box refinement and the result of Deformable ${ \\mathrm { D E T R } } +$ (open source) is reported by us using the open-source code. The only difference between row 3 and row 4 is the formulation of queries. ",
|
| 1451 |
+
"bbox": [
|
| 1452 |
+
173,
|
| 1453 |
+
198,
|
| 1454 |
+
825,
|
| 1455 |
+
281
|
| 1456 |
+
],
|
| 1457 |
+
"page_idx": 14
|
| 1458 |
+
},
|
| 1459 |
+
{
|
| 1460 |
+
"type": "image",
|
| 1461 |
+
"img_path": "images/3430213ad9e47dcaf4cb749924abde0accf5b8aabc5fd139dd09753f55880f09.jpg",
|
| 1462 |
+
"image_caption": [
|
| 1463 |
+
"Figure 9: Comparison of the training of Deformable DETR and DAB-Deformable-DETR models. We plot the change of AP (left), the loss of all layers (middle), and the loss of the last layer (right) during training, respectively. With no more than 10 lines of code modified, DAB-Deformable-DETR results in a better performance compared with the original Deformable DETR model (see the left figure). While the loss of all layers of DAB-Deformable-DETR is larger than that in Deformable DETR (see the middle figure), our models have a lower loss of the last layer (see the right figure), which is the most important as the inference result only takes from the last layer. The two models are tested under the same standard R50 multi-scale setting. "
|
| 1464 |
+
],
|
| 1465 |
+
"image_footnote": [],
|
| 1466 |
+
"bbox": [
|
| 1467 |
+
179,
|
| 1468 |
+
318,
|
| 1469 |
+
820,
|
| 1470 |
+
446
|
| 1471 |
+
],
|
| 1472 |
+
"page_idx": 14
|
| 1473 |
+
},
|
| 1474 |
+
{
|
| 1475 |
+
"type": "image",
|
| 1476 |
+
"img_path": "images/6b449d76f2700c4df12edfa6a844bcaa811a563c587bb63c23bfd8c27c1289e1.jpg",
|
| 1477 |
+
"image_caption": [
|
| 1478 |
+
"Figure 10: Learned anchor points when learning 2D coordinates only (left), and anchor center points (middle) and partial anchor boxes (right) when learning anchor boxes directly. "
|
| 1479 |
+
],
|
| 1480 |
+
"image_footnote": [],
|
| 1481 |
+
"bbox": [
|
| 1482 |
+
191,
|
| 1483 |
+
626,
|
| 1484 |
+
803,
|
| 1485 |
+
729
|
| 1486 |
+
],
|
| 1487 |
+
"page_idx": 14
|
| 1488 |
+
},
|
| 1489 |
+
{
|
| 1490 |
+
"type": "text",
|
| 1491 |
+
"text": "E RESULTS WITH DIFFERENT TEMPERATURES",
|
| 1492 |
+
"text_level": 1,
|
| 1493 |
+
"bbox": [
|
| 1494 |
+
173,
|
| 1495 |
+
809,
|
| 1496 |
+
573,
|
| 1497 |
+
825
|
| 1498 |
+
],
|
| 1499 |
+
"page_idx": 14
|
| 1500 |
+
},
|
| 1501 |
+
{
|
| 1502 |
+
"type": "text",
|
| 1503 |
+
"text": "Table 6 shows the results of models using different temperatures in the positional encoding function. As larger temperature generates more flattened attention maps, it leads to better performances for larger objects. For example, the model with $T = 2$ and the model with $T = 1 0 0 0 0$ have similar AP results, but the former has better performances on $\\mathsf { A P } _ { S }$ and $\\mathsf { A P } _ { M }$ , while the latter works better on $\\mathsf { A P } _ { L }$ , which also validates the role of positional priors in DETR. ",
|
| 1504 |
+
"bbox": [
|
| 1505 |
+
174,
|
| 1506 |
+
853,
|
| 1507 |
+
825,
|
| 1508 |
+
924
|
| 1509 |
+
],
|
| 1510 |
+
"page_idx": 14
|
| 1511 |
+
},
|
| 1512 |
+
{
|
| 1513 |
+
"type": "table",
|
| 1514 |
+
"img_path": "images/675b8405c2de001d30ab6a8b052d0eba909f67c74cb80ad134cf772344e9f61a.jpg",
|
| 1515 |
+
"table_caption": [],
|
| 1516 |
+
"table_footnote": [],
|
| 1517 |
+
"table_body": "<table><tr><td>Temperature</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>2</td><td>39.6</td><td>60.7</td><td>41.9</td><td>19.3</td><td>43.3</td><td>58.0</td></tr><tr><td>5</td><td>40.0</td><td>61.1</td><td>42.1</td><td>19.5</td><td>43.4</td><td>58.9</td></tr><tr><td>10</td><td>40.0</td><td>61.1</td><td>42.3</td><td>19.7</td><td>43.5</td><td>59.3</td></tr><tr><td>20</td><td>40.1</td><td>61.1</td><td>42.8</td><td>19.8</td><td>43.7</td><td>58.6</td></tr><tr><td>50</td><td>39.8</td><td>61.0</td><td>42.2</td><td>19.7</td><td>43.2</td><td>58.8</td></tr><tr><td>100</td><td>39.8</td><td>60.8</td><td>42.1</td><td>19.3</td><td>43.3</td><td>58.4</td></tr><tr><td>10000</td><td>39.5</td><td>60.7</td><td>41.7</td><td>18.9</td><td>42.6</td><td>58.9</td></tr></table>",
|
| 1518 |
+
"bbox": [
|
| 1519 |
+
303,
|
| 1520 |
+
101,
|
| 1521 |
+
691,
|
| 1522 |
+
234
|
| 1523 |
+
],
|
| 1524 |
+
"page_idx": 15
|
| 1525 |
+
},
|
| 1526 |
+
{
|
| 1527 |
+
"type": "text",
|
| 1528 |
+
"text": "Table 6: Comparison of models with different temperatures. All models are trained with the ResNet50 backbone, batch size 64, no multiple pattern embeddings, and no modulated attentions. Default Settings are used for the rest of the parameters. ",
|
| 1529 |
+
"bbox": [
|
| 1530 |
+
176,
|
| 1531 |
+
244,
|
| 1532 |
+
823,
|
| 1533 |
+
287
|
| 1534 |
+
],
|
| 1535 |
+
"page_idx": 15
|
| 1536 |
+
},
|
| 1537 |
+
{
|
| 1538 |
+
"type": "text",
|
| 1539 |
+
"text": "F RESULTS WITH LESS DECODER LAYERS ",
|
| 1540 |
+
"text_level": 1,
|
| 1541 |
+
"bbox": [
|
| 1542 |
+
174,
|
| 1543 |
+
313,
|
| 1544 |
+
539,
|
| 1545 |
+
329
|
| 1546 |
+
],
|
| 1547 |
+
"page_idx": 15
|
| 1548 |
+
},
|
| 1549 |
+
{
|
| 1550 |
+
"type": "table",
|
| 1551 |
+
"img_path": "images/c25c541809e8e8c82e07f71dedc0f3ebc0d7415050e41aa8b9dc537a670a9272.jpg",
|
| 1552 |
+
"table_caption": [
|
| 1553 |
+
"Table 7 shows the results of models with different decoder layers. All models are trained under our standard ResNet-50-DC setting except the number of decoder layers. ",
|
| 1554 |
+
"Table 7: Comparison of models with different number of decoder layers. All models are trained under our standard ResNet-50-DC setting except the number of decoder layers. "
|
| 1555 |
+
],
|
| 1556 |
+
"table_footnote": [],
|
| 1557 |
+
"table_body": "<table><tr><td>decoder layers</td><td>GFLOPs</td><td>Parmas</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>2</td><td>202</td><td>36M</td><td>40.2</td><td>59.0</td><td>42.9</td><td>22.2</td><td>43.5</td><td>55.4</td></tr><tr><td>3</td><td>206</td><td>38M</td><td>43.9</td><td>63.4</td><td>47.4</td><td>24.6</td><td>47.8</td><td>60.5</td></tr><tr><td>4</td><td>210</td><td>40M</td><td>44.9</td><td>64.5</td><td>48.2</td><td>25.9</td><td>48.5</td><td>61.0</td></tr><tr><td>5</td><td>213</td><td>42M</td><td>45.2</td><td>65.5</td><td>48.6</td><td>26.6</td><td>48.9</td><td>62.3</td></tr><tr><td>6</td><td>216</td><td>44M</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td></tr></table>",
|
| 1558 |
+
"bbox": [
|
| 1559 |
+
192,
|
| 1560 |
+
387,
|
| 1561 |
+
802,
|
| 1562 |
+
503
|
| 1563 |
+
],
|
| 1564 |
+
"page_idx": 15
|
| 1565 |
+
},
|
| 1566 |
+
{
|
| 1567 |
+
"type": "text",
|
| 1568 |
+
"text": "G FIXED $x , y$ FOR BETTER PERFORMANCE ",
|
| 1569 |
+
"text_level": 1,
|
| 1570 |
+
"bbox": [
|
| 1571 |
+
174,
|
| 1572 |
+
571,
|
| 1573 |
+
544,
|
| 1574 |
+
589
|
| 1575 |
+
],
|
| 1576 |
+
"page_idx": 15
|
| 1577 |
+
},
|
| 1578 |
+
{
|
| 1579 |
+
"type": "text",
|
| 1580 |
+
"text": "We provide in this section an interesting experiment. As we all know, all box coordinates $x , y , h , w$ are learned from data. When we fix $x , y$ of the anchor boxes with the random initialization, the model’s performance increases consistently. The comparison of standard DAB-DETR and DABDETR with fixed $x , y$ coordinates is shown in Table 8. Note that we only fix $x , y$ at the first layer to prevent them from learning information from data. But $x , y$ will be updated in other layers. We conjecture that the randomly initialized and fixed $x , y$ coordinates can help to avoid overfitting, which may account for this phenomenon. ",
|
| 1581 |
+
"bbox": [
|
| 1582 |
+
173,
|
| 1583 |
+
604,
|
| 1584 |
+
825,
|
| 1585 |
+
703
|
| 1586 |
+
],
|
| 1587 |
+
"page_idx": 15
|
| 1588 |
+
},
|
| 1589 |
+
{
|
| 1590 |
+
"type": "text",
|
| 1591 |
+
"text": "H COMPARISON OF BOX UPDATE ",
|
| 1592 |
+
"text_level": 1,
|
| 1593 |
+
"bbox": [
|
| 1594 |
+
176,
|
| 1595 |
+
724,
|
| 1596 |
+
465,
|
| 1597 |
+
741
|
| 1598 |
+
],
|
| 1599 |
+
"page_idx": 15
|
| 1600 |
+
},
|
| 1601 |
+
{
|
| 1602 |
+
"type": "text",
|
| 1603 |
+
"text": "To further demonstrate the effectiveness of our dynamic anchor box design, we plot the layer-bylayer update result of boxes of DAB-DETR and Conditional DETR in Fig. 11. All DETR-like models have a stacked layers structure. Hence the outputs of each layer can be viewed as a refining procedure. However, due to the high-dimensional queries that are shared across all layers, the update of queries between layers is not stable. As shaded in yellow in Fig. 11 (b), some boxes predicted in the latter layers are worse than their previous layers. ",
|
| 1604 |
+
"bbox": [
|
| 1605 |
+
174,
|
| 1606 |
+
757,
|
| 1607 |
+
825,
|
| 1608 |
+
840
|
| 1609 |
+
],
|
| 1610 |
+
"page_idx": 15
|
| 1611 |
+
},
|
| 1612 |
+
{
|
| 1613 |
+
"type": "text",
|
| 1614 |
+
"text": "I ANALYSIS OF FAILURE CASES ",
|
| 1615 |
+
"text_level": 1,
|
| 1616 |
+
"bbox": [
|
| 1617 |
+
176,
|
| 1618 |
+
863,
|
| 1619 |
+
454,
|
| 1620 |
+
878
|
| 1621 |
+
],
|
| 1622 |
+
"page_idx": 15
|
| 1623 |
+
},
|
| 1624 |
+
{
|
| 1625 |
+
"type": "text",
|
| 1626 |
+
"text": "Fig. 12 presents some samples where our model does not predict well. We find our model may have some troubles when facing dense objects, very small objects, or very large objects in an image. To ",
|
| 1627 |
+
"bbox": [
|
| 1628 |
+
173,
|
| 1629 |
+
895,
|
| 1630 |
+
823,
|
| 1631 |
+
924
|
| 1632 |
+
],
|
| 1633 |
+
"page_idx": 15
|
| 1634 |
+
},
|
| 1635 |
+
{
|
| 1636 |
+
"type": "table",
|
| 1637 |
+
"img_path": "images/b410bea6ea31bea032820b992ee3e1ab914708565a1ee303e89c4c48a95cb8ff.jpg",
|
| 1638 |
+
"table_caption": [],
|
| 1639 |
+
"table_footnote": [],
|
| 1640 |
+
"table_body": "<table><tr><td>Model</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td></tr><tr><td>DAB-DETR-R50*</td><td>42.6</td><td>63.2</td><td>45.6</td><td>21.8</td><td>46.2</td><td>61.1</td></tr><tr><td>DAB-DETR-R50*-fixedx&y</td><td>42.9(+0.3)</td><td>63.7</td><td>45.3</td><td>22.0</td><td>46.8</td><td>60.9</td></tr><tr><td>DAB-DETR-DC5-R50</td><td>44.5</td><td>65.1</td><td>47.7</td><td>25.3</td><td>48.2</td><td>62.3</td></tr><tr><td>DAB-DETR-DC5-R50-fixedx&y</td><td>44.7(+0.2)</td><td>65.3</td><td>47.9</td><td>24.9</td><td>48.2</td><td>62.0</td></tr><tr><td>DAB-DETR-DC5-R50*</td><td>45.7</td><td>66.2</td><td>49.0</td><td>26.1</td><td>49.4</td><td>63.1</td></tr><tr><td>DAB-DETR-DC5-R50*-fixedx&y</td><td>45.8(+0.1)</td><td>66.5</td><td>48.9</td><td>26.4</td><td>49.6</td><td>62.7</td></tr><tr><td>DAB-DETR-R101*</td><td>44.1</td><td>64.7</td><td>47.2</td><td>24.1</td><td>48.2</td><td>62.9</td></tr><tr><td>DAB-DETR-R101*-fixedx&y</td><td>44.8(+0.7)</td><td>65.4</td><td>48.2</td><td>25.1</td><td>48.9</td><td>63.1</td></tr><tr><td>DAB-DETR-DC5-R101*</td><td>46.6</td><td>67.0</td><td>50.2</td><td>28.1</td><td>50.5</td><td>64.1</td></tr><tr><td>DAB-DETR-DC5-R101*-fixedx&y</td><td>46.7(+0.1)</td><td>67.3</td><td>50.7</td><td>27.3</td><td>50.9</td><td>64.1</td></tr></table>",
|
| 1641 |
+
"bbox": [
|
| 1642 |
+
199,
|
| 1643 |
+
101,
|
| 1644 |
+
795,
|
| 1645 |
+
297
|
| 1646 |
+
],
|
| 1647 |
+
"page_idx": 16
|
| 1648 |
+
},
|
| 1649 |
+
{
|
| 1650 |
+
"type": "text",
|
| 1651 |
+
"text": "Table 8: Comparison of DAB-DETR and DAB-DETR with fixed anchor centers $x , y$ . When fixing $x , y$ of queries with random values, the performance of the models is improved consistently. The models with superscript ∗ use 3 pattern embeddings as in Anchor DETR. ",
|
| 1652 |
+
"bbox": [
|
| 1653 |
+
174,
|
| 1654 |
+
306,
|
| 1655 |
+
825,
|
| 1656 |
+
351
|
| 1657 |
+
],
|
| 1658 |
+
"page_idx": 16
|
| 1659 |
+
},
|
| 1660 |
+
{
|
| 1661 |
+
"type": "image",
|
| 1662 |
+
"img_path": "images/850c50a7c11ab1361824360ac39cddf01dfb784c6ba358b2cb4581244ed5f047.jpg",
|
| 1663 |
+
"image_caption": [
|
| 1664 |
+
"Figure 11: We compare the layer-by-layer update of boxes of DAB-DETR (a) and Conditional DETR (b). The green boxes are ground truth annotations while the red boxes are model predictions. The boxes of Conditional DETR have larger variances and we mark some boundaries of boxes with a large change in yellow. "
|
| 1665 |
+
],
|
| 1666 |
+
"image_footnote": [],
|
| 1667 |
+
"bbox": [
|
| 1668 |
+
183,
|
| 1669 |
+
381,
|
| 1670 |
+
808,
|
| 1671 |
+
676
|
| 1672 |
+
],
|
| 1673 |
+
"page_idx": 16
|
| 1674 |
+
},
|
| 1675 |
+
{
|
| 1676 |
+
"type": "text",
|
| 1677 |
+
"text": "improve the performance of our model, we will introduce a multi-scale technique into our model to improve the detection performance on small and large objects. ",
|
| 1678 |
+
"bbox": [
|
| 1679 |
+
173,
|
| 1680 |
+
786,
|
| 1681 |
+
823,
|
| 1682 |
+
815
|
| 1683 |
+
],
|
| 1684 |
+
"page_idx": 16
|
| 1685 |
+
},
|
| 1686 |
+
{
|
| 1687 |
+
"type": "text",
|
| 1688 |
+
"text": "J COMPARISON OF RUNTIME ",
|
| 1689 |
+
"text_level": 1,
|
| 1690 |
+
"bbox": [
|
| 1691 |
+
176,
|
| 1692 |
+
835,
|
| 1693 |
+
428,
|
| 1694 |
+
852
|
| 1695 |
+
],
|
| 1696 |
+
"page_idx": 16
|
| 1697 |
+
},
|
| 1698 |
+
{
|
| 1699 |
+
"type": "text",
|
| 1700 |
+
"text": "We compare the runtime of DETR, Conditional DETR, and our proposed DAB-DETR in Table 9. Their runtime speeds are reported on a single Nvidia A100 GPU. Our DAB-DETR has a similar inference speed but better performance compared with Conditional DETR, which is our direct competitor. ",
|
| 1701 |
+
"bbox": [
|
| 1702 |
+
174,
|
| 1703 |
+
867,
|
| 1704 |
+
825,
|
| 1705 |
+
924
|
| 1706 |
+
],
|
| 1707 |
+
"page_idx": 16
|
| 1708 |
+
},
|
| 1709 |
+
{
|
| 1710 |
+
"type": "image",
|
| 1711 |
+
"img_path": "images/a31e8a76ae5463290a978839dc53e49d1bb8163a707f2d5be3d26a858d20d3e7.jpg",
|
| 1712 |
+
"image_caption": [
|
| 1713 |
+
"Figure 12: We visualize some images where our model does not predict well, including dense objects (a,b,c), very small objects (d), and very large objects (e,f). The green boxes are ground truth annotations while red boxes are predictions of models. "
|
| 1714 |
+
],
|
| 1715 |
+
"image_footnote": [],
|
| 1716 |
+
"bbox": [
|
| 1717 |
+
218,
|
| 1718 |
+
107,
|
| 1719 |
+
779,
|
| 1720 |
+
378
|
| 1721 |
+
],
|
| 1722 |
+
"page_idx": 17
|
| 1723 |
+
},
|
| 1724 |
+
{
|
| 1725 |
+
"type": "table",
|
| 1726 |
+
"img_path": "images/3ad109b388878055fa1f6fd0b41fee40c6ce5030e3ce7bef89b49c53c737f337.jpg",
|
| 1727 |
+
"table_caption": [],
|
| 1728 |
+
"table_footnote": [
|
| 1729 |
+
"Table 9: Comparison of the runtime of DETR, Conditional DETR, and our proposed DAB-DETR. All speeds are reported on a single Nvidia A100 GPU. "
|
| 1730 |
+
],
|
| 1731 |
+
"table_body": "<table><tr><td>Model</td><td>time(s/img)</td><td>epoches</td><td>AP</td><td>AP50</td><td>AP75</td><td>APs</td><td>APM</td><td>APL</td><td>Parmas</td></tr><tr><td>DETR-R50</td><td>0.048</td><td>500</td><td>42.0</td><td>62.4</td><td>44.2</td><td>20.5</td><td>45.8</td><td>61.1</td><td>41M</td></tr><tr><td>Conditional DETR-R50</td><td>0.057</td><td>50</td><td>40.9</td><td>61.8</td><td>43.3</td><td>20.8</td><td>44.6</td><td>59.2</td><td>44M</td></tr><tr><td>DAB-DETR-R50</td><td>0.059</td><td>50</td><td>42.2</td><td>63.1</td><td>44.7</td><td>21.5</td><td>45.7</td><td>60.3</td><td>44M</td></tr><tr><td>DETR-R101</td><td>0.074</td><td>500</td><td>43.5</td><td>63.8</td><td>46.4</td><td>21.9</td><td>48.0</td><td>61.8</td><td>60M</td></tr><tr><td>Conditional DETR-R101</td><td>0.082</td><td>50</td><td>42.8</td><td>63.7</td><td>46.0</td><td>21.7</td><td>46.6</td><td>60.9</td><td>63M</td></tr><tr><td>DAB-DETR-R101</td><td>0.085</td><td>50</td><td>43.5</td><td>63.9</td><td>46.6</td><td>23.6</td><td>47.3</td><td>61.5</td><td>63M</td></tr></table>",
|
| 1732 |
+
"bbox": [
|
| 1733 |
+
236,
|
| 1734 |
+
454,
|
| 1735 |
+
756,
|
| 1736 |
+
545
|
| 1737 |
+
],
|
| 1738 |
+
"page_idx": 17
|
| 1739 |
+
},
|
| 1740 |
+
{
|
| 1741 |
+
"type": "text",
|
| 1742 |
+
"text": "K COMPARISON OF MODEL CONVERGENCE ",
|
| 1743 |
+
"text_level": 1,
|
| 1744 |
+
"bbox": [
|
| 1745 |
+
176,
|
| 1746 |
+
607,
|
| 1747 |
+
553,
|
| 1748 |
+
623
|
| 1749 |
+
],
|
| 1750 |
+
"page_idx": 17
|
| 1751 |
+
},
|
| 1752 |
+
{
|
| 1753 |
+
"type": "text",
|
| 1754 |
+
"text": "We present convergence curves of DETR, Conditional DETR, and our DAB-DETR in Fig. 13. All models are trained under the standard R50 (DC5) setting. The results demonstrate the effectiveness of our model. Our DAB-DETR is trained with our f ix x&y variants. see Appendix G for more details about the f ix x&y results. Both Conditional DETR and DAB-DETR use 300 queries, while DETR leverages 100 queries. ",
|
| 1755 |
+
"bbox": [
|
| 1756 |
+
174,
|
| 1757 |
+
638,
|
| 1758 |
+
825,
|
| 1759 |
+
709
|
| 1760 |
+
],
|
| 1761 |
+
"page_idx": 17
|
| 1762 |
+
},
|
| 1763 |
+
{
|
| 1764 |
+
"type": "text",
|
| 1765 |
+
"text": "Our DAB-DETR converges faster than Conditional DETR, especially in early epochs, as shown in Fig. 13. ",
|
| 1766 |
+
"bbox": [
|
| 1767 |
+
173,
|
| 1768 |
+
715,
|
| 1769 |
+
823,
|
| 1770 |
+
746
|
| 1771 |
+
],
|
| 1772 |
+
"page_idx": 17
|
| 1773 |
+
},
|
| 1774 |
+
{
|
| 1775 |
+
"type": "text",
|
| 1776 |
+
"text": "L VISUALIZATION RESULTS OF ITERATIVE BOX UPDATE ",
|
| 1777 |
+
"text_level": 1,
|
| 1778 |
+
"bbox": [
|
| 1779 |
+
174,
|
| 1780 |
+
765,
|
| 1781 |
+
660,
|
| 1782 |
+
781
|
| 1783 |
+
],
|
| 1784 |
+
"page_idx": 17
|
| 1785 |
+
},
|
| 1786 |
+
{
|
| 1787 |
+
"type": "text",
|
| 1788 |
+
"text": "We present more visualization results of iterative box update in Fig. 14 and Fig. 15. The initial anchors, anchors updated after the first decoder layer, and the anchors predicted from the last decoder layer are plotted in the first, the second, and the third columns, respectively. ",
|
| 1789 |
+
"bbox": [
|
| 1790 |
+
174,
|
| 1791 |
+
795,
|
| 1792 |
+
825,
|
| 1793 |
+
838
|
| 1794 |
+
],
|
| 1795 |
+
"page_idx": 17
|
| 1796 |
+
},
|
| 1797 |
+
{
|
| 1798 |
+
"type": "image",
|
| 1799 |
+
"img_path": "images/7a9df52599b389114a8a669fbda2f4b198552611d6af5f1c942a12bf8b48f894.jpg",
|
| 1800 |
+
"image_caption": [
|
| 1801 |
+
"Figure 13: Convergence curves of DETR, Conditional DETR, and our DAB-DETR. All models are trained under the R50 (DC5) setting. "
|
| 1802 |
+
],
|
| 1803 |
+
"image_footnote": [],
|
| 1804 |
+
"bbox": [
|
| 1805 |
+
187,
|
| 1806 |
+
160,
|
| 1807 |
+
807,
|
| 1808 |
+
476
|
| 1809 |
+
],
|
| 1810 |
+
"page_idx": 18
|
| 1811 |
+
},
|
| 1812 |
+
{
|
| 1813 |
+
"type": "image",
|
| 1814 |
+
"img_path": "images/a4b9482a92d4ad87396afa7480a953088964567897b4edbe32be28762214ed39.jpg",
|
| 1815 |
+
"image_caption": [
|
| 1816 |
+
"Figure 14: Visualizations for layer-by-layer anchor box update. We plot the initial anchor boxes (left), anchor boxes after the first decoder layer (middle), and the output of the last decoder layer (right), respectively. The green boxes are ground truth annotations, while the red boxes are predictions of our model. The results are obtained using the ResNet-50 backbone. More visualizations are available in Fig. 15. "
|
| 1817 |
+
],
|
| 1818 |
+
"image_footnote": [],
|
| 1819 |
+
"bbox": [
|
| 1820 |
+
181,
|
| 1821 |
+
642,
|
| 1822 |
+
816,
|
| 1823 |
+
785
|
| 1824 |
+
],
|
| 1825 |
+
"page_idx": 18
|
| 1826 |
+
},
|
| 1827 |
+
{
|
| 1828 |
+
"type": "image",
|
| 1829 |
+
"img_path": "images/faa8d29382710dd216a22abfad2ecb69d30f262b0d91fdaa53ed34516a1fdddc.jpg",
|
| 1830 |
+
"image_caption": [
|
| 1831 |
+
"Figure 15: More visualizations for layer-by-layer anchor box update. We plot the initial anchor boxes (left), anchor boxes after the first decoder layer (middle), and the output of the last decoder layer (right), respectively. The green boxes are ground truth annotations, while the red boxes are predictions of our model. The results are obtained using the ResNet-50 backbone. "
|
| 1832 |
+
],
|
| 1833 |
+
"image_footnote": [],
|
| 1834 |
+
"bbox": [
|
| 1835 |
+
181,
|
| 1836 |
+
152,
|
| 1837 |
+
816,
|
| 1838 |
+
805
|
| 1839 |
+
],
|
| 1840 |
+
"page_idx": 19
|
| 1841 |
+
}
|
| 1842 |
+
]
|
parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/oMI9PjOb9Jl/oMI9PjOb9Jl_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/tZmqS73_07/tZmqS73_07_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|